SSJPeiyouBookMapper.xml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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.ssj.service.mapper.SSJPeiyouBookMapper" >
  4. <select id="findUnitBySelective" resultType="com.ssj.service.conch.parents.dto.GetPeiyouBookUnitDto">
  5. select id unitId,
  6. unit unitName
  7. from ssj_peiyou_book
  8. where 1=1
  9. <if test="grade != null and grade!=''">
  10. and grade = #{grade}
  11. </if>
  12. <if test="courseName != null and courseName!=''">
  13. and course_name = #{courseName}
  14. </if>
  15. <if test="bookName != null and bookName!=''">
  16. and book_name = #{bookName}
  17. </if>
  18. GROUP BY unit
  19. </select>
  20. <select id="findSecondUnitBySelective" resultType="com.ssj.service.conch.parents.dto.GetSecondUnitInfoDto">
  21. select id secondUnitId,
  22. second_unit secondUnitName
  23. from ssj_peiyou_book
  24. where 1=1
  25. <if test="grade != null and grade!=''">
  26. and grade = #{grade}
  27. </if>
  28. <if test="courseName != null and courseName!=''">
  29. and course_name = #{courseName}
  30. </if>
  31. <if test="bookName != null and bookName!=''">
  32. and book_name = #{bookName}
  33. </if>
  34. <if test="unit != null and unit!=''">
  35. and unit = #{unit}
  36. </if>
  37. GROUP BY second_unit
  38. </select>
  39. </mapper>