SmartSubjectMapper.xml 955 B

123456789101112131415161718
  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.template.mapper.SmartSubjectMapper">
  4. <resultMap type="com.template.model.vo.TimeGroupVo" id="subjectsMap">
  5. <result property="id" column="id"/>
  6. <result property="name" column="name"/>
  7. <result property="cardNo" column="card_no"/>
  8. <result property="departmentId" column="department_id"/>
  9. <result property="headImage" column="head_image"/>
  10. </resultMap>
  11. <select id="queryGradeSubjects" resultType="com.template.model.vo.TimeGroupVo" resultMap="subjectsMap">
  12. select ss.id,ss.name from smart_subject ss
  13. <if test="grade != null and grade != ''">
  14. inner join smart_grade sg on sg.deleted = 0 and sg.name = #{grade} and FIND_IN_SET(ss.id,sg.subject_id)
  15. </if>
  16. where ss.deleted = 0
  17. </select>
  18. </mapper>