EmailTaskInfoMapper.xml 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. <delete id="deleteTaskLog">
  31. update PPW_EMAIL.email_task_info set isvalid=0,updatetime=sysdate(),updaterid=#{userId} where isvalid=0
  32. and id in
  33. <foreach collection="idList" index="index" item="id" separator="," open="(" close=")">
  34. #{id}
  35. </foreach>
  36. </delete>
  37. <select id="searchTaskList" resultMap="BaseResultMap"
  38. parameterType="com.simuwang.base.pojo.dto.query.TaskPageQuery">
  39. select id,email, task_name,task_type, start_time, end_time, task_status,
  40. isvalid, creatorid, createtime, updaterid, updatetime
  41. from PPW_EMAIL.email_task_info
  42. where isvalid=1
  43. <if test="email != null and email !=''">
  44. and email like concat('%',#{email},'%')
  45. </if>
  46. <if test="taskName != null and taskName !=''">
  47. and task_name like concat('%',#{taskName},'%')
  48. </if>
  49. <if test="startDate != null and startDate !=''">
  50. and updatetime >= #{startDate}
  51. </if>
  52. <if test="taskType != null">
  53. and task_type = #{taskType}
  54. </if>
  55. <if test="endDate != null and endDate !=''">
  56. and updatetime <![CDATA[ <= ]]> #{endDate}
  57. </if>
  58. order by updatetime desc
  59. limit #{offset},#{pageSize}
  60. </select>
  61. <select id="countTaskList" resultType="java.lang.Long"
  62. parameterType="com.simuwang.base.pojo.dto.query.TaskPageQuery">
  63. select count(1)
  64. from PPW_EMAIL.email_task_info
  65. where isvalid=1
  66. <if test="email != null and email !=''">
  67. and email like concat('%',#{email},'%')
  68. </if>
  69. <if test="taskName != null and taskName !=''">
  70. and task_name like concat('%',#{taskName},'%')
  71. </if>
  72. <if test="startDate != null and startDate !=''">
  73. and updatetime >= #{startDate}
  74. </if>
  75. <if test="endDate != null and endDate !=''">
  76. and updatetime <![CDATA[ <= ]]> #{endDate}
  77. </if>
  78. <if test="taskType != null">
  79. and task_type = #{taskType}
  80. </if>
  81. </select>
  82. </mapper>