rt-sim-training-service/src/main/resources/mybatis/mapper/LsLessonDAO.xml
2021-02-26 10:49:37 +08:00

323 lines
12 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="club.joylink.rtss.dao.LsLessonDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.LsLesson">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="map_id" jdbcType="BIGINT" property="mapId" />
<result column="prd_id" jdbcType="BIGINT" property="prdId" />
<result column="prd_type" jdbcType="VARCHAR" property="prdType" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
<result column="author_id" jdbcType="BIGINT" property="authorId" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="creator_id" jdbcType="BIGINT" property="creatorId" />
<result column="city_code" jdbcType="VARCHAR" property="cityCode" />
<result column="status" jdbcType="VARCHAR" property="status" />
<result column="sysFault" jdbcType="BIT" property="sysfault" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, map_id, prd_id, prd_type, `name`, remarks, author_id, update_time, creator_id,
city_code, `status`, sysFault
</sql>
<select id="selectByExample" parameterType="club.joylink.rtss.entity.LsLessonExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from ls_lesson
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="limit != null">
<if test="offset != null">
limit ${offset}, ${limit}
</if>
<if test="offset == null">
limit ${limit}
</if>
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from ls_lesson
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from ls_lesson
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.LsLessonExample">
delete from ls_lesson
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.LsLesson" useGeneratedKeys="true">
insert into ls_lesson (map_id, prd_id, prd_type,
`name`, remarks, author_id,
update_time, creator_id, city_code,
`status`, sysFault)
values (#{mapId,jdbcType=BIGINT}, #{prdId,jdbcType=BIGINT}, #{prdType,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR}, #{authorId,jdbcType=BIGINT},
#{updateTime,jdbcType=TIMESTAMP}, #{creatorId,jdbcType=BIGINT}, #{cityCode,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{sysfault,jdbcType=BIT})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="club.joylink.rtss.entity.LsLesson" useGeneratedKeys="true">
insert into ls_lesson
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mapId != null">
map_id,
</if>
<if test="prdId != null">
prd_id,
</if>
<if test="prdType != null">
prd_type,
</if>
<if test="name != null">
`name`,
</if>
<if test="remarks != null">
remarks,
</if>
<if test="authorId != null">
author_id,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="creatorId != null">
creator_id,
</if>
<if test="cityCode != null">
city_code,
</if>
<if test="status != null">
`status`,
</if>
<if test="sysfault != null">
sysFault,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mapId != null">
#{mapId,jdbcType=BIGINT},
</if>
<if test="prdId != null">
#{prdId,jdbcType=BIGINT},
</if>
<if test="prdType != null">
#{prdType,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="remarks != null">
#{remarks,jdbcType=VARCHAR},
</if>
<if test="authorId != null">
#{authorId,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creatorId != null">
#{creatorId,jdbcType=BIGINT},
</if>
<if test="cityCode != null">
#{cityCode,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="sysfault != null">
#{sysfault,jdbcType=BIT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="club.joylink.rtss.entity.LsLessonExample" resultType="java.lang.Long">
select count(*) from ls_lesson
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update ls_lesson
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.mapId != null">
map_id = #{record.mapId,jdbcType=BIGINT},
</if>
<if test="record.prdId != null">
prd_id = #{record.prdId,jdbcType=BIGINT},
</if>
<if test="record.prdType != null">
prd_type = #{record.prdType,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.remarks != null">
remarks = #{record.remarks,jdbcType=VARCHAR},
</if>
<if test="record.authorId != null">
author_id = #{record.authorId,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.creatorId != null">
creator_id = #{record.creatorId,jdbcType=BIGINT},
</if>
<if test="record.cityCode != null">
city_code = #{record.cityCode,jdbcType=VARCHAR},
</if>
<if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.sysfault != null">
sysFault = #{record.sysfault,jdbcType=BIT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update ls_lesson
set id = #{record.id,jdbcType=BIGINT},
map_id = #{record.mapId,jdbcType=BIGINT},
prd_id = #{record.prdId,jdbcType=BIGINT},
prd_type = #{record.prdType,jdbcType=VARCHAR},
`name` = #{record.name,jdbcType=VARCHAR},
remarks = #{record.remarks,jdbcType=VARCHAR},
author_id = #{record.authorId,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
creator_id = #{record.creatorId,jdbcType=BIGINT},
city_code = #{record.cityCode,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR},
sysFault = #{record.sysfault,jdbcType=BIT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.LsLesson">
update ls_lesson
<set>
<if test="mapId != null">
map_id = #{mapId,jdbcType=BIGINT},
</if>
<if test="prdId != null">
prd_id = #{prdId,jdbcType=BIGINT},
</if>
<if test="prdType != null">
prd_type = #{prdType,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="remarks != null">
remarks = #{remarks,jdbcType=VARCHAR},
</if>
<if test="authorId != null">
author_id = #{authorId,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="creatorId != null">
creator_id = #{creatorId,jdbcType=BIGINT},
</if>
<if test="cityCode != null">
city_code = #{cityCode,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=VARCHAR},
</if>
<if test="sysfault != null">
sysFault = #{sysfault,jdbcType=BIT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.LsLesson">
update ls_lesson
set map_id = #{mapId,jdbcType=BIGINT},
prd_id = #{prdId,jdbcType=BIGINT},
prd_type = #{prdType,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
remarks = #{remarks,jdbcType=VARCHAR},
author_id = #{authorId,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=TIMESTAMP},
creator_id = #{creatorId,jdbcType=BIGINT},
city_code = #{cityCode,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR},
sysFault = #{sysfault,jdbcType=BIT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>