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/thrsys/ThrOrderImportLogDao.xml

65 lines
2.4 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.thrsys.ThrOrderImportLogDao">
<select id="filterThrOrderImportLog" parameterType="com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest"
resultType="com.glxp.api.entity.thrsys.ThrOrderImportLogEntity">
SELECT * FROM thr_order_import_log
<where>
<if test="genKey != '' and genKey != null">
AND genKey = #{genKey}
</if>
<if test="id != '' and id != null">
AND id = #{id}
</if>
<if test="status != '' and status != null">
AND status = #{status}
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
</if>
</where>
ORDER BY updateTime DESC
</select>
<insert id="insertImportLog" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrOrderImportLogEntity">
insert INTO thr_order_import_log
(genKey,fromType,updateTime,thirdSysFk,status)
values
(
#{genKey},
#{fromType},
#{updateTime},
#{thirdSysFk},#{status}
)
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM thr_order_import_log WHERE id = #{id}
</delete>
<update id="updateImportLog" parameterType="com.glxp.api.entity.thrsys.ThrOrderImportLogEntity">
UPDATE thr_order_import_log
<set>
<if test="genKey != null">genKey=#{genKey},</if>
<if test="fromType != null">fromType=#{fromType},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
<if test="status != null">status=#{status},</if>
<if test="remark != null">remark=#{remark},</if>
</set>
WHERE genKey = #{genKey}
</update>
<delete id="deleteByTime">
Delete From thr_order_import_log
where date(updateTime) &lt;= date(DATE_SUB(NOW(),INTERVAL 30 day))
</delete>
<delete id="deleteByDate">
delete from thr_order_import_log where date_format(#{date}, '%Y-%m-%d') >= date_format(updateTime, '%Y-%m-%d')
</delete>
</mapper>