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/sync/BasicExportDao.xml

102 lines
3.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.sync.BasicExportDao">
<select id="filterExportStatus" parameterType="com.glxp.api.req.sync.BasicExportStatusRequest"
resultType="com.glxp.api.entity.sync.BasicExportStatusEntity">
select *
from basic_export_status
<where>
<if test="id != null and id != ''">
AND id LIKE concat('%', #{id}, '%')
</if>
<if test="status != null">
and status = #{status}
</if>
<if test="type != null">
and `type` = #{type}
</if>
<if test="idDatas != '' and idDatas != null">
and idDatas = #{idDatas}
</if>
<if test="scheduleType != null">
and scheduleType = #{scheduleType}
</if>
<if test="syncTime != null and syncTime != ''">
and #{syncTime} >= startTime
and #{syncTime} &lt;= endTime
</if>
</where>
order by updateTime desc
</select>
<insert id="insertExportStatus" keyProperty="id"
parameterType="com.glxp.api.entity.sync.BasicExportStatusEntity">
replace
INTO basic_export_status(id, idDatas, status, type, updateTime, scheduleType, startTime, endTime,
remark, cacheFilePath)
values (#{id},
#{idDatas},
#{status},
#{type},
#{updateTime},
#{scheduleType},
#{startTime},
#{endTime},
#{remark},
#{cacheFilePath})
</insert>
<update id="updateExportStatus" parameterType="com.glxp.api.entity.sync.BasicExportStatusEntity">
UPDATE basic_export_status
<trim prefix="set" suffixOverrides=",">
<if test="idDatas != null">
idDatas=#{idDatas},
</if>
<if test="status != null">
status=#{status},
</if>
<if test="type != null">
type=#{type},
</if>
<if test="updateTime != null">
updateTime=#{updateTime},
</if>
<if test="scheduleType != null">
scheduleType=#{scheduleType},
</if>
<if test="startTime != null">
startTime=#{startTime},
</if>
<if test="endTime != null">
endTime=#{endTime},
</if>
<if test="remark != null">
remark=#{remark},
</if>
<if test="cacheFilePath != null">
cacheFilePath=#{cacheFilePath},
</if>
</trim>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
DELETE
FROM basic_export_status
WHERE id = #{id}
</delete>
<delete id="deleteByTime">
Delete
From basic_export_status
where date(startTime) &lt;= date(DATE_SUB(NOW(), INTERVAL 30 day))
</delete>
<delete id="deleteByDate">
delete
from basic_export_status
where date_format(#{date}, '%Y-%m-%d') >= date_format(startTime, '%Y-%m-%d')
</delete>
</mapper>