EmailTaskInfoMapper.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.simuwang.base.mapper.EmailTaskInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.EmailTaskInfoDO">
  5. <id column="id" property="id"/>
  6. <result column="email" property="email"/>
  7. <result column="task_name" property="taskName"/>
  8. <result column="task_type" property="taskType"/>
  9. <result column="start_time" property="startTime" />
  10. <result column="end_time" property="endTime" />
  11. <result column="task_status" property="taskStatus"/>
  12. <result column="isvalid" property="isvalid"/>
  13. <result column="creatorid" property="creatorId"/>
  14. <result column="createtime" property="createTime"/>
  15. <result column="updaterid" property="updaterId"/>
  16. <result column="updatetime" property="updateTime"/>
  17. </resultMap>
  18. <insert id="insert" parameterType="com.simuwang.base.pojo.dos.EmailTaskInfoDO" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
  19. insert into PPW_EMAIL.email_task_info(email, task_name,task_type, start_time, end_time, task_status,
  20. isvalid, creatorid, createtime, updaterid, updatetime)
  21. values (#{itemDo.email}, #{itemDo.taskName}, #{itemDo.taskType}, #{itemDo.startTime}, #{itemDo.endTime}, #{itemDo.taskStatus},
  22. #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
  23. </insert>
  24. <update id="updateTaskStatus">
  25. update PPW_EMAIL.email_task_info set task_status=#{taskStatus},updatetime=sysdate() where email=#{email} and start_time=#{startTime} and end_time=#{endTime}
  26. </update>
  27. <update id="updateTaskStatusById">
  28. update PPW_EMAIL.email_task_info set task_status=#{taskStatus},updatetime=#{updateTime},end_time=#{endTime} where id=#{id}
  29. </update>
  30. <select id="searchTaskList" resultMap="BaseResultMap"
  31. parameterType="com.simuwang.base.pojo.dto.query.TaskPageQuery">
  32. select id,email, task_name,task_type, start_time, end_time, task_status,
  33. isvalid, creatorid, createtime, updaterid, updatetime
  34. from PPW_EMAIL.email_task_info
  35. where isvalid=1
  36. <if test="email != null and email !=''">
  37. and email like concat('%',#{email},'%')
  38. </if>
  39. <if test="startDate != null and startDate !=''">
  40. and updatetime >= #{startDate}
  41. </if>
  42. <if test="taskType != null">
  43. and task_type = #{taskType}
  44. </if>
  45. <if test="endDate != null and endDate !=''">
  46. and updatetime <![CDATA[ <= ]]> #{endDate}
  47. </if>
  48. order by updatetime desc
  49. limit #{offset},#{pageSize}
  50. </select>
  51. <select id="countTaskList" resultType="java.lang.Long"
  52. parameterType="com.simuwang.base.pojo.dto.query.TaskPageQuery">
  53. select count(1)
  54. from PPW_EMAIL.email_task_info
  55. where isvalid=1
  56. <if test="email != null and email !=''">
  57. and email like concat('%',#{email},'%')
  58. </if>
  59. <if test="startDate != null and startDate !=''">
  60. and updatetime >= #{startDate}
  61. </if>
  62. <if test="endDate != null and endDate !=''">
  63. and updatetime <![CDATA[ <= ]]> #{endDate}
  64. </if>
  65. <if test="taskType != null">
  66. and task_type = #{taskType}
  67. </if>
  68. </select>
  69. </mapper>