<?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.ruoyi.system.mapper.SysContactMapper">
|
|
<resultMap type="SysContact" id="SysContactResult">
|
<result property="id" column="id" />
|
<result property="userId" column="user_id" />
|
<result property="wxNickname" column="wx_nickname" />
|
<result property="phone" column="phone" />
|
<result property="wxVoiceFlag" column="wx_voice_flag" />
|
<result property="wxVideoFlag" column="wx_video_flag" />
|
<result property="phoneFlag" column="phone_flag" />
|
<result property="noAnswerFlag" column="no_answer_flag" />
|
<result property="avatar" column="avatar" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="delFlag" column="del_flag" />
|
</resultMap>
|
|
<sql id="selectSysContactVo">
|
select id, user_id, wx_nickname, phone, wx_voice_flag, wx_video_flag, phone_flag, no_answer_flag, avatar, create_by, create_time, del_flag from sys_contact
|
</sql>
|
|
<select id="selectSysContactList" parameterType="SysContact" resultMap="SysContactResult">
|
<include refid="selectSysContactVo"/>
|
<where>
|
del_flag != '1'
|
<if test="userId != null "> and user_id = #{userId}</if>
|
<if test="wxNickname != null and wxNickname != ''"> and wx_nickname like concat('%', #{wxNickname}, '%')</if>
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
<if test="wxVoiceFlag != null "> and wx_voice_flag = #{wxVoiceFlag}</if>
|
<if test="wxVideoFlag != null "> and wx_video_flag = #{wxVideoFlag}</if>
|
<if test="phoneFlag != null "> and phone_flag = #{phoneFlag}</if>
|
<if test="noAnswerFlag != null "> and no_answer_flag = #{noAnswerFlag}</if>
|
<if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
|
</where>
|
</select>
|
|
<select id="selectSysContactById" parameterType="Long" resultMap="SysContactResult">
|
<include refid="selectSysContactVo"/>
|
where del_flag != '1' and id = #{id}
|
</select>
|
|
<insert id="insertSysContact" parameterType="SysContact" useGeneratedKeys="true" keyProperty="id">
|
insert into sys_contact
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="userId != null">user_id,</if>
|
<if test="wxNickname != null">wx_nickname,</if>
|
<if test="phone != null">phone,</if>
|
<if test="wxVoiceFlag != null">wx_voice_flag,</if>
|
<if test="wxVideoFlag != null">wx_video_flag,</if>
|
<if test="phoneFlag != null">phone_flag,</if>
|
<if test="noAnswerFlag != null">no_answer_flag,</if>
|
<if test="avatar != null">avatar,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="delFlag != null">del_flag,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="userId != null">#{userId},</if>
|
<if test="wxNickname != null">#{wxNickname},</if>
|
<if test="phone != null">#{phone},</if>
|
<if test="wxVoiceFlag != null">#{wxVoiceFlag},</if>
|
<if test="wxVideoFlag != null">#{wxVideoFlag},</if>
|
<if test="phoneFlag != null">#{phoneFlag},</if>
|
<if test="noAnswerFlag != null">#{noAnswerFlag},</if>
|
<if test="avatar != null">#{avatar},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
</trim>
|
</insert>
|
|
<update id="updateSysContact" parameterType="SysContact">
|
update sys_contact
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="userId != null">user_id = #{userId},</if>
|
<if test="wxNickname != null">wx_nickname = #{wxNickname},</if>
|
<if test="phone != null">phone = #{phone},</if>
|
<if test="wxVoiceFlag != null">wx_voice_flag = #{wxVoiceFlag},</if>
|
<if test="wxVideoFlag != null">wx_video_flag = #{wxVideoFlag},</if>
|
<if test="phoneFlag != null">phone_flag = #{phoneFlag},</if>
|
<if test="noAnswerFlag != null">no_answer_flag = #{noAnswerFlag},</if>
|
<if test="avatar != null">avatar = #{avatar},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteSysContactById" parameterType="Long">
|
update sys_contact set del_flag = '1' where id = #{id}
|
</delete>
|
|
<delete id="deleteSysContactByIds" parameterType="String">
|
update sys_contact set del_flag = '1' where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|