Files
zxjp-web/coolstore-partner-dao/src/main/resources/mapper/AcceptanceInfoMapper.xml
shuo.wang 1776f3a262 fix
2025-07-25 14:07:20 +08:00

169 lines
9.0 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.AcceptanceInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.AcceptanceInfoDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
<result column="actual_entry_time" jdbcType="TIMESTAMP" property="actualEntryTime"/>
<result column="planned_completion_time" jdbcType="TIMESTAMP" property="plannedCompletionTime"/>
<result column="planned_start_time" jdbcType="TIMESTAMP" property="plannedStartTime"/>
<result column="decoration_planned_completion_time" jdbcType="TIMESTAMP"
property="decorationPlannedCompletionTime"/>
<result column="decoration_planned_start_time" jdbcType="TIMESTAMP" property="decorationPlannedStartTime"/>
<result column="construction_completion_time" jdbcType="TIMESTAMP" property="constructionCompletionTime"/>
<result column="engineering_acceptance_signatures" jdbcType="VARCHAR"
property="engineeringAcceptanceSignatures"/>
<result column="operations_acceptance_signatures" jdbcType="VARCHAR" property="operationsAcceptanceSignatures"/>
<result column="partner_acceptance_signatures" jdbcType="VARCHAR" property="partnerAcceptanceSignatures"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="deleted" jdbcType="BIT" property="deleted"/>
<result column="plan_acceptance_time" jdbcType="TIMESTAMP" property="planAcceptanceTime"/>
<result column="actual_acceptance_time" jdbcType="TIMESTAMP" property="actualAcceptanceTime"/>
<result column="booking_user" jdbcType="VARCHAR" property="bookingUser"/>
<result column="plan_exit_time" jdbcType="TIMESTAMP" property="planExitTime"/>
<result column="ks_account" jdbcType="VARCHAR" property="ksAccount"/>
<result column="verification_mobile" jdbcType="VARCHAR" property="verificationMobile"/>
<result column="shop_location_screenshots" jdbcType="VARCHAR" property="shopLocationScreenshots"/>
<result column="shop_doorway_photo" jdbcType="VARCHAR" property="shopDoorwayPhoto"/>
<result column="shop_interior_photo" jdbcType="VARCHAR" property="shopInteriorPhoto"/>
<result column="satisfaction" jdbcType="INTEGER" property="satisfaction"/>
<result column="acceptance_attachment" jdbcType="VARCHAR" property="acceptanceAttachment"/>
<result column="is_network_cable" jdbcType="BIT" property="isNetworkCable"/>
<result column="back_kitchen_photo" jdbcType="VARCHAR" property="backKitchenPhoto"/>
<result column="add_reduce_amount" jdbcType="DECIMAL" property="addReduceAmount"/>
<result column="delivery_order_id" jdbcType="VARCHAR" property="deliveryOrderId"/>
</resultMap>
<sql id="baseColumn">
id
,shop_id,actual_entry_time,planned_completion_time,planned_start_time,decoration_planned_completion_time,
decoration_planned_start_time,construction_completion_time,engineering_acceptance_signatures,
operations_acceptance_signatures,partner_acceptance_signatures,
create_time,update_time,deleted,plan_acceptance_time,actual_acceptance_time,booking_user,plan_exit_time,
ks_account,verification_mobile,shop_location_screenshots,shop_doorway_photo,shop_interior_photo,
satisfaction,acceptance_attachment,is_network_cable,back_kitchen_photo,add_reduce_amount,delivery_order_id
</sql>
<insert id="initAcceptanceInfo">
<foreach collection="list" index="index" item="item" separator=";">
insert into xfsg_acceptance_info (shop_id,create_time,update_time,deleted)
values (#{item},now(),now(),0)
</foreach>
</insert>
<update id="updateByShopIDSelective">
update xfsg_acceptance_info
<set>
<if test="actualEntryTime != null">
actual_entry_time = #{actualEntryTime} ,
</if>
<if test="plannedCompletionTime != null">
planned_completion_time = #{plannedCompletionTime} ,
</if>
<if test="plannedStartTime != null">
planned_start_time = #{plannedStartTime} ,
</if>
<if test="decorationPlannedCompletionTime != null">
decoration_planned_completion_time = #{decorationPlannedCompletionTime} ,
</if>
<if test="decorationPlannedStartTime != null">
decoration_planned_start_time = #{decorationPlannedStartTime} ,
</if>
<if test="constructionCompletionTime != null">
construction_completion_time = #{constructionCompletionTime} ,
</if>
<if test="engineeringAcceptanceSignatures != null">
engineering_acceptance_signatures = #{engineeringAcceptanceSignatures} ,
</if>
<if test="operationsAcceptanceSignatures != null">
operations_acceptance_signatures = #{operationsAcceptanceSignatures} ,
</if>
<if test="partnerAcceptanceSignatures != null">
partner_acceptance_signatures = #{partnerAcceptanceSignatures} ,
</if>
<if test="updateTime != null">
update_time = #{updateTime} ,
</if>
<if test="deleted != null">
deleted = #{deleted} ,
</if>
<if test="planAcceptanceTime !=null ">
plan_acceptance_time =#{planAcceptanceTime},
</if>
<if test="actualAcceptanceTime !=null ">
actual_acceptance_time =#{actualAcceptanceTime},
</if>
<if test="bookingUser !=null ">
booking_user =#{bookingUser},
</if>
<if test="planExitTime !=null">
plan_exit_time =#{planExitTime},
</if>
<if test="ksAccount !=null">
ks_account =#{ksAccount},
</if>
<if test="verificationMobile !=null">
verification_mobile =#{verificationMobile},
</if>
<if test="shopLocationScreenshots !=null">
shop_location_screenshots =#{shopLocationScreenshots},
</if>
<if test="shopDoorwayPhoto !=null">
shop_doorway_photo =#{shopDoorwayPhoto},
</if>
<if test="shopInteriorPhoto !=null">
shop_interior_photo =#{shopInteriorPhoto},
</if>
<if test="satisfaction !=null">
satisfaction = #{satisfaction},
</if>
<if test="isNetworkCable !=null">
is_network_cable = #{isNetworkCable},
</if>
<if test="acceptanceAttachment!=null and acceptanceAttachment!= ''">
acceptance_attachment = #{acceptanceAttachment},
</if>
<if test="backKitchenPhoto !=null and backKitchenPhoto!=''">
back_kitchen_photo = #{backKitchenPhoto}
</if>
</set>
where shop_id = #{shopId}
</update>
<select id="selectShopIdListBySignatures" resultType="com.cool.store.entity.AcceptanceInfoDO">
select
a.shop_id as shopId ,a.actual_entry_time as actualEntry_time,a.plan_exit_time as planExitTime, a.decoration_planned_completion_time as decorationPlannedCompletionTime,
a.plan_acceptance_time as planAcceptanceTime
from xfsg_acceptance_info a
left join xfsg_shop_stage_info b on a.shop_id = b.shop_id
where b.shop_sub_stage=#{subStage} and b.shop_sub_stage_status = #{status}
and a.deleted = 0 and a.actual_entry_time is not null
</select>
<select id="selectByShopId" resultType="com.cool.store.entity.AcceptanceInfoDO">
select
<include refid="baseColumn"/>
from xfsg_acceptance_info
where shop_id = #{shopId} and deleted = 0
</select>
<select id="selectByEntryTimeNull" resultType="com.cool.store.entity.AcceptanceInfoDO">
select
<include refid="baseColumn"/>
from xfsg_acceptance_info
where actual_entry_time is null
</select>
<select id="selectByShopIds" resultType="com.cool.store.entity.AcceptanceInfoDO">
select
<include refid="baseColumn"/>
from xfsg_acceptance_info
where deleted = 0
<if test="shopIds != null and shopIds.size()>0">
and shop_id in
<foreach collection="shopIds" item="shopId" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
</select>
<select id="selectListNotNullEntryTime" resultType="com.cool.store.entity.AcceptanceInfoDO">
select *
from xfsg_acceptance_info
where actual_entry_time is not null
</select>
</mapper>