<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.personnels.mapper.FtbPersonnelsGoodsMapper">

    <select id="listPages" resultType="jnpf.model.personnels.vo.goods.FtbPersonnelsGoodsPageVO">
        SELECT
        F_Id AS id,
        F_GoodsName AS goodsName,
        F_GoodsCode AS goodsCode,
        F_NeedReturn AS needReturn,
        F_Quantity AS quantity,
        F_ReturnedQuantity AS returnedQuantity,
        F_Remark AS remark
        FROM ftb_personnels_goods a
        WHERE a.F_EnableMark = 0
        <if test="params.goodsName != null and params.goodsName != ''">
            AND (a.F_GoodsName LIKE CONCAT('%',#{params.goodsName},'%') or a.F_GoodsCode LIKE CONCAT('%',#{params.goodsName},'%'))
        </if>
        <if test="params.needReturn != null">
            AND a.F_NeedReturn = #{params.needReturn}
        </if>
        <if test="params.filterZero != null and params.filterZero == 1">
            AND a.F_ReturnedQuantity > 0
        </if>
        order by a.F_CreatorTime desc
    </select>
</mapper>