63 lines
1.8 KiB
XML
63 lines
1.8 KiB
XML
<?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="CsQuestion">
|
|
|
|
<sql id="baseSql">
|
|
cs_questionid as csQuestionId,cs_lessonid as csLessonId,title,iconType,iconcolor,description, status,orderId,jField,typeUrl,iconUrl,extraIconUrl,icons
|
|
</sql>
|
|
|
|
<select id="getCsQuestionId" resultType="Integer" useCache="false" flushCache="true">
|
|
SELECT nextval('seq_cs_questionid')
|
|
</select>
|
|
|
|
|
|
|
|
<!--批量删除课程-->
|
|
<update id="BatchUpdateCsquestionByCslessonIds" parameterType="java.util.List">
|
|
|
|
<foreach collection="list" index="index" item="item" separator=";" >
|
|
|
|
update cs_question set status= 0 where cs_lessonid = #{item}
|
|
|
|
</foreach>
|
|
</update>
|
|
|
|
|
|
<!--批量删除课程-->
|
|
<update id="BatchUpdateByCsquestionId" parameterType="java.util.List">
|
|
|
|
UPDATE cs_question SET status = 0
|
|
WHERE cs_questionid in
|
|
|
|
<foreach collection="list" index="index" item="item" separator="," close=")" open="(">
|
|
|
|
#{item}
|
|
|
|
</foreach>
|
|
</update>
|
|
|
|
<select id="getCsQuestionForSearch" parameterType="CsQuestionVO" resultType="CsQuestion">
|
|
SELECT <include refid="baseSql"/>
|
|
FROM cs_question
|
|
<where>
|
|
<if test="title != null and title != ''">
|
|
and title like '%${title}%'
|
|
</if>
|
|
|
|
<if test="status != null ">
|
|
and status = #{status}
|
|
</if>
|
|
|
|
<if test="csLessonId != null ">
|
|
and cs_lessonid = #{csLessonId}
|
|
</if>
|
|
</where>
|
|
|
|
ORDER BY orderId, cs_lessonid
|
|
<if test="pageSize != null and offset != null ">
|
|
LIMIT #{pageSize} OFFSET #{offset}
|
|
</if>
|
|
|
|
</select>
|
|
|
|
</mapper> |