Files
zxjp-web/coolstore-partner-dao/src/main/resources/mapper/OpeningOperationPlanMapper.xml
2024-04-28 11:43:36 +08:00

78 lines
3.9 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.OpeningOperationPlanMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.OpeningOperationPlanDO">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
<result column="plan_source" jdbcType="BIT" property="planSource" />
<result column="survey_result" jdbcType="VARCHAR" property="surveyResult" />
<result column="survey_result_url" jdbcType="VARCHAR" property="surveyResultUrl" />
<result column="activity_theme" jdbcType="VARCHAR" property="activityTheme" />
<result column="activity_theme_url" jdbcType="VARCHAR" property="activityThemeUrl" />
<result column="submission_time" jdbcType="TIMESTAMP" property="submissionTime" />
<result column="submitted_user_id" jdbcType="VARCHAR" property="submittedUserId" />
<result column="preparation_user_ids" jdbcType="VARCHAR" property="preparationUserIds" />
<result column="route_completed" jdbcType="TINYINT" property="routeCompleted" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="audit_id" jdbcType="BIGINT" property="auditId" />
<result column="result_type" jdbcType="TINYINT" property="resultType"/>
</resultMap>
<sql id="Base_Column_List">
id,shop_id,plan_source,survey_result,survey_result_url,activity_theme,activity_theme_url,
submission_time,submitted_user_id,preparation_user_ids,route_completed,create_time,
update_time,create_user_id,update_user_id,deleted,audit_id,result_type
</sql>
<update id="updateByShopId">
update xfsg_opening_operation_plan
set audit_id = #{auditId},result_type = #{resultType}
where shop_id = #{shopId}
</update>
<select id="selectByShopId" resultType="com.cool.store.entity.OpeningOperationPlanDO">
select
<include refid="Base_Column_List"/>
from
xfsg_opening_operation_plan
where shop_id = #{shopId}
and
deleted = 0
</select>
<select id="getOpenPlanShopListByCondition"
resultType="com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO">
select si.id as shopId, si.region_id AS regionId,si.line_id as lineId, si.shop_name as shopName,
si.shop_code as shopCode, si.shop_manager_user_id as shopManagerUserId,li.investment_manager AS investmentManagerId,
li.username as partnerName, li.mobile as mobile ,
op.submission_time AS submissionTime , op.result_type AS resultType
from xfsg_opening_operation_plan op
join xfsg_shop_info si on si.id = op.shop_id
join xfsg_line_info li on si.line_id = li.id
where 1=1
<if test="request.shopName != null and request.shopName != '' ">
AND si.shop_name like concat('%', #{request.shopName}, '%')
</if>
<if test="request.resultType != null and request.resultType != ''">
AND op.result_type = #{request.resultType}
</if>
<if test="request.planStartDate != null and request.planStartDate != ''">
and op.create_time >= #{request.planStartDate}
</if>
<if test="request.planEndDate != null and request.planEndDate != ''">
AND op.create_time &lt;= #{request.planEndDate}
</if>
<if test="request.regionIds != null and request.regionIds.size() > 0">
and si.region_id in
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
</select>
</mapper>