<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="org.springblade.modules.subjectChoices.mapper.SubjectChoicesMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="subjectChoicesResultMap" type="org.springblade.modules.subjectChoices.vo.SubjectChoicesVO">
|
<result property="id" column="id"/>
|
<result property="parentId" column="parent_id"/>
|
<result property="categoryName" column="category_name"/>
|
<result property="subclassName" column="subclass_name"/>
|
<result property="subjectName" column="subject_name"/>
|
<result property="choicesType" column="choices_type"/>
|
<result property="score" column="score"/>
|
<result property="creator" column="creator"/>
|
<result property="createDate" column="create_date"/>
|
<result property="modifier" column="modifier"/>
|
<result property="modifyDate" column="modify_date"/>
|
<result property="delFlag" column="del_flag"/>
|
<result property="level" column="level"/>
|
<!-- <collection property="subjectOptionList" javaType="java.util.List"-->
|
<!-- ofType="org.springblade.modules.subjectOption.entity.SubjectOptionEntity" autoMapping="true">-->
|
<!-- <id property="subjectChoicesId" column="id"/>-->
|
<!-- </collection>-->
|
|
<collection property="subjectOptionList" column="id" javaType="java.util.List"
|
ofType="org.springblade.modules.subjectOption.entity.SubjectOptionEntity"
|
autoMapping="true"
|
select="selectCircleCommentByParentId"></collection>
|
|
</resultMap>
|
|
<select id="selectCircleCommentByParentId" parameterType="long"
|
resultType="org.springblade.modules.subjectOption.vo.SubjectOptionVO">
|
SELECT
|
jso.*
|
FROM
|
jczz_subject_option jso
|
WHERE
|
jso.subject_choices_id = #{id}
|
</select>
|
|
|
<select id="selectSubjectChoicesPage" resultMap="subjectChoicesResultMap">
|
select
|
id,
|
parent_id,
|
category_name,
|
subclass_name,
|
subject_name,
|
choices_type,
|
score,
|
creator,
|
create_date,
|
modifier,
|
modify_date,
|
del_flag,
|
level
|
from
|
jczz_subject_choices
|
<where>
|
<if test="subjectChoices.id != null ">and id = #{subjectChoices.id}</if>
|
<if test="subjectChoices.parentId != null ">and parent_id = #{subjectChoices.parentId}</if>
|
<if test="subjectChoices.categoryName != null and subjectChoices.categoryName != ''">and category_name =
|
#{subjectChoices.categoryName}
|
</if>
|
<if test="subjectChoices.subclassName != null and subjectChoices.subclassName != ''">and subclass_name =
|
#{subjectChoices.subclassName}
|
</if>
|
<if test="subjectChoices.subjectName != null and subjectChoices.subjectName != ''">and subject_name =
|
#{subjectChoices.subjectName}
|
</if>
|
<if test="subjectChoices.choicesType != null ">and choices_type = #{subjectChoices.choicesType}</if>
|
<if test="subjectChoices.score != null ">and score = #{subjectChoices.score}</if>
|
<if test="subjectChoices.creator != null and subjectChoices.creator != ''">and creator =
|
#{subjectChoices.creator}
|
</if>
|
<if test="subjectChoices.createDate != null ">and create_date = #{subjectChoices.createDate}</if>
|
<if test="subjectChoices.modifier != null and subjectChoices.modifier != ''">and modifier =
|
#{subjectChoices.modifier}
|
</if>
|
<if test="subjectChoices.modifyDate != null ">and modify_date = #{subjectChoices.modifyDate}</if>
|
<if test="subjectChoices.delFlag != null ">and del_flag = #{subjectChoices.delFlag}</if>
|
<if test="subjectChoices.level != null ">and level = #{subjectChoices.level}</if>
|
|
</where>
|
order by level desc
|
|
</select>
|
|
|
<resultMap type="org.springblade.modules.subjectChoices.dto.SubjectChoicesDTO" id="SubjectChoicesDTOResult">
|
<result property="id" column="id"/>
|
<result property="parentId" column="parent_id"/>
|
<result property="categoryName" column="category_name"/>
|
<result property="subclassName" column="subclass_name"/>
|
<result property="subjectName" column="subject_name"/>
|
<result property="choicesType" column="choices_type"/>
|
<result property="score" column="score"/>
|
<result property="creator" column="creator"/>
|
<result property="createDate" column="create_date"/>
|
<result property="modifier" column="modifier"/>
|
<result property="modifyDate" column="modify_date"/>
|
<result property="delFlag" column="del_flag"/>
|
<result property="level" column="level"/>
|
</resultMap>
|
|
<sql id="selectSubjectChoices">
|
select
|
id,
|
parent_id,
|
category_name,
|
subclass_name,
|
subject_name,
|
choices_type,
|
score,
|
creator,
|
create_date,
|
modifier,
|
modify_date,
|
del_flag,
|
level
|
from
|
jczz_subject_choices
|
</sql>
|
|
<select id="selectSubjectChoicesById" parameterType="long" resultMap="SubjectChoicesDTOResult">
|
<include refid="selectSubjectChoices"/>
|
where
|
id = #{id}
|
</select>
|
|
<select id="selectSubjectChoicesList" parameterType="org.springblade.modules.subjectChoices.dto.SubjectChoicesDTO"
|
resultMap="SubjectChoicesDTOResult">
|
<include refid="selectSubjectChoices"/>
|
<where>
|
<if test="id != null ">and id = #{id}</if>
|
<if test="parentId != null ">and parent_id = #{parentId}</if>
|
<if test="categoryName != null and categoryName != ''">and category_name = #{categoryName}</if>
|
<if test="subclassName != null and subclassName != ''">and subclass_name = #{subclassName}</if>
|
<if test="subjectName != null and subjectName != ''">and subject_name = #{subjectName}</if>
|
<if test="choicesType != null ">and choices_type = #{choicesType}</if>
|
<if test="score != null ">and score = #{score}</if>
|
<if test="creator != null and creator != ''">and creator = #{creator}</if>
|
<if test="createDate != null ">and create_date = #{createDate}</if>
|
<if test="modifier != null and modifier != ''">and modifier = #{modifier}</if>
|
<if test="modifyDate != null ">and modify_date = #{modifyDate}</if>
|
<if test="delFlag != null ">and del_flag = #{delFlag}</if>
|
<if test="level != null ">and level = #{level}</if>
|
</where>
|
</select>
|
|
|
</mapper>
|