<?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.EntTestPackageMapper">
|
|
<resultMap type="EntTestPackage" id="EntTestPackageResult">
|
<result property="id" column="id" />
|
<result property="prodId" column="prod_id" />
|
<result property="userId" column="user_id" />
|
<result property="testName" column="test_name" />
|
<result property="prodName" column="prod_name" />
|
<result property="testType" column="test_type" />
|
<result property="testArea" column="test_area" />
|
<result property="langType" column="lang_type" />
|
<result property="testEmail" column="test_email" />
|
<result property="frameTextContentId" column="frame_text_content_id" />
|
<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="invalidTime" column="invalid_time" />
|
<result property="paramCodes" column="param_codes" />
|
<result property="status" column="status" />
|
<result property="template" column="template" />
|
<result property="remark" column="remark" />
|
<result property="userName" column="user_name" />
|
<result property="autoSendReport" column="auto_send_report" />
|
<result property="hrTemplate" column="hrTemplate" />
|
<result property="reportTemplateId" column="report_template_id" />
|
<result property="position" column="position" />
|
<result property="professionalCategory" column="professional_category" />
|
<result property="superiorPosition" column="superior_position" />
|
<result property="phonenumber" column="phonenumber" />
|
</resultMap>
|
|
<sql id="selectEntTestPackageVo">
|
select id,prod_id, p.user_id, test_name,prod_name, test_type, test_area, lang_type, test_email, frame_text_content_id, create_by, create_time, update_by, update_time, invalid_time,p.param_codes, status, template,remark, auto_send_report,report_template_id,p.hrTemplate, p.position,p.superior_position, p.professional_category from ent_test_package p
|
</sql>
|
|
<sql id="selectEntTestPackageSuVo">
|
select p.id, p.prod_id, p.user_id, p.test_name, p.prod_name, p.test_type, p.test_area, p.lang_type, p.test_email, p.frame_text_content_id, p.create_by, p.create_time, p.update_by, p.update_time, p.invalid_time,p.param_codes, p.status, p.template, p.remark, p.auto_send_report, p.report_template_id,p.hrTemplate, p.position,p.superior_position, p.professional_category, u.user_name from ent_test_package p
|
left join sys_user u on u.user_id = p.user_id
|
</sql>
|
|
<select id="selectEntTestPackageList" parameterType="EntTestPackage" resultMap="EntTestPackageResult">
|
select id,prod_id, p.user_id, p.test_name,p.prod_name, p.test_type, p.test_area, p.lang_type, p.test_email, p.frame_text_content_id, p.create_by, p.create_time, p.update_by, p.update_time, p.invalid_time,p.param_codes, p.status, p.template,p.remark,u.user_name,p.auto_send_report,p.report_template_id,p.hrTemplate,u.phonenumber from ent_test_package p
|
left join sys_user u on u.user_id = p.user_id
|
<where>
|
<if test="userId != null "> and p.user_id = #{userId}</if>
|
<if test="testName != null and testName != ''"> and p.test_name like concat('%', #{testName}, '%')</if>
|
<if test="userName != null and userName != ''"> and u.user_name like concat('%', #{userName}, '%')</if>
|
<if test="testType != null and testType != ''"> and p.test_type = #{testType}</if>
|
<if test="testArea != null and testArea != ''"> and p.test_area = #{testArea}</if>
|
<if test="langType != null and langType != ''"> and p.lang_type = #{langType}</if>
|
<if test="testEmail != null and testEmail != ''"> and p.test_email = #{testEmail}</if>
|
<if test="frameTextContentId != null "> and p.frame_text_content_id = #{frameTextContentId}</if>
|
<if test="invalidTime != null "> and p.invalid_time = #{invalidTime}</if>
|
<if test="status != null and status != ''"> and p.status = #{status}</if>
|
<if test="reportTemplateId != null and reportTemplateId != ''"> and p.report_template_id = #{reportTemplateId}</if>
|
<if test="userIds != null "> and p.user_id in
|
<foreach item="userIds" collection="userIds" open="(" separator="," close=")">
|
#{userIds}
|
</foreach>
|
</if>
|
</where>
|
order by p.id desc,p.update_time desc
|
</select>
|
|
|
<select id="selectEntTestPackageMainList" parameterType="EntTestPackage" resultMap="EntTestPackageResult">
|
select id,prod_id, p.user_id, p.test_name,p.prod_name, p.test_type, p.test_area, p.lang_type, p.test_email, p.frame_text_content_id, p.create_by, p.create_time, p.update_by, p.update_time, p.invalid_time,p.param_codes, p.status, p.template,p.remark,u.user_name,p.auto_send_report,p.report_template_id,p.hrTemplate,u.phonenumber from ent_test_package p
|
left join sys_user u on u.user_id = p.user_id
|
<where>
|
<if test="userId != null "> and p.user_id = #{userId}</if>
|
<if test="testName != null and testName != ''"> and p.test_name like concat('%', #{testName}, '%')</if>
|
<if test="userName != null and userName != ''"> and u.user_name like concat('%', #{userName}, '%')</if>
|
<if test="testType != null and testType != ''"> and p.test_type = #{testType}</if>
|
<if test="testArea != null and testArea != ''"> and p.test_area = #{testArea}</if>
|
<if test="langType != null and langType != ''"> and p.lang_type = #{langType}</if>
|
<if test="testEmail != null and testEmail != ''"> and p.test_email = #{testEmail}</if>
|
<if test="frameTextContentId != null "> and p.frame_text_content_id = #{frameTextContentId}</if>
|
<if test="invalidTime != null "> and p.invalid_time = #{invalidTime}</if>
|
<if test="status != null and status != ''"> and p.status = #{status}</if>
|
<if test="reportTemplateId != null and reportTemplateId != ''"> and p.report_template_id = #{reportTemplateId}</if>
|
<if test="userIds != null "> and p.user_id in
|
<foreach item="userIds" collection="userIds" open="(" separator="," close=")">
|
#{userIds}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
<select id="selectEntTestPackageListByIdAndStatusIn" parameterType="java.util.Map" resultMap="EntTestPackageResult">
|
<include refid="selectEntTestPackageVo"/>
|
<where>
|
<if test="status != null "> status in
|
<foreach item="status" collection="status" open="(" separator="," close=")">
|
#{status}
|
</foreach>
|
</if>
|
<if test="userId != null "> and p.user_id = #{userId}</if>
|
<if test="invalid != null"> and now() > invalid_time </if>
|
</where>
|
</select>
|
|
<select id="selectEntTestPackageById" parameterType="Long" resultMap="EntTestPackageResult">
|
<include refid="selectEntTestPackageSuVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertEntTestPackage" parameterType="EntTestPackage" useGeneratedKeys="true" keyProperty="id">
|
insert into ent_test_package
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="userId != null ">user_id,</if>
|
<if test="prodId != null ">prod_id,</if>
|
<if test="testName != null and testName != ''">test_name,</if>
|
<if test="prodName != null and prodName != ''">prod_name,</if>
|
<if test="testType != null and testType != ''">test_type,</if>
|
<if test="testArea != null and testArea != ''">test_area,</if>
|
<if test="langType != null and langType != ''">lang_type,</if>
|
<if test="testEmail != null and testEmail != ''">test_email,</if>
|
<if test="frameTextContentId != null ">frame_text_content_id,</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="hrTemplate != null and hrTemplate != ''">hrTemplate,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="invalidTime != null ">invalid_time,</if>
|
<if test="paramCodes != null ">param_codes,</if>
|
<if test="status != null and status != ''">status,</if>
|
<if test="template != null and template != ''">template,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
<if test="autoSendReport != null and autoSendReport != ''">auto_send_report,</if>
|
<if test="reportTemplateId != null and reportTemplateId != ''">report_template_id,</if>
|
<if test="position != null and position != ''">position,</if>
|
<if test="professionalCategory != null and professionalCategory != ''">professional_category,</if>
|
<if test="superiorPosition != null and superiorPosition != ''">superior_position,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="userId != null ">#{userId},</if>
|
<if test="prodId != null ">#{prodId},</if>
|
<if test="testName != null and testName != ''">#{testName},</if>
|
<if test="prodName != null and prodName != ''">#{prodName},</if>
|
<if test="testType != null and testType != ''">#{testType},</if>
|
<if test="testArea != null and testArea != ''">#{testArea},</if>
|
<if test="langType != null and langType != ''">#{langType},</if>
|
<if test="testEmail != null and testEmail != ''">#{testEmail},</if>
|
<if test="frameTextContentId != null ">#{frameTextContentId},</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="hrTemplate != null and hrTemplate != ''">#{hrTemplate},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="invalidTime != null ">#{invalidTime},</if>
|
<if test="paramCodes != null ">#{paramCodes},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
<if test="template != null and template != ''">#{template},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="autoSendReport != null and autoSendReport != ''">#{autoSendReport},</if>
|
<if test="reportTemplateId != null and reportTemplateId != ''">#{reportTemplateId},</if>
|
<if test="position != null and position != ''">#{position},</if>
|
<if test="professionalCategory != null and professionalCategory != ''">#{professionalCategory},</if>
|
<if test="superiorPosition != null and superiorPosition != ''">#{superiorPosition},</if>
|
</trim>
|
</insert>
|
|
<update id="updateEntTestPackage" parameterType="EntTestPackage">
|
update ent_test_package
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="userId != null ">user_id = #{userId},</if>
|
<if test="prodId != null ">prod_id = #{prodId},</if>
|
<if test="testName != null and testName != ''">test_name = #{testName},</if>
|
<if test="prodName != null and prodName != ''">prod_name = #{prodName},</if>
|
<if test="testType != null and testType != ''">test_type = #{testType},</if>
|
<if test="testArea != null and testArea != ''">test_area = #{testArea},</if>
|
<if test="langType != null and langType != ''">lang_type = #{langType},</if>
|
<if test="testEmail != null and testEmail != ''">test_email = #{testEmail},</if>
|
<if test="frameTextContentId != null ">frame_text_content_id = #{frameTextContentId},</if>
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="hrTemplate != null and hrTemplate != ''">hrTemplate = #{hrTemplate},</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="invalidTime != null ">invalid_time = #{invalidTime},</if>
|
<if test="paramCodes != null ">param_codes = #{paramCodes},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="template != null and template != ''">template = #{template},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="position != null and position != ''">position = #{position},</if>
|
<if test="professionalCategory != null and professionalCategory != ''">professional_category = #{professionalCategory},</if>
|
<if test="superiorPosition != null and superiorPosition != ''">superior_position = #{superiorPosition},</if>
|
<choose>
|
<when test="autoSendReport==true">
|
auto_send_report = 1,
|
</when>
|
<otherwise>
|
auto_send_report = 0,
|
</otherwise>
|
</choose>
|
<if test="reportTemplateId != null and reportTemplateId != ''">report_template_id = #{reportTemplateId},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteEntTestPackageById" parameterType="Long">
|
delete from ent_test_package where id = #{id}
|
</delete>
|
|
<delete id="deleteEntTestPackageByIds" parameterType="String">
|
delete from ent_test_package where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|