Files
zxjp-web/coolstore-partner-dao/src/main/resources/mapper/HyPartnerEcTrackLogMapper.xml
2023-10-26 18:59:38 +08:00

345 lines
12 KiB
XML

<?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.cool.store.mapper.HyPartnerEcTrackLogMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerEcTrackLogDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="trajectory_id" jdbcType="VARCHAR" property="trajectoryId" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="user_name" jdbcType="VARCHAR" property="userName" />
<result column="crm_id" jdbcType="VARCHAR" property="crmId" />
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
<result column="receive_user_ids" jdbcType="VARCHAR" property="receiveUserIds" />
<result column="receive_user" jdbcType="VARCHAR" property="receiveUser" />
<result column="trajectory_type" jdbcType="INTEGER" property="trajectoryType" />
<result column="trajectory_type_content" jdbcType="VARCHAR" property="trajectoryTypeContent" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="operate_time" jdbcType="TIMESTAMP" property="operateTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, trajectory_id, user_id, user_name, crm_id,mobile, receive_user_ids, receive_user, trajectory_type,partner_id,
trajectory_type_content, content, operate_time, create_time, update_time, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_partner_ec_track_log
where id = #{id,jdbcType=BIGINT}
</select>
<select id="getEcLogPageByPartnerId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from hy_partner_ec_track_log
where partner_id = #{partnerId} order by operate_time desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from hy_partner_ec_track_log
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.cool.store.entity.HyPartnerEcTrackLogDO" useGeneratedKeys="true">
insert into hy_partner_ec_track_log (trajectory_id, user_id, user_name, mobile,
crm_id,partner_id, receive_user_ids, receive_user,
trajectory_type, trajectory_type_content,
content, operate_time, create_time,
update_time, remark)
values (#{trajectoryId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR},
#{crmId,jdbcType=VARCHAR},#{partnerId,jdbcType=VARCHAR}, #{receiveUserIds,jdbcType=VARCHAR}, #{receiveUser,jdbcType=VARCHAR},
#{trajectoryType,jdbcType=INTEGER}, #{trajectoryTypeContent,jdbcType=VARCHAR},
#{content,jdbcType=VARCHAR}, #{operateTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.cool.store.entity.HyPartnerEcTrackLogDO" useGeneratedKeys="true">
insert into hy_partner_ec_track_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="trajectoryId != null">
trajectory_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="userName != null">
user_name,
</if>
<if test="mobile != null">
mobile,
</if>
<if test="crmId != null">
crm_id,
</if>
<if test="partnerId != null">
partner_id,
</if>
<if test="receiveUserIds != null">
receive_user_ids,
</if>
<if test="receiveUser != null">
receive_user,
</if>
<if test="trajectoryType != null">
trajectory_type,
</if>
<if test="trajectoryTypeContent != null">
trajectory_type_content,
</if>
<if test="content != null">
content,
</if>
<if test="operateTime != null">
operate_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="trajectoryId != null">
#{trajectoryId,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="userName != null">
#{userName,jdbcType=VARCHAR},
</if>
<if test="mobile != null">
#{mobile,jdbcType=VARCHAR},
</if>
<if test="crmId != null">
#{crmId,jdbcType=VARCHAR},
</if>
<if test="partnerId != null">
#{partnerId,jdbcType=VARCHAR},
</if>
<if test="receiveUserIds != null">
#{receiveUserIds,jdbcType=VARCHAR},
</if>
<if test="receiveUser != null">
#{receiveUser,jdbcType=VARCHAR},
</if>
<if test="trajectoryType != null">
#{trajectoryType,jdbcType=INTEGER},
</if>
<if test="trajectoryTypeContent != null">
#{trajectoryTypeContent,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="operateTime != null">
#{operateTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
ON DUPLICATE KEY UPDATE trajectory_id=values(trajectory_id)
,user_id=values(user_id)
,user_name=values(user_name)
,crm_id=values(crm_id)
,partner_id=values(partner_id)
,mobile=values(mobile)
,receive_user_ids=values(receive_user_ids)
,receive_user=values(receive_user)
,trajectory_type=values(trajectory_type)
,trajectory_type_content=values(trajectory_type_content)
,content=values(content)
,operate_time=values(operate_time)
,create_time=values(create_time)
,remark=values(remark)
</insert>
<insert id="batchInsertOrUpdate">
<foreach collection="recordList" item="record" separator=";">
insert into hy_partner_ec_track_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="trajectoryId != null">
trajectory_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="userName != null">
user_name,
</if>
<if test="mobile != null">
mobile,
</if>
<if test="crmId != null">
crm_id,
</if>
<if test="partnerId != null">
partner_id,
</if>
<if test="receiveUserIds != null">
receive_user_ids,
</if>
<if test="receiveUser != null">
receive_user,
</if>
<if test="trajectoryType != null">
trajectory_type,
</if>
<if test="trajectoryTypeContent != null">
trajectory_type_content,
</if>
<if test="content != null">
content,
</if>
<if test="operateTime != null">
operate_time,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.trajectoryId != null">
#{record.trajectoryId,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
#{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.userName != null">
#{record.userName,jdbcType=VARCHAR},
</if>
<if test="record.mobile != null">
#{record.mobile,jdbcType=VARCHAR},
</if>
<if test="record.crmId != null">
#{record.crmId,jdbcType=VARCHAR},
</if>
<if test="record.partnerId != null">
#{record.partnerId,jdbcType=VARCHAR},
</if>
<if test="record.receiveUserIds != null">
#{record.receiveUserIds,jdbcType=VARCHAR},
</if>
<if test="record.receiveUser != null">
#{record.receiveUser,jdbcType=VARCHAR},
</if>
<if test="record.trajectoryType != null">
#{record.trajectoryType,jdbcType=INTEGER},
</if>
<if test="record.trajectoryTypeContent != null">
#{record.trajectoryTypeContent,jdbcType=VARCHAR},
</if>
<if test="record.content != null">
#{record.content,jdbcType=VARCHAR},
</if>
<if test="record.operateTime != null">
#{record.operateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.createTime != null">
#{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.remark != null">
#{record.remark,jdbcType=VARCHAR},
</if>
</trim>
ON DUPLICATE KEY UPDATE trajectory_id=values(trajectory_id)
,user_id=values(user_id)
,user_name=values(user_name)
,crm_id=values(crm_id)
,partner_id=values(partner_id)
,mobile=values(mobile)
,receive_user_ids=values(receive_user_ids)
,receive_user=values(receive_user)
,trajectory_type=values(trajectory_type)
,trajectory_type_content=values(trajectory_type_content)
,content=values(content)
,operate_time=values(operate_time)
,create_time=values(create_time)
,remark=values(remark)
</foreach>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyPartnerEcTrackLogDO">
update hy_partner_ec_track_log
<set>
<if test="trajectoryId != null">
trajectory_id = #{trajectoryId,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="mobile != null">
mobile = #{mobile,jdbcType=VARCHAR},
</if>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="crmId != null">
crm_id = #{crmId,jdbcType=VARCHAR},
</if>
<if test="partnerId != null">
partner_id = #{partnerId,jdbcType=VARCHAR},
</if>
<if test="receiveUserIds != null">
receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR},
</if>
<if test="receiveUser != null">
receive_user = #{receiveUser,jdbcType=VARCHAR},
</if>
<if test="trajectoryType != null">
trajectory_type = #{trajectoryType,jdbcType=INTEGER},
</if>
<if test="trajectoryTypeContent != null">
trajectory_type_content = #{trajectoryTypeContent,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="operateTime != null">
operate_time = #{operateTime,jdbcType=TIMESTAMP},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.cool.store.entity.HyPartnerEcTrackLogDO">
update hy_partner_ec_track_log
set trajectory_id = #{trajectoryId,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
user_name = #{userName,jdbcType=VARCHAR},
crm_id = #{crmId,jdbcType=VARCHAR},
partner_id = #{partnerId,jdbcType=VARCHAR},
mobile = #{mobile,jdbcType=VARCHAR},
receive_user_ids = #{receiveUserIds,jdbcType=VARCHAR},
receive_user = #{receiveUser,jdbcType=VARCHAR},
trajectory_type = #{trajectoryType,jdbcType=INTEGER},
trajectory_type_content = #{trajectoryTypeContent,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
operate_time = #{operateTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>