xiongan-meeting/ics-admin/src/main/resources/mapper/admin/IcsCustomerStaffMapper.xml

154 lines
8.7 KiB
XML
Raw Normal View History

2024-02-25 11:16:55 +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.IcsCustomerStaffMapper">
<resultMap type="com.ics.admin.domain.IcsCustomerStaff" id="IcsCustomerStaffResult">
<result property="id" column="id" />
<result property="username" column="username" />
<result property="mobile" column="mobile" />
<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="deleteFlag" column="delete_flag" />
<result property="icsCustomerId" column="ics_customer_id" />
<result property="openid" column="openid" />
<result property="avatar" column="avatar" />
<result property="gender" column="gender" />
<result property="status" column="status" />
<result property="parkId" column="park_id" />
<result property="cardNo" column="card_no" />
<result property="visitTime" column="visit_time" />
<result property="leaveTime" column="leave_time" />
<result property="visitContent" column="visit_content" />
<result property="toName" column="to_name" />
<result property="toPhone" column="to_phone" />
<result property="toCustomer" column="to_customer" />
<result property="toCustomerId" column="to_customer_id" />
<result property="dataType" column="data_type" />
2024-02-25 11:16:55 +08:00
</resultMap>
<sql id="selectIcsCustomerStaffVo">
SELECT id, username, mobile, create_by, create_time, update_by, update_time, delete_flag, ics_customer_id, openid, avatar, gender, status, park_id,card_no, visit_time,
leave_time,visit_content,to_name,to_phone,to_customer,to_customer_id,data_type
FROM ics_customer_staff
2024-02-25 11:16:55 +08:00
</sql>
<select id="selectIcsCustomerStaffList" parameterType="IcsCustomerStaff" resultMap="IcsCustomerStaffResult">
<include refid="selectIcsCustomerStaffVo"/>
<where>
<if test="username != null and username != ''"> AND username LIKE CONCAT('%', #{username}, '%') </if>
<if test="icsCustomerId != null and icsCustomerId != ''"> AND ics_customer_id = #{icsCustomerId} </if>
</where>
</select>
<select id="selectIcsCustomerStaffById" parameterType="Long" resultMap="IcsCustomerStaffResult">
<include refid="selectIcsCustomerStaffVo"/>
WHERE id = #{id}
</select>
<insert id="insertIcsCustomerStaff" parameterType="IcsCustomerStaff">
INSERT INTO ics_customer_staff
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null ">id,</if>
<if test="username != null and username != ''">username,</if>
<if test="mobile != null and mobile != ''">mobile,</if>
<if test="password != null and password != ''">password,</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="deleteFlag != null ">delete_flag,</if>
<if test="icsCustomerId != null ">ics_customer_id,</if>
<if test="openid != null and openid != ''">openid,</if>
<if test="avatar != null and avatar != ''">avatar,</if>
<if test="gender != null and gender != ''">gender,</if>
<if test="status != null and status != ''">status,</if>
<if test="parkId != null ">park_id,</if>
<if test="cardNo != null and cardNo !=''">,</if>
<if test="visitTime != null ">,</if>
<if test="leaveTime != null ">,</if>
<if test="visitContent != null and visitContent !=''">,</if>
<if test="toName != null and toName!=''">,</if>
<if test="toPhone != null and toPhone!=''">,</if>
<if test="toCustomer != null and toCustomer!=''">,</if>
<if test="toCustomerId != null and toCustomerId!=''">,</if>
<if test="dataType != null dataType!=''">,</if>
2024-02-25 11:16:55 +08:00
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null ">#{id},</if>
<if test="username != null and username != ''">#{username},</if>
<if test="mobile != null and mobile != ''">#{mobile},</if>
<if test="password != null and password != ''">#{password},</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="deleteFlag != null ">#{deleteFlag},</if>
<if test="icsCustomerId != null ">#{icsCustomerId},</if>
<if test="openid != null and openid != ''">#{openid},</if>
<if test="avatar != null and avatar != ''">#{avatar},</if>
<if test="gender != null and gender != ''">#{gender},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="parkId != null ">#{parkId},</if>
<if test="cardNo != null and cardNo !=''">#{cardNo}</if>
<if test="visitTime != null ">#{visitTime}</if>
<if test="leaveTime != null ">#{leaveTime}</if>
<if test="visitContent != null and visitContent !=''">#{visitContent}</if>
<if test="toName != null and toName!=''">#{toName}</if>
<if test="toPhone != null and toPhone!=''">#{toPhone}</if>
<if test="toCustomer != null and toCustomer!=''">#{toCustomer}</if>
<if test="toCustomerId != null and toCustomerId!=''">#{toCustomerId}</if>
<if test="dataType != null dataType!=''">#{dataType}</if>
2024-02-25 11:16:55 +08:00
</trim>
</insert>
<update id="updateIcsCustomerStaff" parameterType="IcsCustomerStaff">
UPDATE ics_customer_staff
<trim prefix="SET" suffixOverrides=",">
<if test="username != null and username != ''">username = #{username},</if>
<if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
<if test="password != null and password != ''">password = #{password},</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="deleteFlag != null ">delete_flag = #{deleteFlag},</if>
<if test="icsCustomerId != null ">ics_customer_id = #{icsCustomerId},</if>
<if test="openid != null and openid != ''">openid = #{openid},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="gender != null and gender != ''">gender = #{gender},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="parkId != null ">park_id = #{parkId},</if>
<if test="cardNo != null and cardNo !=''">card_no = #{cardNo}</if>
<if test="visitTime != null ">visit_time = #{visitTime}</if>
<if test="leaveTime != null ">leave_time = #{leaveTime}</if>
<if test="visitContent != null and visitContent !=''">visit_content = #{visitContent}</if>
<if test="toName != null and toName!=''">to_name = #{toName}</if>
<if test="toPhone != null and toPhone!=''">to_phone = #{toPhone}</if>
<if test="toCustomer != null and toCustomer!=''">to_customer = #{toCustomer}</if>
<if test="toCustomerId != null and toCustomerId!=''">to_customer_id = #{toCustomerId}</if>
2024-02-25 11:16:55 +08:00
</trim>
WHERE id = #{id}
</update>
<delete id="deleteIcsCustomerStaffById" parameterType="Long">
DELETE FROM ics_customer_staff WHERE id = #{id}
</delete>
<delete id="deleteIcsCustomerStaffByIds" parameterType="String">
DELETE FROM ics_customer_staff where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="checkPhoneUnique" parameterType="String" resultType="IcsCustomerStaff">
<include refid="selectIcsCustomerStaffVo"/>
WHERE mobile=#{mobile}
</select>
</mapper>