TaskMapper.xml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 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.handleIds !=null and param.handleIds.size()!=0 ">
  23. and a.HANDLE_PERSON_ID in
  24. <foreach collection="param.handleIds" item="item" separator="," open="(" close=")">
  25. #{item}
  26. </foreach>
  27. </if>
  28. <if test="param.taskName !=null and param.taskName !=''">
  29. and a.TASK_NAME like concat('%', #{param.taskName}, '%')
  30. </if>
  31. <if test="param.roleInTask !=null and param.roleInTask == 0">
  32. and a.CREATE_ID=#{param.loginId}
  33. </if>
  34. <if test="param.roleInTask !=null and param.roleInTask == 1">
  35. and a.HANDLE_PERSON_ID=#{param.loginId}
  36. </if>
  37. </where>
  38. order by a.id desc
  39. </select>
  40. </mapper>