<?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.EntTestMemberMapper">
|
|
<resultMap type="EntTestMember" id="EntTestMemberResult">
|
<result property="memberId" column="member_id" />
|
<result property="memberName" column="member_name" />
|
<result property="memberDept" column="member_dept" />
|
<result property="memberEmail" column="member_email" />
|
<result property="memberPhone" column="member_phone" />
|
<result property="testId" column="test_id" />
|
<result property="token" column="token" />
|
<result property="startTime" column="start_time" />
|
<result property="endTime" column="end_time" />
|
<result property="smsStatus" column="sms_status" />
|
<result property="smsTime" column="sms_time" />
|
<result property="emailStatus" column="email_status" />
|
<result property="emailTime" column="email_time" />
|
<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="status" column="status" />
|
<result property="remark" column="remark" />
|
<result property="userId" column="user_id" />
|
<result property="userName" column="user_name" />
|
<result property="testName" column="test_name" />
|
<result property="hrEmailStatus" column="hr_email_status" />
|
<result property="hrEmailTime" column="hr_email_time" />
|
<result property="langType" column="lang_type" />
|
<result property="prodName" column="prod_name" />
|
</resultMap>
|
|
<sql id="selectEntTestMemberVo">
|
select member_id, member_name, member_dept, member_email, member_phone, test_id, token, start_time, end_time, sms_status, sms_time, email_status, email_time, create_by, create_time, update_by, update_time, status, remark,hr_email_status,hr_email_time from ent_test_member
|
</sql>
|
|
<select id="selectEntTestMemberList" parameterType="EntTestMember" resultMap="EntTestMemberResult">
|
<include refid="selectEntTestMemberVo"/>
|
<where>
|
<!-- <if test="memberName != null and memberName != ''"> and (upper(member_name) LIKE CONCAT('%',concat(upper(left(#{memberName},1)),substring(#{memberName},2)),'%') OR lower(member_name) LIKE CONCAT('%',concat(lower(left(#{memberName},1)),substring(#{memberName},2)),'%'))</if>-->
|
<if test="memberName != null and memberName != ''"> and upper(member_name) like upper(concat('%', #{memberName} , '%'))</if>
|
<if test="firstName != null and firstName != ''"> and member_name like concat('%', #{firstName} , '%')</if>
|
<if test="lastName != null and lastName != ''"> and member_name like concat('%', #{lastName} , '%')</if>
|
<if test="token != null and token != ''"> and token like concat('%', #{token} , '%')</if>
|
<if test="memberDept != null and memberDept != ''"> and member_dept like concat('%', #{memberDept}, '%')</if>
|
<if test="memberEmail != null and memberEmail != ''"> and member_email like concat('%', #{memberEmail}, '%')</if>
|
<if test="memberPhone != null and memberPhone != ''"> and member_phone like concat('%', #{memberPhone}, '%')</if>
|
<if test="testId != null "> and test_id = #{testId}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
</where>
|
order by end_time desc
|
</select>
|
|
<select id="selectEntTestMemberTopList" parameterType="EntTestMember" resultMap="EntTestMemberResult">
|
SELECT u.user_id,t.`lang_type`,u.`user_name`,p.`test_name`,p.`prod_name`,m.member_id, m.member_name, m.member_dept, m.member_email, m.member_phone, m.test_id, m.token, m.start_time, m.end_time, m.sms_status, m.sms_time, m.email_status, m.email_time, m.create_by, m.create_time, m.update_by, m.update_time, m.status, m.remark,m.hr_email_status,m.hr_email_time
|
FROM ent_test_member m
|
LEFT JOIN ent_test_package p ON m.`test_id` = p.`id`
|
LEFT JOIN `sys_user` u ON u.`user_id` = p.`user_id`
|
LEFT JOIN t_exam_report t ON t.`token_id` = m.`token`
|
<where>
|
<if test="memberName != null and memberName != ''"> and (m.member_name LIKE CONCAT('%',concat(upper(left(#{memberName},1)),substring(#{memberName},2)),'%') OR m.member_name LIKE CONCAT('%',concat(lower(left(#{memberName},1)),substring(#{memberName},2)),'%'))</if>
|
<if test="firstName != null and firstName != ''"> and m.member_name like concat('%', #{firstName} , '%')</if>
|
<if test="lastName != null and lastName != ''"> and m.member_name like concat('%', #{lastName} , '%')</if>
|
<if test="token != null and token != ''"> and m.token like concat('%', #{token} , '%')</if>
|
<if test="memberDept != null and memberDept != ''"> and m.member_dept like concat('%', #{memberDept}, '%')</if>
|
<if test="memberEmail != null and memberEmail != ''"> and m.member_email like concat('%', #{memberEmail}, '%')</if>
|
<if test="memberPhone != null and memberPhone != ''"> and m.member_phone like concat('%', #{memberPhone}, '%')</if>
|
<if test="testId != null "> and m.test_id = #{testId}</if>
|
<if test="status != null and status != ''"> and m.status = #{status}</if>
|
<if test="userId != null and userId != ''"> and u.user_id = #{userId}</if>
|
</where>
|
</select>
|
|
<select id="selectEntTestMemberQueryList" parameterType="EntTestMember" resultMap="EntTestMemberResult">
|
SELECT t.hr_email_status,t.hr_email_time,u.user_name ,u.user_id, p.test_name,t.member_id, t.member_name, t.member_dept, t.member_email, t.member_phone, t.test_id, t.token, t.start_time, t.end_time, t.sms_status, t.sms_time, t.email_status, t.email_time, t.create_by, t.create_time, t.update_by, t.update_time, t.status, t.remark FROM ent_test_member t
|
LEFT JOIN ent_test_package p ON p.id = t.test_id
|
LEFT JOIN `sys_user` u ON p.user_id = u.user_id
|
<where>
|
<if test="memberName != null and memberName != ''"> and (upper(t.member_name) LIKE CONCAT('%',concat(upper(left(#{memberName},1)),substring(#{memberName},2)),'%') OR lower(t.member_name) LIKE CONCAT('%',concat(lower(left(#{memberName},1)),substring(#{memberName},2)),'%'))</if>
|
<if test="firstName != null and firstName != ''"> and t.member_name like concat('%', #{firstName} , '%')</if>
|
<if test="lastName != null and lastName != ''"> and t.member_name like concat('%', #{lastName} , '%')</if>
|
<if test="token != null and token != ''"> and t.token like concat('%', #{token} , '%')</if>
|
<if test="memberDept != null and memberDept != ''"> and t.member_dept like concat('%', #{memberDept}, '%')</if>
|
<if test="memberEmail != null and memberEmail != ''"> and t.member_email like concat('%', #{memberEmail}, '%')</if>
|
<if test="memberPhone != null and memberPhone != ''"> and t.member_phone like concat('%', #{memberPhone}, '%')</if>
|
<if test="testId != null "> and t.test_id = #{testId}</if>
|
<if test="status != null and status != ''"> and t.status = #{status}</if>
|
<if test="userList != null "> and u.user_id in
|
<foreach item="userList" collection="userList" open="(" separator="," close=")">
|
#{userList}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
<select id="selectEntTestMemberListByMap" parameterType="java.util.Map" resultMap="EntTestMemberResult">
|
<include refid="selectEntTestMemberVo"/>
|
<where>
|
<if test="testIds != null "> and test_id in
|
<foreach item="testIds" collection="testIds" open="(" separator="," close=")">
|
#{testIds}
|
</foreach>
|
</if>
|
<if test="status != null "> and status in
|
<foreach item="status" collection="status" open="(" separator="," close=")">
|
#{status}
|
</foreach>
|
</if>
|
<if test="deleteSensitiveTime != null "> and #{deleteSensitiveTime} > create_time </if>
|
<if test="desensitization != null "> and member_id not in (select b.member_id from ent_test_member_backstage b) </if>
|
</where>
|
</select>
|
|
<select id="selectEntTestMemberById" parameterType="Long" resultMap="EntTestMemberResult">
|
<include refid="selectEntTestMemberVo"/>
|
where member_id = #{memberId}
|
</select>
|
|
<insert id="insertEntTestMember" parameterType="EntTestMember" useGeneratedKeys="true" keyProperty="memberId">
|
insert into ent_test_member
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="memberName != null and memberName != ''">member_name,</if>
|
<if test="memberDept != null and memberDept != ''">member_dept,</if>
|
<if test="memberEmail != null and memberEmail != ''">member_email,</if>
|
<if test="memberPhone != null and memberPhone != ''">member_phone,</if>
|
<if test="testId != null ">test_id,</if>
|
<if test="token != null and token != ''">token,</if>
|
<if test="startTime != null ">start_time,</if>
|
<if test="smsStatus != null and smsStatus != ''">sms_status,</if>
|
<if test="smsTime != null ">sms_time,</if>
|
<if test="emailStatus != null and emailStatus != ''">email_status,</if>
|
<if test="emailTime != null ">email_time,</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="status != null and status != ''">status,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="memberName != null and memberName != ''">#{memberName},</if>
|
<if test="memberDept != null and memberDept != ''">#{memberDept},</if>
|
<if test="memberEmail != null and memberEmail != ''">#{memberEmail},</if>
|
<if test="memberPhone != null and memberPhone != ''">#{memberPhone},</if>
|
<if test="testId != null ">#{testId},</if>
|
<if test="token != null and token != ''">#{token},</if>
|
<if test="startTime != null ">#{startTime},</if>
|
<if test="smsStatus != null and smsStatus != ''">#{smsStatus},</if>
|
<if test="smsTime != null ">#{smsTime},</if>
|
<if test="emailStatus != null and emailStatus != ''">#{emailStatus},</if>
|
<if test="emailTime != null ">#{emailTime},</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="status != null and status != ''">#{status},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
</trim>
|
</insert>
|
|
<update id="updateEntTestMember" parameterType="EntTestMember">
|
update ent_test_member
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="memberName != null and memberName != ''">member_name = #{memberName},</if>
|
<if test="memberDept != null and memberDept != ''">member_dept = #{memberDept},</if>
|
<if test="memberEmail != null and memberEmail != ''">member_email = #{memberEmail},</if>
|
<if test="memberPhone != null and memberPhone != ''">member_phone = #{memberPhone},</if>
|
<if test="testId != null ">test_id = #{testId},</if>
|
<if test="token != null and token != ''">token = #{token},</if>
|
<if test="startTime != null ">start_time = #{startTime},</if>
|
<if test="endTime != null ">end_time = #{endTime},</if>
|
<if test="smsStatus != null and smsStatus != ''">sms_status = #{smsStatus},</if>
|
<if test="smsTime != null ">sms_time = #{smsTime},</if>
|
<if test="emailStatus != null and emailStatus != ''">email_status = #{emailStatus},</if>
|
<if test="emailTime != null ">email_time = #{emailTime},</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="status != null and status != ''">status = #{status},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="hrEmailStatus != null and hrEmailStatus != ''">hr_email_status = #{hrEmailStatus},</if>
|
<if test="hrEmailTime != null ">hr_email_time = #{hrEmailTime},</if>
|
</trim>
|
where member_id = #{memberId}
|
</update>
|
|
<delete id="deleteEntTestMemberById" parameterType="Long">
|
delete from ent_test_member where member_id = #{memberId}
|
</delete>
|
|
<delete id="deleteEntTestMemberByIds" parameterType="String">
|
delete from ent_test_member where member_id in
|
<foreach item="memberId" collection="array" open="(" separator="," close=")">
|
#{memberId}
|
</foreach>
|
</delete>
|
|
<select id="findEntTestMember" parameterType="java.util.Map" resultMap="EntTestMemberResult">
|
<include refid="selectEntTestMemberVo"/>
|
<where>
|
<if test="status != null "> status in
|
<foreach item="status" collection="status" open="(" separator="," close=")">
|
#{status}
|
</foreach>
|
</if>
|
<if test="token != null "> and token = #{token}</if>
|
</where>
|
</select>
|
|
</mapper>
|