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/invProductDao.xml

84 lines
3.4 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.InvProductDao">
<select id="filterList" resultType="com.glxp.api.res.inv.InvProductResponse"
parameterType="com.glxp.api.req.inv.FilterInvProductRequest">
select ip.id,
ip.nameCode,
bp.cpmctymc,
ip.relIdFk,
bp.ggxh,
ip.batchNo,
ip.productionDate,
ip.expireDate,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
ip.inCount,
ip.outCount,
ip.reCount,
ip.customerId,
basic_corp.name supName,
ip.supId,
auth_dept.name deptName,
auth_warehouse.name invName,
ip.deptCode,
ip.invCode
from inv_product ip
inner join basic_udirel on ip.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ip.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ip.deptCode
left join auth_warehouse on auth_warehouse.code = ip.invCode
<where>
bp.diType = 1
<if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
</if>
<if test="nameCode != null and nameCode != ''">
AND ip.nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="relIdFk != null and relIdFk != ''">
AND ip.relIdFk = #{relIdFk}
</if>
<if test="ggxh != null and ggxh != ''">
AND bp.ggxh like concat('%', #{ggxh}, '%')
</if>
<if test="batchNo != null and batchNo != ''">
AND ip.batchNo like concat('%', #{batchNo}, '%')
</if>
<if test="productionDate != null and productionDate != ''">
AND ip.productionDate = #{productionDate}
</if>
<if test="expireDate != null and expireDate != ''">
AND ip.expireDate = #{expireDate}
</if>
<if test="ylqxzcrbarmc != null and ylqxzcrbarmc != ''">
AND bp.ylqxzcrbarmc like concat('%', #{ylqxzcrbarmc}, '%')
</if>
<if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''">
AND bp.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%')
</if>
<if test="customerId != null and customerId != ''">
AND ip.customerId = #{customerId}
</if>
<if test="supId != null and supId != ''">
AND ip.supId = #{supId}
</if>
<if test="deptCode != null and deptCode != ''">
AND ip.deptCode = #{deptCode}
</if>
<if test="invCode != null and invCode != ''">
AND ip.invCode = #{invCode}
</if>
<if test="invCodes != null and invCodes.size() != 0">
AND ip.invCode in
<foreach collection="invCodes" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>