TaskMapper.xml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  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="cn.cslg.report.mapper.TaskMapper">
  4. <select id="queryTasks" resultType="cn.cslg.report.common.model.vo.TaskReportVO" >
  5. select a.* ,b.TYPE as reportType from TASK a left join REPORT b on a.REPORT_ID=b.ID
  6. <where>
  7. <if test="param.type !=null">
  8. and a.TYPE =#{param.type}
  9. </if>
  10. <if test="param.taskStatuses !=null and param.taskStatuses.size>0">
  11. and a.TASK_STATUS in
  12. <foreach collection="param.taskStatuses" item="item" separator="," open="(" close=")">
  13. #{item}
  14. </foreach>
  15. </if>
  16. <if test="param.ids !=null and param.ids.size()!=0 ">
  17. and a.CREATE_ID in
  18. <foreach collection="param.ids" item="item" separator="," open="(" close=")">
  19. #{item}
  20. </foreach>
  21. </if>
  22. <if test="param.taskName !=null and param.taskName !=''">
  23. and a.TASK_NAME like concat('%', #{param.taskName}, '%')
  24. </if>
  25. <if test="param.roleInTask !=null and param.roleInTask == 0">
  26. and a.CREATE_ID=#{param.loginId}
  27. </if>
  28. <if test="param.roleInTask !=null and param.roleInTask == 1">
  29. and a.HANDLE_PERSON_ID=#{param.loginId}
  30. </if>
  31. </where>
  32. order by a.id desc
  33. </select>
  34. </mapper>