EvaluateTemplateMapper.xml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.xjrsoft.module.evaluate.mapper.EvaluateTemplateMapper">
  6. <select id="getPage" parameterType="com.xjrsoft.module.evaluate.dto.EvaluateTemplatePageDto" resultType="com.xjrsoft.module.evaluate.vo.EvaluateTemplatePageVo">
  7. SELECT t.id, t.name, t.sort_code,
  8. t2.name AS evaluate_type,
  9. t.dept_ids, t.total, t.remark, t.status
  10. FROM evaluate_template t
  11. left join xjr_dictionary_detail t2 on t.evaluate_type = t2.code and t2.item_id = 1746831039385366530
  12. WHERE t.delete_mark = 0
  13. <if test="dto.deptIds != null and dto.deptIds != ''">
  14. <choose>
  15. <when test="dto.deptIds == 0">
  16. AND JSON_CONTAINS(t.dept_ids, JSON_ARRAY(0))
  17. </when>
  18. <otherwise>
  19. AND t.dept_ids like concat('%',#{dto.deptIds},'%')
  20. </otherwise>
  21. </choose>
  22. </if>
  23. <if test="dto.evaluateType != null and dto.evaluateType != ''">
  24. AND t.evaluate_type = #{dto.evaluateType}
  25. </if>
  26. <if test="dto.name != null">
  27. AND t.name like concat('%',#{dto.name},'%')
  28. </if>
  29. <if test="dto.status != null">
  30. AND t.status = #{dto.status}
  31. </if>
  32. ORDER BY t.id
  33. </select>
  34. </mapper>
  35. <!-- SELECT t.id, t.name,-->
  36. <!-- (SELECT t1.name-->
  37. <!-- FROM xjr_dictionary_detail t1-->
  38. <!-- JOIN xjr_dictionary_item t2 ON t1.item_id = t2.id-->
  39. <!-- WHERE t2.code = 'evaluate_type'-->
  40. <!-- AND t1.code = t.evaluate_type) AS evaluate_type,-->
  41. <!-- t.dept_ids, t.total, t.remark, t.status-->
  42. <!-- FROM evaluate_template t-->
  43. <!-- WHERE t.delete_mark = 0-->
  44. <!-- <if test="dto.deptIds != null and dto.deptIds != ''">-->
  45. <!-- AND t.dept_ids = #{dto.deptIds}-->
  46. <!-- </if>-->
  47. <!-- <if test="dto.evaluateType != null and dto.evaluateType != ''">-->
  48. <!-- AND t.evaluate_type = #{dto.evaluateType}-->
  49. <!-- </if>-->
  50. <!-- <if test="dto.name != null">-->
  51. <!-- AND t.name = #{dto.name}-->
  52. <!-- </if>-->
  53. <!-- <if test="dto.status != null">-->
  54. <!-- AND t.status = #{dto.status}-->
  55. <!-- </if>-->
  56. <!-- ORDER BY t.id-->
  57. <!--</select>-->