<?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="cn.stylefeng.guns.modular.business.mapper.MentalTestTopicMapper">
|
|
<select id="topicPage" resultType="cn.stylefeng.guns.modular.business.dto.MentalTestTopicPageDTO">
|
SELECT * FROM t_mental_test_topic o
|
<where>
|
AND status_flag = 1
|
AND is_delete = 0
|
<if test="classIdList != null and classIdList.size != 0">
|
AND
|
<foreach collection="classIdList" item="item" index="index" open="(" separator=" OR " close=")">
|
FIND_IN_SET(#{item}, class_id) > 0
|
</foreach>
|
</if>
|
<if test="title != null and title != ''">
|
AND o.title LIKE CONCAT('%', #{title}, '%')
|
</if>
|
<if test="testType != null">
|
AND o.test_type = #{testType}
|
</if>
|
<if test="testFlag != null">
|
AND o.id <if test="testFlag == 0">NOT</if> IN (SELECT topic_id FROM t_mental_test_result WHERE user_id = #{userId})
|
</if>
|
<if test="statusFlag != null">
|
AND o.status_flag = #{statusFlag}
|
</if>
|
</where>
|
</select>
|
|
</mapper>
|