| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.gkhy.exam.institutionalaccess.mapper.ThCourseMapper"> |
| | | |
| | | <select id="listByPage" resultType="com.gkhy.exam.institutionalaccess.entity.ThCourse"> |
| | | <select id="listByPage" resultType="com.gkhy.exam.institutionalaccess.model.resp.ThCourseRespDTO"> |
| | | select c.* from th_course c where c.del_flag = 0 |
| | | <if test="query.institutionId != null"> |
| | | and c.institution_id = #{query.institutionId} |
| | | </if> |
| | | order by c.create_time desc |
| | | </select> |
| | | <!--批量插入--> |
| | | <insert id="insertBatch"> |
| | | INSERT INTO th_course (id, uuid, course_code, institution_id, institution_name,course_name, |
| | | lesson_num,train_org_name, del_flag,create_time,update_time,create_by,update_by) VALUES |
| | | <foreach collection="courseList" separator="," item="item"> |
| | | (#{item.id},#{item.uuid},#{item.courseCode},#{item.institutionId},#{item.institutionName},#{item.courseName}, |
| | | #{item.lessonNum},#{item.trainOrgName},#{item.delFlag},#{item.createTime}, |
| | | #{item.updateTime},#{item.createBy},#{item.updateBy}) |
| | | </foreach> |
| | | </insert> |
| | | <!--批量修改--> |
| | | <update id="updateBatch" parameterType="java.util.List" > |
| | | <foreach collection="courseList" item="item" index="index" separator=";"> |
| | | UPDATE th_course |
| | | <set> |
| | | <if test="item.courseCode != null and item.courseCode != ''" > |
| | | course_code = #{item.courseCode}, |
| | | </if> |
| | | <if test="item.courseName != null and item.courseName != ''" > |
| | | course_name = #{item.courseName}, |
| | | </if> |
| | | <if test="item.lessonNum != null" > |
| | | lesson_num = #{item.lessonNum}, |
| | | </if> |
| | | <if test="item.delFlag != null" > |
| | | del_flag = #{item.delFlag}, |
| | | </if> |
| | | <if test="item.trainOrgName != null and item.trainOrgName != ''" > |
| | | train_org_name = #{item.trainOrgName}, |
| | | </if> |
| | | <if test="item.institutionId != null" > |
| | | institution_id = #{item.institutionId}, |
| | | </if> |
| | | <if test="item.institutionName != null and item.institutionName != ''" > |
| | | institution_name = #{item.institutionName}, |
| | | </if> |
| | | <if test="item.updateBy != null and item.updateBy != ''" > |
| | | update_by = #{item.updateBy}, |
| | | </if> |
| | | <if test="item.updateTime != null" > |
| | | update_time = #{item.updateTime} |
| | | </if> |
| | | </set> |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | <!--<update id="updateBatch" parameterType="java.util.List" > |
| | | <foreach collection="courseList" item="item" index="index" separator=";"> |
| | | UPDATE th_course |
| | | <set> |
| | | <if test="item.courseCode != null and item.courseCode != ''" > |
| | | course_code = #{item.courseCode}, |
| | | </if> |
| | | <if test="item.courseName != null and item.courseName != ''" > |
| | | course_name = #{item.courseName}, |
| | | </if> |
| | | <if test="item.lessonNum != null" > |
| | | lesson_num = #{item.lessonNum}, |
| | | </if> |
| | | <if test="item.delFlag != null" > |
| | | del_flag = #{item.delFlag}, |
| | | </if> |
| | | <if test="item.trainOrgName != null and item.trainOrgName != ''" > |
| | | train_org_name = #{item.trainOrgName}, |
| | | </if> |
| | | <if test="item.institutionId != null" > |
| | | institution_id = #{item.institutionId}, |
| | | </if> |
| | | <if test="item.institutionName != null and item.institutionName != ''" > |
| | | institution_name = #{item.institutionName}, |
| | | </if> |
| | | <if test="item.updateBy != null and item.updateBy != ''" > |
| | | update_by = #{item.updateBy}, |
| | | </if> |
| | | <if test="item.updateTime != null" > |
| | | update_time = #{item.updateTime} |
| | | </if> |
| | | </set> |
| | | where id = #{item.id} |
| | | </foreach> |
| | | </update>--> |
| | | |
| | | |
| | | <select id="getByUuidList" resultType="com.gkhy.exam.institutionalaccess.entity.ThCourse"> |
| | | select id, uuid, course_code, institution_id, institution_name,course_name, |
| | | lesson_num,train_org_name |
| | | from th_course |
| | | where del_flag = 0 and uuid in |
| | | <foreach collection="courseUuids" item="uuid" index ="index" open="(" close=")" separator=","> |
| | | #{uuid} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="getCourseNameByUuids" resultType="com.gkhy.exam.institutionalaccess.entity.ThCourse"> |
| | | select id, uuid,course_name |
| | | from th_course |
| | | where del_flag = 0 and uuid in |
| | | <foreach collection="courseUuids" item="uuid" index ="index" open="(" close=")" separator=","> |
| | | #{uuid} |
| | | </foreach> |
| | | </select> |
| | | |
| | | </mapper> |
| | | |