You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
udi-wms-java/src/main/resources/mybatis/mapper/inv/InvPreinDetailDao.xml

57 lines
2.5 KiB
XML

<?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="com.glxp.api.dao.inv.InvPreinDetailDao">
<select id="filterList" parameterType="com.glxp.api.req.inv.FilterInvPreinDetailRequest"
resultType="com.glxp.api.res.inv.InvPreinDetailResponse">
select ic.*,
bp.cpmctymc productName,
bp.ggxh,
bp.manufactory,
bp.zczbhhzbapzbh,
bp.measname,
inv_prein_order.auditTime,
inv_prein_order.billNo,
aw.name invName,
bc.name fromName
from inv_prein_detail ic
inner join inv_prein_order on orderId = inv_prein_order.billNo
left join basic_udirel bu on bu.id = ic.relId
left join basic_products bp on bu.uuid = bp.uuid
left join auth_warehouse aw on inv_prein_order.invCode = aw.code
left join basic_corp bc on inv_prein_order.fromCorp = bc.erpId
<where>
<if test="orderId != null and orderId != ''">
AND ic.orderId = #{orderId}
</if>
<if test="code != null and code != ''">
and ic.code like concat('%', #{code}, '%')
</if>
<if test="batchNo != null and batchNo != ''">
AND ic.batchNo = #{batchNo}
</if>
<if test="nameCode != null and nameCode != ''">
AND ic.nameCode = #{nameCode}
</if>
<if test="invCode != null and invCode != ''">
AND inv_prein_order.invCode = #{invCode}
</if>
<if test="productName != null and productName != ''">
AND bp.cpmctymc = #{productName}
</if>
<if test="ggxh != null and ggxh != ''">
and bp.ggxh like concat('%', #{ggxh}, '%')
</if>
<if test="manufactory != null and manufactory != ''">
AND bp.manufactory = #{manufactory}
</if>
<if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''">
AND bp.zczbhhzbapzbh = #{zczbhhzbapzbh}
</if>
<if test="startAduditTime != null and startAduditTime != '' and endAduditTime != null and endAduditTime != ''">
AND date_format(inv_prein_order.auditTime, '%Y-%m-%d') between date_format(#{startAduditTime}, '%Y-%m-%d') and date_format(#{endAduditTime}, '%Y-%m-%d')
</if>
</where>
group by ic.id
</select>
</mapper>