feat:每日菜单添加排序字段
This commit is contained in:
1 parent
68abae25e8
commit
fcdc343247
2 files changed
+37
-31
No files matched your search
+5
@@ -39,4 +39,9 @@ public class ADCanteenDailyMenuListVO {
|
|||||||
* 时间类型
|
* 时间类型
|
||||||
*/
|
*/
|
||||||
private Integer hourType;
|
private Integer hourType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
}
|
}
|
||||||
+32
-31
@@ -2,8 +2,7 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!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">
|
<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"/>
|
<id property="id" column="id"/>
|
||||||
<result property="startTime" column="start_time"/>
|
<result property="startTime" column="start_time"/>
|
||||||
<result property="spuId" column="spu_id"/>
|
<result property="spuId" column="spu_id"/>
|
||||||
@@ -16,7 +15,7 @@
|
|||||||
<result property="updateTime" column="update_time"/>
|
<result property="updateTime" column="update_time"/>
|
||||||
<result property="delFlag" column="del_flag"/>
|
<result property="delFlag" column="del_flag"/>
|
||||||
<result property="tenantId" column="tenant_id"/>
|
<result property="tenantId" column="tenant_id"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="adCanteenDailyMenuListVO" type="com.bsd.pjcloud.canteen.vo.ADCanteenDailyMenuListVO">
|
<resultMap id="adCanteenDailyMenuListVO" type="com.bsd.pjcloud.canteen.vo.ADCanteenDailyMenuListVO">
|
||||||
<id property="id" column="id"/>
|
<id property="id" column="id"/>
|
||||||
@@ -27,28 +26,29 @@
|
|||||||
<result property="categoryId" column="category_id"/>
|
<result property="categoryId" column="category_id"/>
|
||||||
<result property="picUrl" column="pic_url"/>
|
<result property="picUrl" column="pic_url"/>
|
||||||
<result property="stock" column="stock"/>
|
<result property="stock" column="stock"/>
|
||||||
|
<result property="sort" column="sort"/>
|
||||||
<result property="hourType" column="hour_type"/>
|
<result property="hourType" column="hour_type"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="selectTimeFood" resultType="com.bsd.pjcloud.canteen.vo.DailyMenuVO">
|
<select id="selectTimeFood" resultType="com.bsd.pjcloud.canteen.vo.DailyMenuVO">
|
||||||
SELECT
|
SELECT
|
||||||
DISTINCT(sp.id),
|
DISTINCT(sp.id),
|
||||||
t.id as tid,
|
t.id as tid,
|
||||||
sp.name,
|
sp.name,
|
||||||
sp.pic_url,
|
sp.pic_url,
|
||||||
t.hour_type,
|
t.hour_type,
|
||||||
sp.price,
|
sp.price,
|
||||||
sp.category_id
|
sp.category_id
|
||||||
FROM canteen_daily_menu t
|
FROM canteen_daily_menu t
|
||||||
LEFT JOIN canteen_spu sp
|
LEFT JOIN canteen_spu sp
|
||||||
on t.spu_id=sp.id
|
on t.spu_id=sp.id
|
||||||
<where>
|
<where>
|
||||||
AND t.merchant_id = #{merchantId}
|
AND t.merchant_id = #{merchantId}
|
||||||
<if test="categoryId != null">
|
<if test="categoryId != null">
|
||||||
AND sp.category_id = #{categoryId}
|
AND sp.category_id = #{categoryId}
|
||||||
</if>
|
</if>
|
||||||
AND sp.del_flag = 0
|
AND sp.del_flag = 0
|
||||||
AND t.start_time = #{time}
|
AND t.start_time = #{time}
|
||||||
And t.del_flag = 0
|
And t.del_flag = 0
|
||||||
</where>
|
</where>
|
||||||
order by sp.sort asc
|
order by sp.sort asc
|
||||||
</select>
|
</select>
|
||||||
@@ -62,6 +62,7 @@
|
|||||||
sp.price,
|
sp.price,
|
||||||
sp.stock,
|
sp.stock,
|
||||||
sp.category_id,
|
sp.category_id,
|
||||||
|
sp.sort,
|
||||||
t.dept_id,
|
t.dept_id,
|
||||||
t.create_by
|
t.create_by
|
||||||
FROM canteen_daily_menu t
|
FROM canteen_daily_menu t
|
||||||
@@ -83,22 +84,23 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</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,
|
SELECT m.id,
|
||||||
m.hour_type,
|
m.hour_type,
|
||||||
s.id as spu_id,
|
s.id as spu_id,
|
||||||
s.`name`,
|
s.`name`,
|
||||||
s.price,
|
s.price,
|
||||||
s.stock,
|
s.stock,
|
||||||
s.pic_url,
|
s.pic_url,
|
||||||
s.sort,
|
s.sort,
|
||||||
s.is_show,
|
s.is_show,
|
||||||
c.id as category_id
|
c.id as category_id
|
||||||
FROM `canteen_daily_menu` m
|
FROM `canteen_daily_menu` m
|
||||||
left JOIN canteen_spu s
|
left JOIN canteen_spu s
|
||||||
on m.spu_id = s.id
|
on m.spu_id = s.id
|
||||||
LEFT JOIN canteen_category c
|
LEFT JOIN canteen_category c
|
||||||
on s.category_id = c.id
|
on s.category_id = c.id
|
||||||
<where>
|
<where>
|
||||||
m.del_flag = 0 and s.del_flag = 0 and m.merchant_id = #{dailyMenuDTO.merchantId} and s.is_show = 0
|
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">
|
<if test="dailyMenuDTO.startTime != null">
|
||||||
@@ -112,6 +114,5 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by s.sort asc
|
order by s.sort asc
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in new issue
Block a user