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/collect/IoCollectOrderBizMapper.xml

111 lines
5.1 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.collect.IoCollectOrderBizMapper">
<select id="filterList" parameterType="com.glxp.api.req.collect.CollectOrderBizRequest"
resultType="com.glxp.api.res.collect.CollectOrderBizResponse">
SELECT icob.*,
bp.nameCode diCode,
bp.measname,
bp.zczbhhzbapzbh,
bp.manufactory,
COALESCE(bp.bzgg, icob.ggxh) AS spec,
bp.prepnSpec AS prepnSpec,
swf.name freightName,
swl.name layerName,
swr.regionName,
sys_workplace_queue.code as workplaceQueueCode,
sys_workplace_queue.name queueName
FROM io_collect_order_biz icob
left join basic_udirel bu on icob.relId = bu.id
left join basic_products bp on bu.uuid = bp.uuid
left join sys_workplace_queue on sys_workplace_queue.relId = bu.id
left join sys_workplace_layer swl on swl.code = sys_workplace_queue.layerCode
left join sys_workplace_freight swf on swf.code = sys_workplace_queue.freightCode
left join sys_workplace_region swr on swr.regionCode = swf.freightRow
<where>
<if test="thrCode != '' and thrCode != null">
AND icob.thrCode LIKE concat('%', #{thrCode}, '%')
</if>
<if test="orderIdFk != null and orderIdFk != ''">
AND icob.orderIdFk = #{orderIdFk}
</if>
<if test="relId != null">
AND icob.relId = #{relId}
</if>
<if test="cpmctymc != null and cpmctymc != ''">
AND icob.cpmctymc LIKE concat('%', #{cpmctymc}, '%')
</if>
<if test="unionCode != '' and unionCode != null">
and (
bp.nameCode LIKE concat( #{unionCode}, '%')
or bp.ybbm LIKE concat( #{unionCode}, '%')
or bp.sptm LIKE concat(#{unionCode}, '%'))
</if>
<if test="ggxh != '' and ggxh != null">
AND ggxh LIKE concat( #{ggxh}, '%')
</if>
</where>
group by icob.id
ORDER BY icob.getConfirm, icob.id desc
</select>
<update id="updateAutoResCount" parameterType="map">
UPDATE io_collect_order_biz
SET autoResCount = #{autoResCount}
WHERE id = #{id}
</update>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id"
parameterType="com.glxp.api.entity.collect.IoCollectOrderBiz" useGeneratedKeys="true">
insert into io_collect_order_biz
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
orderIdFk, relId, thrCode, ybbm, sptm, payFeeCode, cpmctymc, nameCode, ggxh, batchNo,
productDate,
expireDate,
count, actCount, scanCount, scanActCount, measureUnit, tagStatus, tagMsg, remark, createTime, updateTime,
unTagCount,
autoResCount, replaceCode, autoTagStatus, tempWorkPlaceCount, splitUnCheck, tempSplitCount, searchRemark1
, searchRemark2, searchRemark3, searchRemark4, searchRemark5, remark1, remark2
, remark3, remark4, remark5, remark6, remark7, remark8, remark9, remark10, getConfirm,checkCode
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{orderIdFk}, #{relId}, #{thrCode}, #{ybbm}, #{sptm}, #{payFeeCode}, #{cpmctymc}, #{nameCode}, #{ggxh},
#{batchNo},
#{productDate}, #{expireDate}, #{count}, #{actCount}, #{scanCount}, #{scanActCount}, #{measureUnit},
#{tagStatus}, #{tagMsg}, #{remark}, #{createTime}, #{updateTime},
#{unTagCount}, #{autoResCount}, #{replaceCode}, #{autoTagStatus}, #{tempWorkPlaceCount}, #{splitUnCheck},
#{tempSplitCount}, #{searchRemark1},
#{searchRemark2}, #{searchRemark3}, #{searchRemark4}, #{searchRemark5}, #{remark1}, #{remark2},
#{remark3}, #{remark4}, #{remark5}, #{remark6}, #{remark7}, #{remark8}, #{remark9}, #{remark10},
#{getConfirm},#{checkCode}
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="addCount != null">
count = count + #{addCount},
</if>
<if test="addActCount != null">
actCount = IFNULL(actCount, 0) + #{addActCount},
</if>
<if test="addScanCount != null">
scanCount = IFNULL(scanCount, 0) + #{addScanCount},
</if>
<if test="addScanActCount != null">
scanActCount = IFNULL(scanActCount, 0) + #{addScanActCount},
</if>
</trim>
</insert>
</mapper>