<?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.TReportTemplateMapper">
|
|
<resultMap type="TReportTemplate" id="TReportTemplateResult">
|
<result property="id" column="id" />
|
<result property="reportType" column="report_type" />
|
<result property="templateType" column="template_type" />
|
<result property="langType" column="lang_type" />
|
<result property="location" column="location" />
|
<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="remark" column="remark" />
|
</resultMap>
|
|
<sql id="selectTReportTemplateVo">
|
select id, report_type, template_type, lang_type, location, create_by, create_time, update_by, update_time, remark from t_report_template
|
</sql>
|
|
<select id="selectTReportTemplateList" parameterType="TReportTemplate" resultMap="TReportTemplateResult">
|
<include refid="selectTReportTemplateVo"/>
|
<where>
|
<if test="reportType != null and reportType != ''"> and report_type = #{reportType}</if>
|
<if test="templateType != null and templateType != ''"> and template_type = #{templateType}</if>
|
<if test="langType != null and langType != ''"> and lang_type = #{langType}</if>
|
<if test="location != null and location != ''"> and location = #{location}</if>
|
</where>
|
</select>
|
|
<select id="selectTReportTemplate" parameterType="TReportTemplate" resultMap="TReportTemplateResult">
|
<include refid="selectTReportTemplateVo"/>
|
<where>
|
<if test="reportType != null and reportType != ''"> and report_type = #{reportType}</if>
|
<if test="templateType != null and templateType != ''"> and template_type = #{templateType}</if>
|
<if test="langType != null and langType != ''"> and lang_type = #{langType}</if>
|
<if test="location != null and location != ''"> and location = #{location}</if>
|
</where>
|
limit 1
|
</select>
|
|
<select id="selectTReportTemplateById" parameterType="Long" resultMap="TReportTemplateResult">
|
<include refid="selectTReportTemplateVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertTReportTemplate" parameterType="TReportTemplate" useGeneratedKeys="true" keyProperty="id">
|
insert into t_report_template
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="reportType != null and reportType != ''">report_type,</if>
|
<if test="templateType != null and templateType != ''">template_type,</if>
|
<if test="langType != null and langType != ''">lang_type,</if>
|
<if test="location != null and location != ''">location,</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="remark != null and remark != ''">remark,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="reportType != null and reportType != ''">#{reportType},</if>
|
<if test="templateType != null and templateType != ''">#{templateType},</if>
|
<if test="langType != null and langType != ''">#{langType},</if>
|
<if test="location != null and location != ''">#{location},</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="remark != null and remark != ''">#{remark},</if>
|
</trim>
|
</insert>
|
|
<update id="updateTReportTemplate" parameterType="TReportTemplate">
|
update t_report_template
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="reportType != null and reportType != ''">report_type = #{reportType},</if>
|
<if test="templateType != null and templateType != ''">template_type = #{templateType},</if>
|
<if test="langType != null and langType != ''">lang_type = #{langType},</if>
|
<if test="location != null and location != ''">location = #{location},</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="remark != null and remark != ''">remark = #{remark},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteTReportTemplateById" parameterType="Long">
|
delete from t_report_template where id = #{id}
|
</delete>
|
|
<delete id="deleteTReportTemplateByIds" parameterType="String">
|
delete from t_report_template where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<select id="selectTReportTemplates" parameterType="Long" resultMap="TReportTemplateResult">
|
<include refid="selectTReportTemplateVo"/>
|
<where>
|
id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</where>
|
</select>
|
|
</mapper>
|