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.
udiwms-java/api-admin/src/main/resources/mybatis/mapper/thrsys/ThrOrderDao.xml

102 lines
3.7 KiB
XML

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