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/inout/IoCodeDao.xml

140 lines
5.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.inout.IoCodeDao">
<select id="filterCodeList" resultType="com.glxp.api.entity.inout.IoCodeEntity"
parameterType="com.glxp.api.req.inout.FilterCodeRequest">
select *
from io_code
<where>
<if test="code != null and code != ''">
AND code = #{code}
</if>
<if test="orderId != null and orderId != ''">
AND orderId like concat('%', #{orderId}, '%')
</if>
<if test="nameCode != null and nameCode != ''">
AND nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="supId != null and supId != ''">
AND supId like concat('%', #{supId}, '%')
</if>
<if test="relId != null and relId != ''">
AND relId like concat('%', #{relId}, '%')
</if>
<if test="deptCode != null and deptCode != ''">
AND deptCode = #{deptCode}
</if>
<if test="invCode != null and invCode != ''">
AND invCode = #{invCode}
</if>
<if test="warehouseCode != null and warehouseCode != ''">
AND warehouseCode = #{warehouseCode}
</if>
<if test="packageLevel != null and packageLevel != ''">
AND packageLevel = #{packageLevel}
</if>
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="corpOrderId != null and corpOrderId != ''">
AND corpOrderId = #{corpOrderId}
</if>
<if test="actions != null and actions.size() != 0">
AND action in
<foreach collection="actions" item="item" open="(" close=")" index="index" separator=",">
#{item}
</foreach>
</if>
</where>
</select>
<select id="filterList" resultType="com.glxp.api.res.inout.IoCodeResponse">
select ic.*,
bp.cpmctymc productName,
bp.ggxh,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
bp.manufactory,
ad.name deptName,
aw.name invName,
auth_space.name warehouseName,
bc.name supName
from io_code ic
left join auth_dept ad on ic.deptCode = ad.code
left join auth_warehouse aw on ic.invCode = aw.code
left join auth_space on auth_space.code = ic.warehouseCode
left join basic_udirel bu on bu.id = ic.relId
left join basic_products bp on bu.uuid = bp.uuid
left join basic_corp bc on bc.erpId = ic.supId
<where>
<if test="code != null and code != ''">
AND ic.code = #{code}
</if>
<if test="orderId != null and orderId != ''">
AND ic.orderId like concat('%', #{orderId}, '%')
</if>
<if test="nameCode != null and nameCode != ''">
AND ic.nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="supId != null and supId != ''">
AND ic.supId like concat('%', #{supId}, '%')
</if>
<if test="relId != null and relId != ''">
AND ic.relId like concat('%', #{relId}, '%')
</if>
<if test="deptCode != null and deptCode != ''">
AND ic.deptCode = #{deptCode}
</if>
<if test="invCode != null and invCode != ''">
AND ic.invCode = #{invCode}
</if>
<if test="warehouseCode != null and warehouseCode != ''">
AND ic.warehouseCode = #{warehouseCode}
</if>
<if test="packageLevel != null and packageLevel != ''">
AND ic.packageLevel = #{packageLevel}
</if>
<if test="batchNo != null and batchNo != ''">
AND ic.batchNo = #{batchNo}
</if>
<if test="corpOrderId != null and corpOrderId != ''">
AND ic.corpOrderId = #{corpOrderId}
</if>
<if test="actions != null and actions.size() != 0">
AND ic.action in
<foreach collection="actions" item="item" open="(" close=")" index="index" separator=",">
#{item}
</foreach>
</if>
</where>
group by ic.id
</select>
<select id="filterJoinProduct" resultType="com.glxp.api.res.inout.IoCodeResponse">
select ic.*,
bp.cpmctymc productName,
bp.ggxh,
bp.ylqxzcrbarmc,
bp.zczbhhzbapzbh,
bp.manufactory
from io_code ic
left join basic_products bp on bp.nameCode = ic.nameCode
<where>
<if test="orderId != null and orderId != ''">
AND ic.orderId = #{orderId}
</if>
</where>
group by ic.id
</select>
<select id="selectSupIdByCode" resultType="java.lang.String">
select supId
from io_code
where code = #{code}
limit 1
</select>
</mapper>