|
|
|
<?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 * FROM thr_order
|
|
|
|
<where>
|
|
|
|
<if test="billNo != '' and billNo != null">
|
|
|
|
AND billNo = #{billNo}
|
|
|
|
</if>
|
|
|
|
<if test="id != '' and id !=null">
|
|
|
|
AND id = #{id}
|
|
|
|
</if>
|
|
|
|
<if test="billAction != '' and billAction !=null">
|
|
|
|
AND billType = #{billAction}
|
|
|
|
</if>
|
|
|
|
<if test="billFlag != '' and billFlag !=null">
|
|
|
|
AND billFlag = #{billFlag}
|
|
|
|
</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>
|
|
|
|
</where>
|
|
|
|
ORDER BY updateTime DESC
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertThrOrder" keyProperty="id" parameterType="com.glxp.api.admin.entity.thrsys.ThrOrderEntity">
|
|
|
|
replace INTO thr_order
|
|
|
|
(
|
|
|
|
billNo,billdate,corpId,corpName,billType,billFlag,thirdSysFk, updateTime,originType
|
|
|
|
)
|
|
|
|
values
|
|
|
|
(
|
|
|
|
#{billNo},
|
|
|
|
#{billdate},
|
|
|
|
#{corpId},
|
|
|
|
#{corpName},
|
|
|
|
#{billType},
|
|
|
|
#{billFlag},
|
|
|
|
#{thirdSysFk},#{updateTime},#{originType}
|
|
|
|
)
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<insert id="insertThrOrders" keyProperty="id" parameterType="java.util.List">
|
|
|
|
replace INTO thr_order
|
|
|
|
(
|
|
|
|
billNo,billdate,corpId,corpName,billType,billFlag,thirdSysFk,updateTime,originType
|
|
|
|
)
|
|
|
|
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}
|
|
|
|
)
|
|
|
|
</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>
|
|
|
|
</trim>
|
|
|
|
WHERE id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|