<?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.TExamReportMapper">
|
|
<resultMap type="TExamReport" id="TExamReportResult">
|
<result property="id" column="id" />
|
<result property="productId" column="product_id" />
|
<result property="productName" column="product_name" />
|
<result property="content" column="content" />
|
<result property="tokenId" column="token_id" />
|
<result property="createTime" column="create_time" />
|
<result property="updateTime" column="update_time" />
|
<result property="states" column="states" />
|
<result property="lastContent" column="last_content" />
|
<result property="choice" column="choice" />
|
<result property="doTime" column="do_time" />
|
<result property="questionCount" column="question_count" />
|
<result property="memberId" column="member_id" />
|
<result property="userId" column="user_id" />
|
<result property="parentId" column="parent_id" />
|
<result property="downloadTimes" column="downloadTimes" />
|
<result property="verifyStatus" column="verifyStatus" />
|
<result property="testId" column="test_id" />
|
<result property="userName" column="user_name" />
|
<result property="memberName" column="member_name" />
|
<result property="testName" column="test_name" />
|
<result property="finish" column="finish" />
|
<result property="questionOrder" column="question_order" />
|
<result property="questionReport" column="question_report" />
|
<result property="questionTemplateId" column="question_template_id" />
|
<result property="interfaceContent" column="interface_content" />
|
<result property="langType" column="lang_type" />
|
<result property="status" column="status" />
|
<result property="reportAddress" column="report_address" />
|
<result property="reportTemplateId" column="report_template_id" />
|
<result property="sendHrStatus" column="send_hr_status" />
|
<result property="sendTesterStatus" column="send_tester_status" />
|
<result property="memberEmail" column="member_email" />
|
<result property="testEmail" column="test_email" />
|
<result property="memberName" column="member_name" />
|
<result property="autoSendReport" column="auto_send_report" />
|
<result property="hrEmail" column="hr_email" />
|
<result property="mailContent" column="mail_content" />
|
<result property="optionOrder" column="option_order" />
|
<result property="remainPartTime" column="remain_part_time" />
|
<result property="reportAddressNew" column="report_address_new" />
|
<result property="memberDept" column="member_dept" />
|
<result property="hrReportEmail" column="hrReportEmail" />
|
<result property="hrTitle" column="hrTitle" />
|
<result property="hrSendTime" column="hrSendTime" />
|
<result property="hrUpdateTime" column="hrUpdateTime" />
|
<result property="retriesTime" column="retriesTime" />
|
</resultMap>
|
|
<sql id="selectTExamReportVo">
|
select id, product_id, product_name, content, token_id, create_time, update_time, states,last_content,choice,do_time, question_count, member_id,user_id,parent_id,downloadTimes,verifyStatus,test_id,finish, question_order, question_report, question_template_id, interface_content, lang_type, report_address, report_template_id, send_hr_status, send_tester_status, member_name, option_order, remain_part_time,hrReportEmail,hrTitle,hrSendTime,hrUpdateTime,retriesTime from t_exam_report t
|
</sql>
|
|
<sql id = "selectTExamReportListVo">
|
select m.member_dept,p.status,t.id, t.product_id, t.product_name, t.content, t.token_id, t.create_time, t.update_time, t.states,
|
t.last_content,t.choice,t.do_time, t.question_count, t.member_id,t.user_id,t.parent_id,t.downloadTimes,t.verifyStatus,t.test_id,
|
t.finish,m.member_name,p.test_name,u.user_name,t.question_order, t.question_report, t.question_template_id, t.interface_content,
|
t.lang_type, t.report_address, p.report_template_id, t.send_hr_status, t.send_tester_status, m.member_email, p.test_email,
|
t.member_name, p.auto_send_report, e.hr_email, e.mail_content, t.option_order, t.remain_part_time,
|
t.report_address_new,t.hrReportEmail,t.hrTitle,t.hrSendTime,t.hrUpdateTime,t.retriesTime
|
from t_exam_report t
|
left join sys_user u on u.user_id = t.user_id
|
left join ent_test_member m on m.member_id = t.member_id
|
left join ent_test_package p on p.id = t.test_id
|
left join sys_user_extend e on e.user_id = u.user_id
|
</sql>
|
|
<select id="selectTExamReportList" parameterType="TExamReport" resultMap="TExamReportResult">
|
<include refid="selectTExamReportListVo"/>
|
<where>
|
<if test="id != null "> and t.id = #{id}</if>
|
<if test="productId != null "> and t.product_id = #{productId}</if>
|
<if test="tokenId != null and tokenId != ''"> and t.token_id = #{tokenId}</if>
|
<if test="downloadTimes != null "> and t.downloadTimes = #{downloadTimes}</if>
|
<if test="verifyStatus != null "> and t.verifyStatus = #{verifyStatus}</if>
|
<if test="memberId != null and memberId != ''"> and t.member_id = #{memberId}</if>
|
<if test="productName != null and productName != ''"> and t.product_name like concat('%', #{productName}, '%')</if>
|
<if test="userName != null and userName != ''"> and u.user_name like concat('%', #{userName}, '%')</if>
|
<if test="testName != null and testName != ''"> and u.test_name like concat('%', #{testName}, '%')</if>
|
<if test="memberName != null and memberName != ''"> and m.member_name like concat('%', #{memberName}, '%')</if>
|
<if test="testId != null and testId != ''"> and t.test_id = #{testId}</if>
|
<if test="status != null and status != ''"> and p.status = #{status}</if>
|
<if test="finish != null and finish != ''"> and t.finish = #{finish}</if>
|
<if test="sendTesterStatus != null"> and t.send_tester_status = #{sendTesterStatus}</if>
|
<if test="hrReportEmail != null"> and t.hrReportEmail = #{hrReportEmail}</if>
|
<if test="sendHrStatus != null"> and t.send_hr_status = #{sendHrStatus}</if>
|
<if test="sendHrStatusList != null"> and t.send_hr_status in
|
<foreach collection="sendHrStatusList" item="sendStatus" open="(" separator="," close=")">
|
#{sendStatus}
|
</foreach>
|
</if>
|
<if test="userIds != null"> and t.user_id in
|
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
|
#{userId}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
<select id="selectTExamHrEmailiReportList" parameterType="TExamReport" resultMap="TExamReportResult">
|
select id, product_id, product_name, content, token_id, create_time, update_time, states,last_content,choice,do_time, question_count, member_id,user_id,parent_id,downloadTimes,verifyStatus,test_id,finish, question_order, question_report, question_template_id, interface_content, lang_type, report_address, report_template_id, send_hr_status, send_tester_status, member_name, option_order, remain_part_time from t_exam_report
|
<where>
|
<if test="id != null "> and t.id = #{id}</if>
|
<if test="productId != null "> and t.product_id = #{productId}</if>
|
<if test="tokenId != null and tokenId != ''"> and t.token_id = #{tokenId}</if>
|
<if test="downloadTimes != null "> and t.downloadTimes = #{downloadTimes}</if>
|
<if test="verifyStatus != null "> and t.verifyStatus = #{verifyStatus}</if>
|
<if test="memberId != null and memberId != ''"> and t.member_id = #{memberId}</if>
|
<if test="productName != null and productName != ''"> and u.product_name like concat('%', #{productName}, '%')</if>
|
<if test="userName != null and userName != ''"> and u.user_name like concat('%', #{userName}, '%')</if>
|
<if test="testName != null and testName != ''"> and u.test_name like concat('%', #{testName}, '%')</if>
|
<if test="memberName != null and memberName != ''"> and u.member_name like concat('%', #{memberName}, '%')</if>
|
<if test="testId != null and testId != ''"> and t.test_id = #{testId}</if>
|
<if test="status != null and status != ''"> and p.status = #{status}</if>
|
<if test="finish != null and finish != ''"> and t.finish = #{finish}</if>
|
<if test="sendTesterStatus != null"> and t.send_tester_status = #{sendTesterStatus}</if>
|
<if test="sendHrStatus != null"> and t.send_hr_status = #{sendHrStatus}</if>
|
<if test="sendHrStatusList != null"> and t.send_hr_status in
|
<foreach collection="sendHrStatusList" item="sendStatus" open="(" separator="," close=")">
|
#{sendStatus}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
|
<select id="selectViewReportList" parameterType="TExamReport" resultMap="TExamReportResult">
|
<include refid="selectTExamReportListVo"/>
|
<where>
|
<if test="id != null "> and t.id = #{id}</if>
|
<if test="productId != null "> and t.product_id = #{productId}</if>
|
<if test="tokenId != null and tokenId != ''"> and t.token_id = #{tokenId}</if>
|
<if test="downloadTimes != null "> and t.downloadTimes = #{downloadTimes}</if>
|
<if test="verifyStatus != null "> and t.verifyStatus = #{verifyStatus}</if>
|
<if test="memberId != null and memberId != ''"> and t.member_id = #{memberId}</if>
|
<if test="productName != null and productName != ''"> and u.product_name like concat('%', #{productName}, '%')</if>
|
<if test="userName != null and userName != ''"> and u.user_name like concat('%', #{userName}, '%')</if>
|
<if test="testName != null and testName != ''"> and u.test_name like concat('%', #{testName}, '%')</if>
|
<if test="memberName != null and memberName != ''"> and u.member_name like concat('%', #{memberName}, '%')</if>
|
<if test="testId != null and testId != ''"> and t.test_id = #{testId}</if>
|
<if test="status != null and status != ''"> and p.status = #{status}</if>
|
<if test="finish == 1"> and t.finish in (1,2,6) </if>
|
<if test="sendTesterStatus != null"> and t.send_tester_status = #{sendTesterStatus}</if>
|
<if test="sendHrStatus != null"> and t.send_hr_status = #{sendHrStatus}</if>
|
<if test="sendHrStatusList != null"> and t.send_hr_status in
|
<foreach collection="sendHrStatusList" item="sendStatus" open="(" separator="," close=")">
|
#{sendStatus}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
<select id="selectHrResendTask" parameterType="TExamReport" resultMap="TExamReportResult">
|
<include refid="selectTExamReportVo"/>
|
<where>
|
<if test="sendHrStatus != null"> and t.send_hr_status = #{sendHrStatus}</if>
|
<if test="retriesTime != null"> and 3 > t.retriesTime AND TO_DAYS(t.create_time) > TO_DAYS('2020-09-13 19:46:12') </if>
|
<if test="finish == 1"> and t.finish in (1,2,6) </if>
|
</where>
|
</select>
|
|
<select id="selectTExamReportById" parameterType="Long" resultMap="TExamReportResult">
|
<include refid="selectTExamReportVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertTExamReport" parameterType="TExamReport" useGeneratedKeys="true" keyProperty="id">
|
insert into t_exam_report
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="productId != null ">product_id,</if>
|
<if test="productName != null and productName != ''">product_name,</if>
|
<if test="content != null and content != ''">content,</if>
|
<if test="tokenId != null and tokenId != ''">token_id,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="states != null and states != ''">states,</if>
|
<if test="lastContent != null and lastContent != ''">last_content,</if>
|
<if test="choice != null and choice != ''">choice,</if>
|
<if test="doTime != null and doTime != ''">do_time,</if>
|
<if test="questionCount != null and questionCount != ''">question_count,</if>
|
<if test="memberId != null and memberId != ''">member_id,</if>
|
<if test="userId != null and userId != ''">user_id,</if>
|
<if test="parentId != null and parentId != ''">parent_id,</if>
|
<if test="downloadTimes != null ">downloadTimes,</if>
|
<if test="verifyStatus != null and verifyStatus != ''">verifyStatus,</if>
|
<if test="testId != null and testId != ''">test_id,</if>
|
<if test="finish != null and finish != ''">finish,</if>
|
<if test="questionOrder != null and questionOrder != ''">question_order,</if>
|
<if test="questionReport != null and questionReport != ''">question_report,</if>
|
<if test="questionTemplateId != null and questionTemplateId != ''">question_template_id,</if>
|
<if test="interfaceContent != null and interfaceContent != ''">interface_content,</if>
|
<if test="langType != null and langType != ''">lang_type,</if>
|
<if test="reportAddress != null and reportAddress != ''">report_address,</if>
|
<if test="reportTemplateId != null and reportTemplateId != ''">report_template_id,</if>
|
<if test="sendHrStatus != null and sendHrStatus != ''">send_hr_status,</if>
|
<if test="sendTesterStatus != null and sendTesterStatus != ''">send_tester_status,</if>
|
<if test="memberName != null and memberName != ''">member_name,</if>
|
<if test="optionOrder != null and optionOrder != ''">option_order,</if>
|
<if test="remainPartTime != null and remainPartTime != ''">remain_part_time,</if>
|
<if test="hrReportEmail != null and hrReportEmail != ''">hrReportEmail,</if>
|
<if test="hrTitle != null and hrTitle != ''">hrTitle,</if>
|
<if test="hrSendTime != null and hrSendTime != ''">hrSendTime,</if>
|
<if test="hrUpdateTime != null and hrUpdateTime != ''">hrUpdateTime,</if>
|
<if test="retriesTime != null and retriesTime != ''">retriesTime,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="productId != null ">#{productId},</if>
|
<if test="productName != null and productName != ''">#{productName},</if>
|
<if test="content != null and content != ''">#{content},</if>
|
<if test="tokenId != null and tokenId != ''">#{tokenId},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="states != null and states != ''">#{states},</if>
|
<if test="lastContent != null and lastContent != ''">#{lastContent},</if>
|
<if test="choice != null and choice != ''">#{choice},</if>
|
<if test="doTime != null and doTime != ''">#{doTime},</if>
|
<if test="questionCount != null and questionCount != ''">#{questionCount},</if>
|
<if test="memberId != null and memberId != ''">#{memberId},</if>
|
<if test="userId != null and userId != ''">#{userId},</if>
|
<if test="parentId != null and parentId != ''">#{parentId},</if>
|
<if test="downloadTimes != null ">#{downloadTimes},</if>
|
<if test="verifyStatus != null and verifyStatus != ''">#{verifyStatus},</if>
|
<if test="testId != null and testId != ''">#{testId},</if>
|
<if test="finish != null and finish != ''">#{finish},</if>
|
<if test="questionOrder != null and questionOrder != ''">#{questionOrder},</if>
|
<if test="questionReport != null and questionReport != ''">#{questionReport},</if>
|
<if test="questionTemplateId != null and questionTemplateId != ''">#{questionTemplateId},</if>
|
<if test="interfaceContent != null and interfaceContent != ''">#{interfaceContent},</if>
|
<if test="langType != null and langType != ''">#{langType},</if>
|
<if test="reportAddress != null and reportAddress != ''">#{reportAddress},</if>
|
<if test="reportTemplateId != null and reportTemplateId != ''">#{reportTemplateId},</if>
|
<if test="sendHrStatus != null and sendHrStatus != ''">#{sendHrStatus},</if>
|
<if test="sendTesterStatus != null and sendTesterStatus != ''">#{sendTesterStatus},</if>
|
<if test="memberName != null and memberName != ''">#{memberName},</if>
|
<if test="optionOrder != null and optionOrder != ''">#{optionOrder},</if>
|
<if test="remainPartTime != null and remainPartTime != ''">#{remainPartTime},</if>
|
<if test="hrReportEmail != null and hrReportEmail != ''">#{hrReportEmail},</if>
|
<if test="hrTitle != null and hrTitle != ''">#{hrTitle},</if>
|
<if test="hrSendTime != null and hrSendTime != ''">#{hrSendTime},</if>
|
<if test="hrUpdateTime != null and hrUpdateTime != ''">#{hrUpdateTime},</if>
|
<if test="retriesTime != null and retriesTime != ''">#{retriesTime},</if>
|
</trim>
|
</insert>
|
|
<update id="updateTExamReport" parameterType="TExamReport">
|
update t_exam_report
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="productId != null ">product_id = #{productId},</if>
|
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
<if test="content != null and content != ''">content = #{content},</if>
|
<if test="tokenId != null and tokenId != ''">token_id = #{tokenId},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="states != null and states != ''">states = #{states},</if>
|
<if test="finish != null and finish != ''">finish = #{finish},</if>
|
<if test="downloadTimes != null ">downloadTimes = #{downloadTimes},</if>
|
<if test="questionReport != null ">question_report = #{questionReport},</if>
|
<if test="questionTemplateId != null ">question_template_id = #{questionTemplateId},</if>
|
<if test="interfaceContent != null ">interface_content = #{interfaceContent},</if>
|
<if test="langType != null ">lang_type = #{langType},</if>
|
<if test="reportAddress != null ">report_address = #{reportAddress},</if>
|
<if test="reportTemplateId != null ">report_template_id = #{reportTemplateId},</if>
|
<if test="sendHrStatus != null ">send_hr_status = #{sendHrStatus},</if>
|
<if test="sendTesterStatus != null ">send_tester_status = #{sendTesterStatus},</if>
|
<if test="memberName != null ">member_name = #{memberName},</if>
|
<if test="reportAddressNew != null ">report_address_new = #{reportAddressNew},</if>
|
<if test="hrReportEmail != null ">hrReportEmail = #{hrReportEmail},</if>
|
<if test="hrTitle != null ">hrTitle = #{hrTitle},</if>
|
<if test="hrSendTime != null ">hrSendTime = #{hrSendTime},</if>
|
<if test="hrUpdateTime != null ">hrUpdateTime = #{hrUpdateTime},</if>
|
<if test="retriesTime != null ">retriesTime = #{retriesTime},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="updateTExamReportStatus" parameterType="TExamReport">
|
update t_exam_report
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="sendHrStatus != null">send_hr_status = #{sendHrStatus},</if>
|
<if test="sendTesterStatus != null">send_tester_status = #{sendTesterStatus},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="updateTExamReportByTokenId" parameterType="TExamReport">
|
update t_exam_report
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="productId != null ">product_id = #{productId},</if>
|
<if test="productName != null and productName != ''">product_name = #{productName},</if>
|
<if test="content != null and content != ''">content = #{content},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="states != null">states = #{states},</if>
|
<if test="lastContent != null">last_content = #{lastContent},</if>
|
<if test="choice != null">choice = #{choice},</if>
|
<if test="doTime != null">do_time = #{doTime},</if>
|
<if test="memberId != null">member_id = #{memberId},</if>
|
<if test="questionCount != null">question_count = #{questionCount},</if>
|
<if test="userId != null">user_id = #{userId},</if>
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
<if test="downloadTimes != null">downloadTimes = #{downloadTimes},</if>
|
<if test="verifyStatus != null">verifyStatus = #{verifyStatus},</if>
|
<if test="testId != null">test_id = #{testId},</if>
|
<if test="finish != null">finish = #{finish},</if>
|
<if test="questionReport != null ">question_report = #{questionReport},</if>
|
<if test="questionTemplateId != null ">question_template_id = #{questionTemplateId},</if>
|
<if test="interfaceContent != null ">interface_content = #{interfaceContent},</if>
|
<if test="langType != null ">lang_type = #{langType},</if>
|
<if test="reportAddress != null ">report_address = #{reportAddress},</if>
|
<if test="reportTemplateId != null ">report_template_id = #{reportTemplateId},</if>
|
<if test="sendHrStatus != null ">send_hr_status = #{sendHrStatus},</if>
|
<if test="sendTesterStatus != null ">send_tester_status = #{sendTesterStatus},</if>
|
<if test="memberName != null ">member_name = #{memberName},</if>
|
<if test="remark != null ">remark = #{remark},</if>
|
<if test="optionOrder != null ">option_order = #{optionOrder},</if>
|
<if test="remainPartTime != null ">remain_part_time = #{remainPartTime},</if>
|
<if test="reportAddressNew != null ">report_address_new = #{reportAddressNew},</if>
|
<if test="hrReportEmail != null ">hrReportEmail = #{hrReportEmail},</if>
|
<if test="hrTitle != null ">hrTitle = #{hrTitle},</if>
|
<if test="hrSendTime != null ">hrSendTime = #{hrSendTime},</if>
|
<if test="hrUpdateTime != null ">hrUpdateTime = #{hrUpdateTime},</if>
|
<if test="retriesTime != null ">retriesTime = #{retriesTime},</if>
|
</trim>
|
where token_id = #{tokenId}
|
</update>
|
|
<update id="updateTExamReportByIds" parameterType="java.util.Map">
|
update t_exam_report
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="downloadTimes != null ">downloadTimes = #{downloadTimes},</if>
|
</trim>
|
where id in
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
|
</update>
|
|
<update id="updateTExamReportDeleteLastOneByTokenId">
|
update t_exam_report ter
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="remark != null ">ter.remark = #{remark},</if>
|
<if test="finish != null">finish = #{finish},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
ter.choice = concat(SUBSTRING(ter.choice,1,LENGTH(ter.choice)-INStr(REVERSE(ter.choice),',')),'}' ),
|
</trim>
|
where ter.token_id = #{tokenId}
|
</update>
|
|
<delete id="deleteTExamReportById" parameterType="Long">
|
delete from t_exam_report where id = #{id}
|
</delete>
|
|
<delete id="deleteTExamReportByIds" parameterType="String">
|
delete from t_exam_report where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<select id="selectTExamReportByTokenList" parameterType="String" resultMap="TExamReportResult">
|
<include refid="selectTExamReportListVo"/>
|
<where>
|
t.token_id in
|
<foreach item="tokenIds" collection="array" open="(" separator="," close=")">
|
#{tokenIds}
|
</foreach>
|
</where>
|
</select>
|
|
<select id="selectTExamReportByIds" parameterType="String" resultMap="TExamReportResult">
|
<include refid="selectTExamReportListVo"/>
|
<where>
|
t.id in
|
<foreach item="ids" collection="array" open="(" separator="," close=")">
|
#{ids}
|
</foreach>
|
</where>
|
</select>
|
|
<select id="selectTReportTemplatesByMemberId" parameterType="String" resultMap="TExamReportResult">
|
<include refid="selectTExamReportListVo"/>
|
<where>
|
t.member_id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</where>
|
</select>
|
|
</mapper>
|