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-spms-java/src/main/resources/mybatis/mapper/sync/BasicExportDao.xml

98 lines
3.3 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 != '' and id != null">
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} BETWEEN startTime and endTime
</if>
<if test="receiveStatus != null">
and receiveStatus = #{receiveStatus}
</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, receiveStatus)
values (#{id},
#{idDatas},
#{status},
#{type},
#{updateTime},
#{scheduleType},
#{startTime},
#{endTime},
#{remark},
#{receiveStatus})
</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="receiveStatus != null">
receiveStatus=#{receiveStatus},
</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>
</mapper>