2024-03-01 08:52:44 +08:00
|
|
|
<?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.ics.admin.mapper.meeting.VisitorPersonMapper">
|
|
|
|
|
|
|
|
<resultMap type="com.ics.admin.domain.meeting.VisitorPerson" id="ReservationPersonResult">
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
<result property="userId" column="user_id"/>
|
|
|
|
<result property="intervieweeId" column="interviewee_id"/>
|
|
|
|
<result property="name" column="name"/>
|
|
|
|
<result property="phone" column="phone"/>
|
|
|
|
<result property="joinTime" column="join_time"/>
|
|
|
|
<result property="visitTime" column="visit_time"/>
|
2024-03-09 15:55:30 +08:00
|
|
|
<result property="customerId" column="customer_id"/>
|
2024-03-01 08:52:44 +08:00
|
|
|
<result property="leaveTime" column="leave_time"/>
|
|
|
|
<result property="visitContent" column="visit_content"/>
|
|
|
|
<result property="cardType" column="card_type"/>
|
|
|
|
<result property="cardNo" column="card_no"/>
|
|
|
|
<result property="status" column="status"/>
|
|
|
|
<result property="photo" column="photo"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectReservationPersonVo">
|
2024-03-09 15:55:30 +08:00
|
|
|
SELECT id, user_id, interviewee_id, name, phone, join_time, visit_time,photo,customer_id, leave_time, visit_content, card_type, card_no, status FROM tb_visitor_person
|
2024-03-01 08:52:44 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectReservationPersonList" parameterType="VisitorPerson" resultMap="ReservationPersonResult">
|
|
|
|
<include refid="selectReservationPersonVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="name != null and name != ''"> AND name LIKE CONCAT('%', #{name}, '%')</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectReservationPersonById" parameterType="Long" resultMap="ReservationPersonResult">
|
|
|
|
<include refid="selectReservationPersonVo"/>
|
|
|
|
WHERE id = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertReservationPerson" parameterType="VisitorPerson">
|
|
|
|
INSERT INTO tb_visitor_person
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null ">id,</if>
|
|
|
|
<if test="userId != null ">user_id,</if>
|
|
|
|
<if test="intervieweeId != null ">interviewee_id,</if>
|
|
|
|
<if test="name != null and name != ''">name,</if>
|
|
|
|
<if test="phone != null ">phone,</if>
|
|
|
|
<if test="joinTime != null ">join_time,</if>
|
|
|
|
<if test="visitTime != null ">visit_time,</if>
|
2024-03-09 15:55:30 +08:00
|
|
|
<if test="customerId != null ">customer_id,</if>
|
2024-03-01 08:52:44 +08:00
|
|
|
<if test="leaveTime != null ">leave_time,</if>
|
|
|
|
<if test="visitContent != null and visitContent != ''">visit_content,</if>
|
|
|
|
<if test="cardType != null and cardType != ''">card_type,</if>
|
|
|
|
<if test="cardNo != null and cardNo != ''">card_no,</if>
|
|
|
|
<if test="status != null ">status,</if>
|
|
|
|
<if test="photo != null ">photo,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null ">#{id},</if>
|
|
|
|
<if test="userId != null ">#{userId},</if>
|
|
|
|
<if test="intervieweeId != null ">#{intervieweeId},</if>
|
|
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
|
|
<if test="phone != null ">#{phone},</if>
|
|
|
|
<if test="joinTime != null ">#{joinTime},</if>
|
|
|
|
<if test="visitTime != null ">#{visitTime},</if>
|
2024-03-09 15:55:30 +08:00
|
|
|
<if test="customerId != null ">#{customerId},</if>
|
2024-03-01 08:52:44 +08:00
|
|
|
<if test="leaveTime != null ">#{leaveTime},</if>
|
|
|
|
<if test="visitContent != null and visitContent != ''">#{visitContent},</if>
|
|
|
|
<if test="cardType != null and cardType != ''">#{cardType},</if>
|
|
|
|
<if test="cardNo != null and cardNo != ''">#{cardNo},</if>
|
|
|
|
<if test="status != null ">#{status},</if>
|
|
|
|
<if test="photo != null ">#{photo},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateReservationPerson" parameterType="VisitorPerson">
|
|
|
|
UPDATE tb_visitor_person
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="userId != null ">user_id = #{userId},</if>
|
|
|
|
<if test="intervieweeId != null ">interviewee_id = #{intervieweeId},</if>
|
|
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
|
|
<if test="phone != null ">phone = #{phone},</if>
|
|
|
|
<if test="joinTime != null ">join_time = #{joinTime},</if>
|
|
|
|
<if test="visitTime != null ">visit_time = #{visitTime},</if>
|
2024-03-09 15:55:30 +08:00
|
|
|
<if test="customerId != null ">customer_id = #{customerId},</if>
|
2024-03-01 08:52:44 +08:00
|
|
|
<if test="leaveTime != null ">leave_time = #{leaveTime},</if>
|
|
|
|
<if test="visitContent != null and visitContent != ''">visit_content = #{visitContent},</if>
|
|
|
|
<if test="cardType != null and cardType != ''">card_type = #{cardType},</if>
|
|
|
|
<if test="cardNo != null and cardNo != ''">card_no = #{cardNo},</if>
|
|
|
|
<if test="status != null ">status = #{status},</if>
|
|
|
|
<if test="photo != null ">photo = #{photo},</if>
|
|
|
|
</trim>
|
|
|
|
WHERE id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteReservationPersonById" parameterType="Long">
|
|
|
|
DELETE FROM tb_visitor_person WHERE id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteReservationPersonByIds" parameterType="String">
|
|
|
|
DELETE FROM tb_visitor_person where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
</mapper>
|