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.
257 lines
11 KiB
XML
257 lines
11 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.admin.dao.thrsys.ThrOrderDao">
|
|
|
|
<select id="filterThrOrder" parameterType="com.glxp.api.admin.req.thrsys.FilterThrOrderRequest"
|
|
resultType="com.glxp.api.admin.entity.thrsys.ThrOrderEntity">
|
|
SELECT thr_order.*,basic_bustype_origin.name billTypeName FROM thr_order
|
|
left join basic_bustype_origin on thr_order.billType = basic_bustype_origin.action
|
|
<where>
|
|
<if test="billNo != '' and billNo != null">
|
|
AND billNo = #{billNo}
|
|
</if>
|
|
<if test="id != '' and id !=null">
|
|
AND thr_order.id = #{id}
|
|
</if>
|
|
<if test="billAction != '' and billAction !=null">
|
|
AND billType = #{billAction}
|
|
</if>
|
|
<if test="originType != '' and originType !=null">
|
|
AND originType = #{originType}
|
|
</if>
|
|
<if test="type !=null">
|
|
AND thr_order.`type` = #{type}
|
|
</if>
|
|
<if test="allocateStatus!= null">
|
|
AND allocateStatus = #{allocateStatus}
|
|
</if>
|
|
<if test="billFlag != '' and billFlag !=null">
|
|
AND billFlag = #{billFlag}
|
|
</if>
|
|
<if test="unitIdFk != '' and unitIdFk !=null">
|
|
AND unitIdFk = #{unitIdFk}
|
|
</if>
|
|
<if test="thirdSysFk != '' and thirdSysFk != null">
|
|
AND thirdSysFk = #{thirdSysFk}
|
|
</if>
|
|
<if test="corpName != '' and corpName != null">
|
|
AND corpName like concat('%',#{corpName},'%')
|
|
</if>
|
|
<if test="startDate!=null and startDate!=''">
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d')>= DATE_FORMAT(#{startDate}, '%Y-%m-%d') ]]>
|
|
</if>
|
|
<if test="endDate!=null and endDate!=''">
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d') ]]>
|
|
</if>
|
|
<if test="editStatus!= null">
|
|
AND editStatus = #{editStatus}
|
|
</if>
|
|
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
|
|
<![CDATA[ and DATE_FORMAT(thr_order.updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
|
</if>
|
|
</where>
|
|
ORDER BY thr_order.updateTime DESC
|
|
</select>
|
|
|
|
<select id="filterReceiveOrder" parameterType="com.glxp.api.admin.req.thrsys.FilterThrOrderRequest"
|
|
resultType="com.glxp.api.admin.entity.thrsys.ThrOrderEntity">
|
|
SELECT thr_order.*,basic_bustype_change.originName billTypeName,s1.name as invWarehouseName,s2.name as fromSubInvName FROM thr_order
|
|
left join basic_bustype_change on thr_order.billType = basic_bustype_change.originAction
|
|
LEFT JOIN inv_warehouse_sub s1 ON thr_order.invWarehouseCode=s1.`code`
|
|
LEFT JOIN inv_warehouse_sub s2 ON thr_order.fromSubInvCode=s2.`code`
|
|
<where>
|
|
<if test="billNo != '' and billNo != null">
|
|
AND billNo = #{billNo}
|
|
</if>
|
|
<if test="id != '' and id !=null">
|
|
AND thr_order.id = #{id}
|
|
</if>
|
|
<if test="billAction != '' and billAction !=null">
|
|
AND billType = #{billAction}
|
|
</if>
|
|
<if test="originType != '' and originType !=null">
|
|
AND originType = #{originType}
|
|
</if>
|
|
<if test="type !=null">
|
|
AND thr_order.`type` = #{type}
|
|
</if>
|
|
<if test="billFlag != '' and billFlag !=null">
|
|
AND billFlag = #{billFlag}
|
|
</if>
|
|
<if test="unitIdFk != '' and unitIdFk !=null">
|
|
AND unitIdFk = #{unitIdFk}
|
|
</if>
|
|
<if test="thirdSysFk != '' and thirdSysFk != null">
|
|
AND thirdSysFk = #{thirdSysFk}
|
|
</if>
|
|
<if test="corpName != '' and corpName != null">
|
|
AND corpName like concat('%',#{corpName},'%')
|
|
</if>
|
|
<if test="startDate!=null and startDate!=''">
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d')>= DATE_FORMAT(#{startDate}, '%Y-%m-%d') ]]>
|
|
</if>
|
|
<if test="endDate!=null and endDate!=''">
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d') ]]>
|
|
</if>
|
|
<if test="editStatus!= null">
|
|
AND editStatus = #{editStatus}
|
|
</if>
|
|
<if test="thirdPartyDate!= null">
|
|
AND thirdPartyDate = #{thirdPartyDate}
|
|
</if>
|
|
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
|
|
<![CDATA[ and DATE_FORMAT(thr_order.updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
|
</if>
|
|
<if test="allocateStatus!= null">
|
|
AND allocateStatus = #{allocateStatus}
|
|
</if>
|
|
</where>
|
|
ORDER BY thr_order.updateTime DESC
|
|
</select>
|
|
|
|
|
|
<insert id="insertThrOrder" keyProperty="id" parameterType="com.glxp.api.admin.entity.thrsys.ThrOrderEntity">
|
|
replace
|
|
INTO thr_order
|
|
(id,billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, updateTime, originType, unitIdFk,
|
|
startDate, endDate, createUser, reviewUser, address, linkMan, linkTel, remark, remark1, remark2,
|
|
remark3,locStorageCode,editStatus,invWarehouseCode,thirdPartyDate,fromSubInvCode,`type`,allocateStatus)
|
|
values (
|
|
#{id},
|
|
#{billNo},
|
|
#{billdate},
|
|
#{corpId},
|
|
#{corpName},
|
|
#{billType},
|
|
#{billFlag},
|
|
#{thirdSysFk},
|
|
#{updateTime},
|
|
#{originType},
|
|
#{unitIdFk},
|
|
#{startDate},
|
|
#{endDate},
|
|
#{createUser},
|
|
#{reviewUser},
|
|
#{address},
|
|
#{linkMan},
|
|
#{linkTel},
|
|
#{remark},
|
|
#{remark1},
|
|
#{remark2},
|
|
#{remark3},
|
|
#{locStorageCode},
|
|
#{editStatus},
|
|
#{invWarehouseCode},
|
|
#{thirdPartyDate},
|
|
#{fromSubInvCode},
|
|
#{type},
|
|
#{allocateStatus}
|
|
)
|
|
</insert>
|
|
|
|
<insert id="importThrOrder" keyProperty="id" parameterType="com.glxp.api.admin.entity.thrsys.ThrOrderEntity">
|
|
replace
|
|
INTO thr_order
|
|
(id,billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, updateTime, originType,
|
|
startDate, endDate, createUser, reviewUser, address, linkMan, linkTel, remark, remark1, remark2,
|
|
remark3,invWarehouseCode,fromSubInvCode,`type`,allocateStatus)
|
|
values (
|
|
#{id},
|
|
#{billNo},
|
|
#{billdate},
|
|
#{corpId},
|
|
#{corpName},
|
|
#{billType},
|
|
#{billFlag},
|
|
#{thirdSysFk},
|
|
#{updateTime},
|
|
#{originType},
|
|
#{startDate},
|
|
#{endDate},
|
|
#{createUser},
|
|
#{reviewUser},
|
|
#{address},
|
|
#{linkMan},
|
|
#{linkTel},
|
|
#{remark},
|
|
#{remark1},
|
|
#{remark2},
|
|
#{remark3},
|
|
#{invWarehouseCode},
|
|
#{fromSubInvCode},
|
|
#{type},
|
|
#{allocateStatus}
|
|
)
|
|
</insert>
|
|
|
|
<insert id="insertThrOrders" keyProperty="id" parameterType="java.util.List">
|
|
replace INTO thr_order
|
|
(billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, updateTime, originType, unitIdFk,
|
|
startDate, endDate, createUser, reviewUser, address, linkMan, linkTel, remark, remark1, remark2,
|
|
remark3,locStorageCode,editStatus,invWarehouseCode,fromSubInvCode,`type`,allocateStatus)
|
|
values
|
|
<foreach collection="thrOrderEntities" item="item" index="index"
|
|
separator=",">
|
|
(#{item.billNo},
|
|
#{item.billdate},
|
|
#{item.corpId},
|
|
#{item.corpName},
|
|
#{item.billType},
|
|
#{item.billFlag},
|
|
#{item.thirdSysFk}, #{item.updateTime}, #{item.originType}, #{item.unitIdFk},
|
|
#{item.startDate}, #{item.endDate}, #{item.createUser}, #{item.reviewUser},
|
|
#{item.address}, #{item.linkMan}, #{item.linkTel}, #{item.remark}, #{item.remark1},
|
|
#{item.remark2},
|
|
#{item.remark3},#{item.locStorageCode},#{item.editStatus},#{item.invWarehouseCode},#{item.fromSubInvCode},#{item.type},#{item.allocateStatus}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
|
|
<delete id="deleteById" parameterType="Map">
|
|
DELETE
|
|
FROM thr_order
|
|
WHERE id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteAll">
|
|
DELETE
|
|
FROM thr_order
|
|
</delete>
|
|
|
|
<update id="updateThrOrder" parameterType="com.glxp.api.admin.entity.thrsys.ThrOrderEntity">
|
|
UPDATE thr_order
|
|
<trim prefix="set" suffixOverrides=",">
|
|
<if test="billNo != null">billNo=#{billNo},</if>
|
|
<if test="billdate != null">billdate=#{billdate},</if>
|
|
<if test="corpId != null">corpId=#{corpId},</if>
|
|
<if test="corpName != null">corpName=#{corpName},</if>
|
|
<if test="billType != null">billType=#{billType},</if>
|
|
<if test="billFlag != null">billFlag=#{billFlag},</if>
|
|
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
|
|
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
|
<if test="originType != null">originType=#{originType},</if>
|
|
<if test="startDate != null">startDate=#{startDate},</if>
|
|
<if test="endDate != null">endDate=#{endDate},</if>
|
|
<if test="createUser != null">createUser=#{createUser},</if>
|
|
<if test="reviewUser != null">reviewUser=#{reviewUser},</if>
|
|
<if test="address != null">address=#{address},</if>
|
|
<if test="linkMan != null">linkMan=#{linkMan},</if>
|
|
<if test="linkTel != null">linkTel=#{linkTel},</if>
|
|
<if test="remark != null">remark=#{remark},</if>
|
|
<if test="remark1 != null">remark1=#{remark1},</if>
|
|
<if test="remark2 != null">remark2=#{remark2},</if>
|
|
<if test="remark3 != null">remark3=#{remark3},</if>
|
|
<if test="locStorageCode != null">locStorageCode=#{locStorageCode},</if>
|
|
<if test="editStatus != null">editStatus=#{editStatus},</if>
|
|
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
|
|
<if test="fromSubInvCode != null">fromSubInvCode=#{fromSubInvCode},</if>
|
|
<if test="type != null">`type`=#{type},</if>
|
|
<if test="allocateStatus != null">`allocateStatus`=#{allocateStatus},</if>
|
|
|
|
</trim>
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
|
|
</mapper> |