<?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="com.ots.project.exam.mapper.TLibraryCodeMapper">
|
|
<resultMap type="TLibraryCode" id="TLibraryCodeResult">
|
<result property="id" column="id" />
|
<result property="reportType" column="report_type" />
|
<result property="libraryCode" column="library_code" />
|
<result property="englistContent" column="englist_content" />
|
<result property="chineseContent" column="chinese_content" />
|
<result property="thaiContent" column="thai_content" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="dictType" column="dict_type" />
|
<result property="icon" column="icon" />
|
<result property="remark" column="remark" />
|
</resultMap>
|
|
<sql id="selectTLibraryCodeVo">
|
select id, report_type, library_code, englist_content, chinese_content, thai_content, create_by, create_time, update_by, update_time, dict_type,icon,remark from t_library_code
|
</sql>
|
|
<select id="selectTLibraryCodeList" parameterType="TLibraryCode" resultMap="TLibraryCodeResult">
|
<include refid="selectTLibraryCodeVo"/>
|
<where>
|
<if test="reportType != null and reportType != ''"> and report_type = #{reportType}</if>
|
<if test="libraryCode != null and libraryCode != ''"> and library_code = #{libraryCode}</if>
|
</where>
|
</select>
|
|
<select id="selectTLibraryCodeById" parameterType="Long" resultMap="TLibraryCodeResult">
|
<include refid="selectTLibraryCodeVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertTLibraryCode" parameterType="TLibraryCode" useGeneratedKeys="true" keyProperty="id">
|
insert into t_library_code
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="reportType != null and reportType != ''">report_type,</if>
|
<if test="libraryCode != null and libraryCode != ''">library_code,</if>
|
<if test="englistContent != null and englistContent != ''">englist_content,</if>
|
<if test="chineseContent != null and chineseContent != ''">chinese_content,</if>
|
<if test="thaiContent != null and thaiContent != ''">thai_content,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="dictType != null ">dict_type,</if>
|
<if test="icon != null ">icon,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="reportType != null and reportType != ''">#{reportType},</if>
|
<if test="libraryCode != null and libraryCode != ''">#{libraryCode},</if>
|
<if test="englistContent != null and englistContent != ''">#{englistContent},</if>
|
<if test="chineseContent != null and chineseContent != ''">#{chineseContent},</if>
|
<if test="thaiContent != null and thaiContent != ''">#{thaiContent},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="dictType != null ">#{dictType},</if>
|
<if test="icon != null ">#{icon},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
</trim>
|
</insert>
|
|
<update id="updateTLibraryCode" parameterType="TLibraryCode">
|
update t_library_code
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="reportType != null and reportType != ''">report_type = #{reportType},</if>
|
<if test="libraryCode != null and libraryCode != ''">library_code = #{libraryCode},</if>
|
<if test="englistContent != null ">englist_content = #{englistContent},</if>
|
<if test="chineseContent != null ">chinese_content = #{chineseContent},</if>
|
<if test="thaiContent != null ">thai_content = #{thaiContent},</if>
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="dictType != null ">dict_type = #{dictType},</if>
|
<if test="icon != null ">icon = #{icon},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteTLibraryCodeById" parameterType="Long">
|
delete from t_library_code where id = #{id}
|
</delete>
|
|
<delete id="deleteTLibraryCodeByIds" parameterType="String">
|
delete from t_library_code where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|