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

62 lines
2.2 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.ThrOrderExportLogDao">
<select id="filterThrOrderExportLog" parameterType="com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest"
resultType="com.glxp.api.entity.thrsys.ThrOrderExportLogEntity">
SELECT * FROM thr_order_export_log
<where>
<if test="genKey != '' and genKey != null">
AND genKey = #{genKey}
</if>
<if test="status != '' and status != null">
AND status = #{status}
</if>
<if test=" type != null">
AND `type` = #{type}
</if>
</where>
ORDER BY updateTime DESC
</select>
<insert id="insertThrOrderExportLog" keyProperty="id"
parameterType="com.glxp.api.entity.thrsys.ThrOrderExportLogEntity">
insert INTO thr_order_export_log
(genKey,updateTime,dlCount,status,filePath,remark,`type`)
values
(
#{genKey},
#{updateTime},
#{dlCount},#{status},#{filePath},#{remark},#{type}
)
</insert>
<delete id="deleteById" parameterType="Map">
DELETE FROM thr_order_export_log WHERE id = #{id}
</delete>
<update id="updateThrOrderExportLog" parameterType="com.glxp.api.entity.thrsys.ThrOrderExportLogEntity">
UPDATE thr_order_export_log
<set>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="dlCount != null">dlCount=#{dlCount},</if>
<if test="status != null">status=#{status},</if>
<if test="filePath != null">filePath=#{filePath},</if>
<if test="remark != null">remark=#{remark},</if>
</set>
WHERE genKey = #{genKey}
</update>
<delete id="deleteByTime">
Delete From thr_order_export_log
where date(updateTime) &lt;= date(DATE_SUB(NOW(),INTERVAL 30 day))
</delete>
<delete id="deleteByDate">
delete from thr_order_export_log where date_format(#{date}, '%Y-%m-%d') >= date_format(updateTime, '%Y-%m-%d')
</delete>
</mapper>