Files
zxjp-web/coolstore-partner-dao/src/main/resources/mapper/OpeningOperationPlanMapper.xml
2024-04-25 20:03:27 +08:00

58 lines
3.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.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">
shop_id,plan_source,submitted_user_id,submission_time,survey_result,survey_result_url,activity_theme,activity_theme_url,preparation_user_ids,
route_completed,deleted,audit_id,result_type
</sql>
<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="selectPlanListByShopId" resultType="com.cool.store.dto.openPreparation.OpeningOperationPlanDTO">
SELECT op.shop_id AS shopId, op.update_time AS updateTime, op.result_type AS resultType
FROM xfsg_opening_operation_plan op
JOIN xfsg_shop_info si ON op.shop_id = si.id
where
<if test="openingOperationPlanDTO.planStartDate != null">
op.create_time >= #{openingOperationPlanDTO.planStartDate}
</if>
<if test="openingOperationPlanDTO.planEndDate != null">
<![CDATA[AND op.create_time <= #{openingOperationPlanDTO.planEndDate}]]>
</if>
<if test="openingOperationPlanDTO.resultType != null">
and op.result_type = #{openingOperationPlanDTO.resultType}
</if>
</select>
</mapper>