|
|
@@ -0,0 +1,146 @@
|
|
|
+<?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.WxSopLogsMapper">
|
|
|
+
|
|
|
+ <resultMap type="WxSopLogs" id="WxSopLogsResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="type" column="type" />
|
|
|
+ <result property="sopId" column="sop_id" />
|
|
|
+ <result property="sopUserId" column="sop_user_id" />
|
|
|
+ <result property="sendType" column="send_type" />
|
|
|
+ <result property="generateType" column="generate_type" />
|
|
|
+ <result property="accountId" column="account_id" />
|
|
|
+ <result property="wxContactId" column="wx_contact_id" />
|
|
|
+ <result property="wxContactName" column="wx_contact_name" />
|
|
|
+ <result property="wxRoomId" column="wx_room_id" />
|
|
|
+ <result property="wxRoomName" column="wx_room_name" />
|
|
|
+ <result property="fsUserId" column="fs_user_id" />
|
|
|
+ <result property="sendStatus" column="send_status" />
|
|
|
+ <result property="sendRemark" column="send_remark" />
|
|
|
+ <result property="sendSort" column="send_sort" />
|
|
|
+ <result property="expirationTime" column="expiration_time" />
|
|
|
+ <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" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectWxSopLogsVo">
|
|
|
+ select id, type, sop_id, sop_user_id, send_type, generate_type, account_id, wx_contact_id, wx_contact_name, wx_room_id, wx_room_name, fs_user_id, send_status, send_remark, send_sort, expiration_time, create_time, create_by, update_time, update_by, remark from wx_sop_logs
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectWxSopLogsList" parameterType="WxSopLogs" resultMap="WxSopLogsResult">
|
|
|
+ <include refid="selectWxSopLogsVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="type != null "> and type = #{type}</if>
|
|
|
+ <if test="sopId != null "> and sop_id = #{sopId}</if>
|
|
|
+ <if test="sopUserId != null "> and sop_user_id = #{sopUserId}</if>
|
|
|
+ <if test="sendType != null "> and send_type = #{sendType}</if>
|
|
|
+ <if test="generateType != null "> and generate_type = #{generateType}</if>
|
|
|
+ <if test="accountId != null "> and account_id = #{accountId}</if>
|
|
|
+ <if test="wxContactId != null "> and wx_contact_id = #{wxContactId}</if>
|
|
|
+ <if test="wxContactName != null and wxContactName != ''"> and wx_contact_name like concat('%', #{wxContactName}, '%')</if>
|
|
|
+ <if test="wxRoomId != null "> and wx_room_id = #{wxRoomId}</if>
|
|
|
+ <if test="wxRoomName != null and wxRoomName != ''"> and wx_room_name like concat('%', #{wxRoomName}, '%')</if>
|
|
|
+ <if test="fsUserId != null "> and fs_user_id = #{fsUserId}</if>
|
|
|
+ <if test="sendStatus != null "> and send_status = #{sendStatus}</if>
|
|
|
+ <if test="sendRemark != null and sendRemark != ''"> and send_remark = #{sendRemark}</if>
|
|
|
+ <if test="sendSort != null "> and send_sort = #{sendSort}</if>
|
|
|
+ <if test="expirationTime != null "> and expiration_time = #{expirationTime}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectWxSopLogsById" parameterType="Long" resultMap="WxSopLogsResult">
|
|
|
+ <include refid="selectWxSopLogsVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertWxSopLogs" parameterType="WxSopLogs" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into wx_sop_logs
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="type != null">type,</if>
|
|
|
+ <if test="sopId != null">sop_id,</if>
|
|
|
+ <if test="sopUserId != null">sop_user_id,</if>
|
|
|
+ <if test="sendType != null">send_type,</if>
|
|
|
+ <if test="generateType != null">generate_type,</if>
|
|
|
+ <if test="accountId != null">account_id,</if>
|
|
|
+ <if test="wxContactId != null">wx_contact_id,</if>
|
|
|
+ <if test="wxContactName != null">wx_contact_name,</if>
|
|
|
+ <if test="wxRoomId != null">wx_room_id,</if>
|
|
|
+ <if test="wxRoomName != null">wx_room_name,</if>
|
|
|
+ <if test="fsUserId != null">fs_user_id,</if>
|
|
|
+ <if test="sendStatus != null">send_status,</if>
|
|
|
+ <if test="sendRemark != null">send_remark,</if>
|
|
|
+ <if test="sendSort != null">send_sort,</if>
|
|
|
+ <if test="expirationTime != null">expiration_time,</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>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
+ <if test="sopId != null">#{sopId},</if>
|
|
|
+ <if test="sopUserId != null">#{sopUserId},</if>
|
|
|
+ <if test="sendType != null">#{sendType},</if>
|
|
|
+ <if test="generateType != null">#{generateType},</if>
|
|
|
+ <if test="accountId != null">#{accountId},</if>
|
|
|
+ <if test="wxContactId != null">#{wxContactId},</if>
|
|
|
+ <if test="wxContactName != null">#{wxContactName},</if>
|
|
|
+ <if test="wxRoomId != null">#{wxRoomId},</if>
|
|
|
+ <if test="wxRoomName != null">#{wxRoomName},</if>
|
|
|
+ <if test="fsUserId != null">#{fsUserId},</if>
|
|
|
+ <if test="sendStatus != null">#{sendStatus},</if>
|
|
|
+ <if test="sendRemark != null">#{sendRemark},</if>
|
|
|
+ <if test="sendSort != null">#{sendSort},</if>
|
|
|
+ <if test="expirationTime != null">#{expirationTime},</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>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateWxSopLogs" parameterType="WxSopLogs">
|
|
|
+ update wx_sop_logs
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="type != null">type = #{type},</if>
|
|
|
+ <if test="sopId != null">sop_id = #{sopId},</if>
|
|
|
+ <if test="sopUserId != null">sop_user_id = #{sopUserId},</if>
|
|
|
+ <if test="sendType != null">send_type = #{sendType},</if>
|
|
|
+ <if test="generateType != null">generate_type = #{generateType},</if>
|
|
|
+ <if test="accountId != null">account_id = #{accountId},</if>
|
|
|
+ <if test="wxContactId != null">wx_contact_id = #{wxContactId},</if>
|
|
|
+ <if test="wxContactName != null">wx_contact_name = #{wxContactName},</if>
|
|
|
+ <if test="wxRoomId != null">wx_room_id = #{wxRoomId},</if>
|
|
|
+ <if test="wxRoomName != null">wx_room_name = #{wxRoomName},</if>
|
|
|
+ <if test="fsUserId != null">fs_user_id = #{fsUserId},</if>
|
|
|
+ <if test="sendStatus != null">send_status = #{sendStatus},</if>
|
|
|
+ <if test="sendRemark != null">send_remark = #{sendRemark},</if>
|
|
|
+ <if test="sendSort != null">send_sort = #{sendSort},</if>
|
|
|
+ <if test="expirationTime != null">expiration_time = #{expirationTime},</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>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteWxSopLogsById" parameterType="Long">
|
|
|
+ delete from wx_sop_logs where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteWxSopLogsByIds" parameterType="String">
|
|
|
+ delete from wx_sop_logs where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|