|
|
@@ -156,5 +156,145 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
+ <select id="transferDetail" resultType="org.springblade.salesPart.dto.TransferDto">
|
|
|
+ SELECT
|
|
|
+ ps.billno as billno,
|
|
|
+ psi.goods_no as code,
|
|
|
+ psi.goods_name as goodsName,
|
|
|
+ ps.storage_name as storageName,
|
|
|
+ ps.call_in_storage_name as callInStorageName,
|
|
|
+ psi.dot as dot,
|
|
|
+ psi.goods_num as sendNum,
|
|
|
+ psi.send_num_financing as sendNumFinancing,
|
|
|
+ psi.send_num_have as sendNumHave,
|
|
|
+ ps.busines_date as businesDate,
|
|
|
+ psi.brand_name as brandName,
|
|
|
+ psi.pattern as pattern,
|
|
|
+ psi.property_name as propertyName,
|
|
|
+ ps.status_name as statusName,
|
|
|
+ ps.stock_clerk_name as stockClerkName,
|
|
|
+ ps.remarks as remarks,
|
|
|
+ ps.id as id,
|
|
|
+ psi.id as itemId
|
|
|
+ FROM
|
|
|
+ pjpf_ship ps
|
|
|
+ LEFT JOIN pjpf_ship_items psi ON ps.id = psi.pid
|
|
|
+ WHERE
|
|
|
+ ps.tenant_id = #{data.tenantId}
|
|
|
+ AND psi.tenant_id = #{data.tenantId}
|
|
|
+ AND ps.is_deleted = '0'
|
|
|
+ AND psi.is_deleted = '0'
|
|
|
+ AND ps.biz_type_name = 'DBGD'
|
|
|
+ <if test="data.billno !=null and data.billno != ''">
|
|
|
+ and ps.billno like concat('%', #{data.billno}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.goodsName !=null and data.goodsName != ''">
|
|
|
+ and psi.goods_name like concat('%', #{data.goodsName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.code !=null and data.code != ''">
|
|
|
+ and psi.goods_no like concat('%', #{data.code}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.storageName !=null and data.storageName != ''">
|
|
|
+ and ps.storage_name like concat('%', #{data.storageName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.storageId !=null ">
|
|
|
+ and ps.storage_id = #{data.storageId}
|
|
|
+ </if>
|
|
|
+ <if test="data.storageName !=null and data.callInStorageName != ''">
|
|
|
+ and ps.call_in_storage_name like concat('%', #{data.callInStorageName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.callInStorageId !=null ">
|
|
|
+ and ps.call_in_storage_id = #{data.callInStorageId}
|
|
|
+ </if>
|
|
|
+ <if test="data.stockClerkName !=null and data.stockClerkName != ''">
|
|
|
+ and ps.stock_clerk_name like concat('%', #{data.stockClerkName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.stockClerkId !=null ">
|
|
|
+ and ps.stock_clerk_id = #{data.stockClerkId}
|
|
|
+ </if>
|
|
|
+ <if test="data.statusName !=null and data.statusName != ''">
|
|
|
+ and ps.status_name = #{data.statusName}
|
|
|
+ </if>
|
|
|
+ <if test="data.businesDateList !=null and data.businesDateList[0] !='' and data.businesDateList[0] != null">
|
|
|
+ and DATE_FORMAT(ps.busines_date,'%Y-%m-%d') >= #{data.businesDateList[0]}
|
|
|
+ </if>
|
|
|
+ <if test="data.businesDateList !=null and data.businesDateList[1] !='' and data.businesDateList[1] != null">
|
|
|
+ and DATE_FORMAT(ps.busines_date,'%Y-%m-%d') <= #{data.businesDateList[1]}
|
|
|
+ </if>
|
|
|
+ <if test="data.brandName !=null and data.brandName != ''">
|
|
|
+ and psi.brand_name = #{data.brandName}
|
|
|
+ </if>
|
|
|
+ ORDER BY ps.busines_date DESC,ps.billno DESC
|
|
|
+ </select>
|
|
|
+ <select id="transferDetailList" resultType="org.springblade.salesPart.dto.TransferDto">
|
|
|
+ SELECT
|
|
|
+ ps.billno as billno,
|
|
|
+ psi.goods_no as code,
|
|
|
+ psi.goods_name as goodsName,
|
|
|
+ ps.storage_name as storageName,
|
|
|
+ ps.call_in_storage_name as callInStorageName,
|
|
|
+ psi.dot as dot,
|
|
|
+ psi.goods_num as sendNum,
|
|
|
+ psi.send_num_financing as sendNumFinancing,
|
|
|
+ psi.send_num_have as sendNumHave,
|
|
|
+ ps.busines_date as businesDate,
|
|
|
+ psi.brand_name as brandName,
|
|
|
+ psi.pattern as pattern,
|
|
|
+ psi.property_name as propertyName,
|
|
|
+ ps.status_name as statusName,
|
|
|
+ ps.stock_clerk_name as stockClerkName,
|
|
|
+ ps.remarks as remarks,
|
|
|
+ ps.id as id,
|
|
|
+ psi.id as itemId
|
|
|
+ FROM
|
|
|
+ pjpf_ship ps
|
|
|
+ LEFT JOIN pjpf_ship_items psi ON ps.id = psi.pid
|
|
|
+ WHERE
|
|
|
+ ps.tenant_id = #{data.tenantId}
|
|
|
+ AND psi.tenant_id = #{data.tenantId}
|
|
|
+ AND ps.is_deleted = '0'
|
|
|
+ AND psi.is_deleted = '0'
|
|
|
+ AND ps.biz_type_name = 'DBGD'
|
|
|
+ <if test="data.billno !=null and data.billno != ''">
|
|
|
+ and ps.billno like concat('%', #{data.billno}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.goodsName !=null and data.goodsName != ''">
|
|
|
+ and psi.goods_name like concat('%', #{data.goodsName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.code !=null and data.code != ''">
|
|
|
+ and psi.goods_no like concat('%', #{data.code}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.storageName !=null and data.storageName != ''">
|
|
|
+ and ps.storage_name like concat('%', #{data.storageName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.storageId !=null ">
|
|
|
+ and ps.storage_id = #{data.storageId}
|
|
|
+ </if>
|
|
|
+ <if test="data.storageName !=null and data.callInStorageName != ''">
|
|
|
+ and ps.call_in_storage_name like concat('%', #{data.callInStorageName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.callInStorageId !=null ">
|
|
|
+ and ps.call_in_storage_id = #{data.callInStorageId}
|
|
|
+ </if>
|
|
|
+ <if test="data.stockClerkName !=null and data.stockClerkName != ''">
|
|
|
+ and ps.stock_clerk_name like concat('%', #{data.stockClerkName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="data.stockClerkId !=null ">
|
|
|
+ and ps.stock_clerk_id = #{data.stockClerkId}
|
|
|
+ </if>
|
|
|
+ <if test="data.statusName !=null and data.statusName != ''">
|
|
|
+ and ps.status_name = #{data.statusName}
|
|
|
+ </if>
|
|
|
+ <if test="data.businesDateList !=null and data.businesDateList[0] !='' and data.businesDateList[0] != null">
|
|
|
+ and DATE_FORMAT(ps.busines_date,'%Y-%m-%d') >= #{data.businesDateList[0]}
|
|
|
+ </if>
|
|
|
+ <if test="data.businesDateList !=null and data.businesDateList[1] !='' and data.businesDateList[1] != null">
|
|
|
+ and DATE_FORMAT(ps.busines_date,'%Y-%m-%d') <= #{data.businesDateList[1]}
|
|
|
+ </if>
|
|
|
+ <if test="data.brandName !=null and data.brandName != ''">
|
|
|
+ and psi.brand_name = #{data.brandName}
|
|
|
+ </if>
|
|
|
+ ORDER BY ps.busines_date DESC,ps.billno DESC
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|