TaskMapper.xml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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,b.SIGN_PATENT_NO as signPatentNo, b.NAME as reportName from TASK a left join
  6. REPORT b on
  7. a.REPORT_ID=b.ID
  8. <where>
  9. <if test="param.type !=null">
  10. and a.TYPE =#{param.type}
  11. </if>
  12. <if test="param.taskStatuses !=null and param.taskStatuses.size>0">
  13. and a.TASK_STATUS in
  14. <foreach collection="param.taskStatuses" item="item" separator="," open="(" close=")">
  15. #{item}
  16. </foreach>
  17. </if>
  18. <if test="param.ids !=null and param.ids.size()!=0 ">
  19. and a.CREATE_ID in
  20. <foreach collection="param.ids" item="item" separator="," open="(" close=")">
  21. #{item}
  22. </foreach>
  23. </if>
  24. <if test="param.handleIds !=null and param.handleIds.size()!=0 ">
  25. and a.HANDLE_PERSON_ID in
  26. <foreach collection="param.handleIds" item="item" separator="," open="(" close=")">
  27. #{item}
  28. </foreach>
  29. </if>
  30. <if test="param.taskName !=null and param.taskName !=''">
  31. and a.TASK_NAME like concat('%', #{param.taskName}, '%')
  32. </if>
  33. <if test="param.roleInTask !=null and param.roleInTask == 0">
  34. and a.CREATE_ID=#{param.loginId}
  35. </if>
  36. <if test="param.roleInTask !=null and param.roleInTask == 1">
  37. and a.HANDLE_PERSON_ID=#{param.loginId}
  38. </if>
  39. </where>
  40. order by a.id desc
  41. </select>
  42. </mapper>