!291 食谱计划生成优化

Merge pull request !291 from 德仔/xzj
This commit is contained in:
德仔
2021-06-23 03:28:21 +00:00
committed by Gitee
12 changed files with 136 additions and 48 deletions

View File

@ -173,4 +173,14 @@
update sys_nutritional_video set play_num = play_num + 1 where video_id = #{videoId} and del_flag = 0
</update>
<!-- 根据视频分类ID查询该分类下视频总量 -->
<select id="getVideoCountByCateId" parameterType="Long" resultType="int">
select count(snv.id) from sys_nutritional_video snv where snv.del_flag = 0
and snv.cate_id in (
select id from sys_video_classify where del_flag = 0
and (id = #{cateId} or id in (select s.id from sys_video_classify s where s.parent_id = #{cateId} and s.del_flag = 0)
or id in (select ss.id from sys_video_classify ss where ss.del_flag = 0 and ss.parent_id in (select a.id from sys_video_classify a where a.parent_id = #{cateId} and a.del_flag = 0 )))
)
</select>
</mapper>

View File

@ -113,6 +113,7 @@
<if test="status != null ">and status = #{status}</if>
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
<if test="pushPreSaleId != null ">and push_pre_sale_id = #{pushPreSaleId}</if>
<if test="onSaleId != null">
and on_sale_id = #{onSaleId}
</if>
@ -167,6 +168,7 @@
<if test="phone != null and phone != ''">and sc.phone = #{phone}</if>
<if test="status != null ">and status = #{status}</if>
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
<if test="pushPreSaleId != null ">and push_pre_sale_id = #{pushPreSaleId}</if>
<if test="onSaleId != null">
and on_sale_id = #{onSaleId}
</if>

View File

@ -159,4 +159,11 @@
order by priority_level asc
</select>
<!-- 根据分类ID查询该分类ID以及分类下的子类ID -->
<select id="getVideoClassifyIdsById" parameterType="Long" resultType="Long">
select id from sys_video_classify where del_flag = 0
and (id = #{id} or id in (select s.id from sys_video_classify s where s.parent_id = #{id} and s.del_flag = 0)
or id in (select ss.id from sys_video_classify ss where ss.del_flag = 0 and ss.parent_id in (select a.id from sys_video_classify a where a.parent_id = #{id} and a.del_flag = 0 )))
</select>
</mapper>