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

90 lines
4.0 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.IoCollectOrderMapper">
<select id="filterList" parameterType="com.glxp.api.req.collect.CollectOrderRequest"
resultType="com.glxp.api.res.collect.IoCollectOrderResponse">
11 months ago
SELECT
11 months ago
ico.billNo,ico.busType,ico.fromType,ico.fromTypeDesc,ico.fromCorp,ico.billTime,ico.orderCirType,
11 months ago
ico.createTime,ico.workPlaceCode,ico.remark,ico.createUser,ico.updateTime,ico.updateUser,ico.tagStatus,ico.splitStatus,ico.splitMsg
,ico.tagMsg,
11 months ago
sys_workplace_document.busName busTypeName,
11 months ago
bc.name fromCorpName,
sw.workplaceId workPlaceCode,
11 months ago
sw.workplaceName,ico.id,ico.orderTime,
row_number() over ( order by ico.orderTime desc ) as orderSequence
11 months ago
FROM io_collect_order ico
11 months ago
left join sys_workplace_document on ico.busType = sys_workplace_document.documentTypeCode
11 months ago
left join basic_corp bc on ico.fromCorp = bc.erpId
left join sys_workplace sw on ico.workPlaceCode = sw.workplaceId
<where>
<if test="billNo != '' and billNo != null">
AND billNo LIKE concat('%', #{billNo}, '%')
</if>
<if test="workplaceName != '' and workplaceName != null">
AND workplaceName LIKE concat('%', #{workplaceName}, '%')
</if>
<if test="busType != null and busType != ''">
AND busType = #{busType}
</if>
<if test="fromType != null and fromType != ''">
11 months ago
AND sys_workplace_document.fromType LIKE concat('%', #{fromType}, '%')
</if>
<if test="fromCorp != '' and fromCorp != null">
AND fromCorp LIKE concat('%', #{fromCorp}, '%')
</if>
<if test="collectCode != null and collectCode != ''">
AND collectCode = #{collectCode}
</if>
<if test="busType != null and busType != ''">
AND busType = #{busType}
</if>
<if test="tagStatus != null">
AND tagStatus = #{tagStatus}
</if>
11 months ago
<if test="workPlaceCode != null ">
11 months ago
AND ico.workPlaceCode = #{workPlaceCode}
</if>
<if test="chargeUser != null ">
AND sw.chargeUser = #{chargeUser}
</if>
11 months ago
<if test="unionKey != null ">
AND
(
ico.unionKey like concat('%', #{billNo}, '%')
or ico.unionKey like concat('%', #{fromCorp}, '%')
or ico.unionKey like concat('%', #{fromCorpName}, '%')
or ico.unionKey like concat('%', #{backupOrderRemark1}, '%')
or ico.unionKey like concat('%', #{backupOrderRemark2}, '%')
or ico.unionKey like concat('%', #{backupOrderRemark3}, '%')
or ico.unionKey like concat('%', #{backupOrderRemark4}, '%')
or ico.unionKey like concat('%', #{backupOrderRemark5}, '%')
or ico.unionKey like concat('%', #{backupOrderRemark6}, '%'))
</if>
<if test="tagStatusList != null and tagStatusList.size() > 0">
11 months ago
and tagStatus in
<foreach collection="tagStatusList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
11 months ago
order by orderTime desc
</select>
11 months ago
<select id="clearOrder">
-- 清除拆零队列
TRUNCATE io_split_code;
TRUNCATE io_split_code_detail;
TRUNCATE io_split_fifo_code;
-- 清除拆零,原始单据等
TRUNCATE io_collect_order;
TRUNCATE io_collect_order_biz;
TRUNCATE io_collect_order_code_auto;
TRUNCATE io_collect_order_code_man
</select>
</mapper>