Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner

# Conflicts:
#	coolstore-partner-webb/src/main/java/com/cool/store/controller/TestController.java
This commit is contained in:
zhangchenbiao
2023-06-08 15:57:58 +08:00
12 changed files with 585 additions and 20 deletions

View File

@@ -18,7 +18,7 @@
id, parent_id, area_name, area_path, background_banner, detail_banner, area_status,
deleted, create_time, update_time, update_user_id
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
<insert id="insertSelective" parameterType="com.cool.store.entity.HyOpenAreaInfoDO" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_open_area_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.parentId != null">
@@ -121,4 +121,62 @@
</set>
where id = #{record.id}
</update>
<select id="queryKeyOpenArea" resultMap="BaseResultMap">
select * from
hy_open_area_info
where area_status = 'keyOpen'
</select>
<select id="queryByKeyword" resultMap="BaseResultMap">
select * from
hy_open_area_info
where area_path like concat('%',#{keyword},'%')
</select>
<select id="queryFirstLevel" resultMap="BaseResultMap">
select * from
hy_open_area_info where parent_id is null
</select>
<select id="queryByIdsExcludeFirstLevel" resultMap="BaseResultMap">
select * from
hy_open_area_info where parent_id is not null
<if test="ids !=null and ids.size>0">
<foreach collection="ids" item="id" open="and id in (" close=")" separator=",">
#{id}
</foreach>
</if>
</select>
<select id="getApplyReservationProvinceCount" resultType="com.cool.store.dto.partner.ApplyReservationProvinceDTO">
SELECT
substring(SUBSTRING_INDEX(area_path,'/',2),2) as areaName,
sum(if((area_status='open' or area_status = 'keyOpen') ,1,0)) as applyCount,
sum(if((area_status='notOpen' or area_status = 'saturated') ,1,0)) as reservationCount
FROM `hy_open_area_info` where parent_id is not null
group by substring(SUBSTRING_INDEX(area_path,'/',2),2)
</select>
<select id="getChildrenList" resultMap="BaseResultMap">
select * from
hy_open_area_info
<where>
<if test="parentId!=null">
and parent_id = #{parentId}
</if>
<if test="type!=null and type == 'apply'">
and (area_status = 'open' or area_status = 'keyOpen')
</if>
<if test="type!=null and type == 'reservation'">
and (area_status='notOpen' or area_status = 'saturated')
</if>
</where>
</select>
</mapper>