feat:每日菜单添加排序字段

This commit is contained in:
dzc committed 2025-05-09 15:12:49 +08:00
1 parent 68abae25e8
commit fcdc343247
2 files changed
+37 -31

No files matched your search

@@ -39,4 +39,9 @@ public class ADCanteenDailyMenuListVO {
* 时间类型
*/
private Integer hourType;
/**
* 排序
*/
private Integer sort;
}
@@ -2,8 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bsd.pjcloud.canteen.mapper.CanteenDailyMenuMapper">
<resultMap id="canteenDailyMenuMap" type="com.bsd.pjcloud.canteen.entity.CanteenDailyMenuEntity">
<resultMap id="canteenDailyMenuMap" type="com.bsd.pjcloud.canteen.entity.CanteenDailyMenuEntity">
<id property="id" column="id"/>
<result property="startTime" column="start_time"/>
<result property="spuId" column="spu_id"/>
@@ -16,7 +15,7 @@
<result property="updateTime" column="update_time"/>
<result property="delFlag" column="del_flag"/>
<result property="tenantId" column="tenant_id"/>
</resultMap>
</resultMap>
<resultMap id="adCanteenDailyMenuListVO" type="com.bsd.pjcloud.canteen.vo.ADCanteenDailyMenuListVO">
<id property="id" column="id"/>
@@ -27,28 +26,29 @@
<result property="categoryId" column="category_id"/>
<result property="picUrl" column="pic_url"/>
<result property="stock" column="stock"/>
<result property="sort" column="sort"/>
<result property="hourType" column="hour_type"/>
</resultMap>
<select id="selectTimeFood" resultType="com.bsd.pjcloud.canteen.vo.DailyMenuVO">
SELECT
DISTINCT(sp.id),
t.id as tid,
sp.name,
sp.pic_url,
t.hour_type,
sp.price,
sp.category_id
t.id as tid,
sp.name,
sp.pic_url,
t.hour_type,
sp.price,
sp.category_id
FROM canteen_daily_menu t
LEFT JOIN canteen_spu sp
on t.spu_id=sp.id
<where>
AND t.merchant_id = #{merchantId}
<if test="categoryId != null">
AND sp.category_id = #{categoryId}
</if>
AND sp.del_flag = 0
AND t.start_time = #{time}
And t.del_flag = 0
AND t.merchant_id = #{merchantId}
<if test="categoryId != null">
AND sp.category_id = #{categoryId}
</if>
AND sp.del_flag = 0
AND t.start_time = #{time}
And t.del_flag = 0
</where>
order by sp.sort asc
</select>
@@ -62,6 +62,7 @@
sp.price,
sp.stock,
sp.category_id,
sp.sort,
t.dept_id,
t.create_by
FROM canteen_daily_menu t
@@ -83,22 +84,23 @@
</if>
</where>
</select>
<select id="selectTimeFoodPage" resultType="com.bsd.pjcloud.canteen.vo.app.DailyMenuAppVO" parameterType="com.bsd.pjcloud.canteen.dto.app.DailyMenuDTO">
<select id="selectTimeFoodPage" resultType="com.bsd.pjcloud.canteen.vo.app.DailyMenuAppVO"
parameterType="com.bsd.pjcloud.canteen.dto.app.DailyMenuDTO">
SELECT m.id,
m.hour_type,
s.id as spu_id,
s.`name`,
s.price,
s.stock,
s.pic_url,
s.sort,
s.is_show,
c.id as category_id
m.hour_type,
s.id as spu_id,
s.`name`,
s.price,
s.stock,
s.pic_url,
s.sort,
s.is_show,
c.id as category_id
FROM `canteen_daily_menu` m
left JOIN canteen_spu s
on m.spu_id = s.id
LEFT JOIN canteen_category c
on s.category_id = c.id
left JOIN canteen_spu s
on m.spu_id = s.id
LEFT JOIN canteen_category c
on s.category_id = c.id
<where>
m.del_flag = 0 and s.del_flag = 0 and m.merchant_id = #{dailyMenuDTO.merchantId} and s.is_show = 0
<if test="dailyMenuDTO.startTime != null">
@@ -112,6 +114,5 @@
</if>
</where>
order by s.sort asc
</select>
</mapper>