| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?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.fs.wx.sop.mapper.WxSopUserInfoMapper">
- <resultMap type="WxSopUserInfo" id="WxSopUserInfoResult">
- <result property="id" column="id" />
- <result property="sopId" column="sop_id" />
- <result property="sopUserId" column="sop_user_id" />
- <result property="wxContactId" column="wx_contact_id" />
- <result property="customerId" column="customer_id" />
- <result property="fsUserId" column="fs_user_id" />
- <result property="isDaysNotStudy" column="is_days_not_study" />
- <result property="finishCout" column="finish_cout" />
- <result property="finishTime" column="finish_time" />
- <result property="finishCourseDays" column="finish_course_days" />
- <result property="grade" column="grade" />
- <result property="status" column="status" />
- <result property="createTime" column="create_time" />
- <result property="createBy" column="create_by" />
- <result property="updateTime" column="update_time" />
- <result property="updateBy" column="update_by" />
- <result property="remark" column="remark" />
- <result property="tagNames" column="tag_names" />
- </resultMap>
- <sql id="selectWxSopUserInfoVo">
- select wsui.id, wsui.sop_id, wsui.sop_user_id, wsui.wx_contact_id, wsui.customer_id, wsui.fs_user_id, wsui.is_days_not_study,
- wsui.finish_cout, wsui.finish_time, wsui.finish_course_days, wsui.grade, wsui.status,
- wsui.create_time, wsui.create_by, wsui.update_time, wsui.update_by, wsui.remark,
- COALESCE(wsui.tag_names, cc.tags) as tag_names
- from wx_sop_user_info wsui
- left join ylrz_his_scrm.wx_contact wc on wsui.wx_contact_id = wc.id
- left join ylrz_his_scrm.crm_customer cc on COALESCE(wc.customer_id, wsui.customer_id) = cc.customer_id
- </sql>
- <select id="selectWxSopUserInfoList" parameterType="WxSopUserInfo" resultMap="WxSopUserInfoResult">
- <include refid="selectWxSopUserInfoVo"/>
- <where>
- <if test="sopId != null "> and wsui.sop_id = #{sopId}</if>
- <if test="sopUserId != null "> and wsui.sop_user_id = #{sopUserId}</if>
- <if test="wxContactId != null "> and wsui.wx_contact_id = #{wxContactId}</if>
- <if test="customerId != null "> and wsui.customer_id = #{customerId}</if>
- <if test="fsUserId != null "> and wsui.fs_user_id = #{fsUserId}</if>
- <if test="isDaysNotStudy != null "> and wsui.is_days_not_study = #{isDaysNotStudy}</if>
- <if test="finishCout != null "> and wsui.finish_cout = #{finishCout}</if>
- <if test="finishTime != null "> and wsui.finish_time = #{finishTime}</if>
- <if test="finishCourseDays != null "> and wsui.finish_course_days = #{finishCourseDays}</if>
- <if test="grade != null "> and wsui.grade = #{grade}</if>
- <if test="status != null "> and wsui.status = #{status}</if>
- </where>
- </select>
- <select id="selectWxSopUserInfoById" parameterType="Long" resultMap="WxSopUserInfoResult">
- <include refid="selectWxSopUserInfoVo"/>
- where wsui.id = #{id}
- </select>
- <insert id="insertWxSopUserInfo" parameterType="WxSopUserInfo" useGeneratedKeys="true" keyProperty="id">
- insert into wx_sop_user_info
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="sopId != null">sop_id,</if>
- <if test="sopUserId != null">sop_user_id,</if>
- <if test="wxContactId != null">wx_contact_id,</if>
- <if test="customerId != null">customer_id,</if>
- <if test="fsUserId != null">fs_user_id,</if>
- <if test="isDaysNotStudy != null">is_days_not_study,</if>
- <if test="finishCout != null">finish_cout,</if>
- <if test="finishTime != null">finish_time,</if>
- <if test="finishCourseDays != null">finish_course_days,</if>
- <if test="grade != null">grade,</if>
- <if test="status != null">status,</if>
- <if test="createTime != null">create_time,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="remark != null">remark,</if>
- <if test="tagNames != null">tag_names,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="sopId != null">#{sopId},</if>
- <if test="sopUserId != null">#{sopUserId},</if>
- <if test="wxContactId != null">#{wxContactId},</if>
- <if test="customerId != null">#{customerId},</if>
- <if test="fsUserId != null">#{fsUserId},</if>
- <if test="isDaysNotStudy != null">#{isDaysNotStudy},</if>
- <if test="finishCout != null">#{finishCout},</if>
- <if test="finishTime != null">#{finishTime},</if>
- <if test="finishCourseDays != null">#{finishCourseDays},</if>
- <if test="grade != null">#{grade},</if>
- <if test="status != null">#{status},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="remark != null">#{remark},</if>
- <if test="tagNames != null">#{tagNames},</if>
- </trim>
- </insert>
- <update id="updateWxSopUserInfo" parameterType="WxSopUserInfo">
- update wx_sop_user_info
- <trim prefix="SET" suffixOverrides=",">
- <if test="sopId != null">sop_id = #{sopId},</if>
- <if test="sopUserId != null">sop_user_id = #{sopUserId},</if>
- <if test="wxContactId != null">wx_contact_id = #{wxContactId},</if>
- <if test="customerId != null">customer_id = #{customerId},</if>
- <if test="fsUserId != null">fs_user_id = #{fsUserId},</if>
- <if test="isDaysNotStudy != null">is_days_not_study = #{isDaysNotStudy},</if>
- <if test="finishCout != null">finish_cout = #{finishCout},</if>
- <if test="finishTime != null">finish_time = #{finishTime},</if>
- <if test="finishCourseDays != null">finish_course_days = #{finishCourseDays},</if>
- <if test="grade != null">grade = #{grade},</if>
- <if test="status != null">status = #{status},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="tagNames != null">tag_names = #{tagNames},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteWxSopUserInfoById" parameterType="Long">
- delete from wx_sop_user_info where id = #{id}
- </delete>
- <delete id="deleteWxSopUserInfoByIds" parameterType="String">
- delete from wx_sop_user_info where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="selectWxSopUserInfoByCondition" parameterType="WxSopUserInfo" resultMap="WxSopUserInfoResult">
- <include refid="selectWxSopUserInfoVo"/>
- <where>
- <if test="sopId != null">and wsui.sop_id = #{sopId}</if>
- <if test="sopUserId != null">and wsui.sop_user_id = #{sopUserId}</if>
- <if test="wxContactId != null">and wsui.wx_contact_id = #{wxContactId}</if>
- <if test="customerId != null">and wsui.customer_id = #{customerId}</if>
- </where>
- limit 1
- </select>
- </mapper>
|