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/basic/BasicDownloadDao.xml

76 lines
2.7 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.admin.dao.basic.BasicDownloadDao">
<select id="filterDownloadStatus" parameterType="com.glxp.api.admin.req.basic.BasicDownloadRequest"
resultType="com.glxp.api.admin.entity.basic.BasicDownloadStatusEntity">
select *
from basic_download_status
<where>
<if test="id != '' and id != null">
and id = #{id}
</if>
<if test="taskId != null and taskId != ''">
AND taskId LIKE concat('%',#{taskId},'%')
</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>
</where>
order by updateTime desc
</select>
<insert id="insertDownloadStatus" keyProperty="id"
parameterType="com.glxp.api.admin.entity.basic.BasicDownloadStatusEntity">
replace
INTO basic_download_status(id,taskId,idDatas,status,type,updateTime,scheduleType,startTime,endTime,remark)
values(
#{id},
#{taskId},
#{idDatas},
#{status},
#{type},
#{updateTime},
#{scheduleType},
#{startTime},
#{endTime},
#{remark}
)
</insert>
<update id="updateDownloadStatus" parameterType="com.glxp.api.admin.entity.basic.BasicDownloadStatusEntity">
UPDATE basic_download_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>
</trim>
WHERE id = #{id}
</update>
<delete id="deleteById" parameterType="Map">
DELETE
FROM basic_download_status
WHERE id = #{id}
</delete>
<delete id="deleteByTime">
Delete From basic_download_status
where date(startTime) &lt;= date(DATE_SUB(NOW(),INTERVAL 30 day))
</delete>
</mapper>