Files
zxjp-web/coolstore-partner-dao/src/main/resources/mapper/HyPartnerTaskInfoLogMapper.xml

185 lines
7.5 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.HyPartnerTaskInfoLogMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyPartnerTaskInfoLogDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="partner_line_id" jdbcType="BIGINT" property="partnerLineId"/>
<result column="operate_user_id" jdbcType="VARCHAR" property="operateUserId"/>
<result column="operate_username" jdbcType="VARCHAR" property="operateUsername"/>
<result column="operate_type" jdbcType="VARCHAR" property="operateType"/>
<result column="workflow_stage" jdbcType="VARCHAR" property="workflowStage"/>
<result column="workflow_status" jdbcType="VARCHAR" property="workflowStatus"/>
<result column="message" jdbcType="VARCHAR" property="message"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="partner_id" jdbcType="VARCHAR" property="partnerId"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.HyPartnerTaskInfoLogDO">
<result column="field_copy" jdbcType="LONGVARCHAR" property="fieldCopy"/>
</resultMap>
<sql id="Base_Column_List">
id, partner_line_id, operate_user_id, operate_username, operate_type, workflow_stage, workflow_status,
message, create_time, update_time, partner_id
</sql>
<sql id="Blob_Column_List">
field_copy
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_task_info_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerLineId != null">
partner_line_id,
</if>
<if test="record.operateUserId != null">
operate_user_id,
</if>
<if test="record.operateUsername != null">
operate_username,
</if>
<if test="record.operateType != null">
operate_type,
</if>
<if test="record.workflowStage != null">
workflow_stage,
</if>
<if test="record.workflowStatus != null">
workflow_status,
</if>
<if test="record.message != null">
message,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.partnerId != null">
partner_id,
</if>
<if test="record.fieldCopy != null">
field_copy,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.partnerLineId != null">
#{record.partnerLineId},
</if>
<if test="record.operateUserId != null">
#{record.operateUserId},
</if>
<if test="record.operateUsername != null">
#{record.operateUsername},
</if>
<if test="record.operateType != null">
#{record.operateType},
</if>
<if test="record.workflowStage != null">
#{record.workflowStage},
</if>
<if test="record.workflowStatus != null">
#{record.workflowStatus},
</if>
<if test="record.message != null">
#{record.message},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.partnerId != null">
#{record.partnerId},
</if>
<if test="record.fieldCopy != null">
#{record.fieldCopy},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update hy_partner_task_info_log
<set>
<if test="record.partnerLineId != null">
partner_line_id = #{record.partnerLineId},
</if>
<if test="record.operateUserId != null">
operate_user_id = #{record.operateUserId},
</if>
<if test="record.operateUsername != null">
operate_username = #{record.operateUsername},
</if>
<if test="record.workflowStage != null">
workflow_stage = #{record.workflowStage},
</if>
<if test="record.workflowStatus != null">
workflow_status = #{record.workflowStatus},
</if>
<if test="record.message != null">
message = #{record.message},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.partnerId != null">
partner_id = #{record.partnerId},
</if>
<if test="record.fieldCopy != null">
field_copy = #{record.fieldCopy},
</if>
</set>
where id = #{record.id}
</update>
<select id="selectByPartnerLineIdAndOperateType" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
from hy_partner_task_info_log
where partner_line_id = #{partnerLineId}
and operate_type = #{operateType} and deleted = '0'
order by create_time desc
</select>
<update id="updateLineId">
update hy_partner_task_info_log
set partner_line_id = #{newLineId} , partner_id = #{newPartnerId}
where partner_line_id = #{oldLineId}
</update>
<select id="getLogPageByLineId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/>
from
hy_partner_task_info_log
where
deleted = '0' and partner_line_id= #{partnerLineId} and operate_type in <foreach collection="operateTypes" open="(" close=")" separator="," item="operateType">#{operateType}</foreach>
order by create_time desc
</select>
<update id="deleteByLineId">
update hy_partner_task_info_log set deleted = '1', message = #{message} where partner_line_id= #{partnerLineId}
</update>
<select id="getLastTipsLog" resultType="com.cool.store.entity.HyPartnerTaskInfoLogDO">
SELECT <include refid="Base_Column_List"></include>, <include refid="Blob_Column_List"></include>
FROM `hy_partner_task_info_log`
WHERE deleted = 0
AND partner_line_id = #{lineId}
AND operate_type IN (
'interview_appointment',
'interview_appointment_agreement',
'auto_open_interview',
'interviewer_book_interview',
'modify_interview_time',
'finish_interview',
'create_qualifyverify',
'exhibition_create_qualifyverify'
)
ORDER BY create_time DESC
</select>
</mapper>