菜品收藏优化
This commit is contained in:
parent
c53ef6bbbe
commit
091e6cc46b
|
|
@ -1,11 +1,14 @@
|
||||||
package com.bonus.canteen.core.menu.domain;
|
package com.bonus.canteen.core.menu.domain;
|
||||||
|
|
||||||
|
import com.bonus.canteen.core.common.utils.FileUrlUtil;
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜品收藏对象 menu_collection_dishes
|
* 菜品收藏对象 menu_collection_dishes
|
||||||
*
|
*
|
||||||
|
|
@ -37,6 +40,12 @@ public class MenuCollectionDishes extends BaseEntity {
|
||||||
@ApiModelProperty(value = "菜品id")
|
@ApiModelProperty(value = "菜品id")
|
||||||
private Long dishesId;
|
private Long dishesId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "菜品名称")
|
||||||
|
private String dishesName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片地址")
|
||||||
|
private String imageUrl;
|
||||||
|
|
||||||
/** 乐观锁 */
|
/** 乐观锁 */
|
||||||
@Excel(name = "乐观锁")
|
@Excel(name = "乐观锁")
|
||||||
@ApiModelProperty(value = "乐观锁")
|
@ApiModelProperty(value = "乐观锁")
|
||||||
|
|
@ -45,5 +54,13 @@ public class MenuCollectionDishes extends BaseEntity {
|
||||||
/** 删除标识(0:正常 2:删除) */
|
/** 删除标识(0:正常 2:删除) */
|
||||||
private Long delFlag;
|
private Long delFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "售出数量")
|
||||||
|
private Integer saleNum;
|
||||||
|
|
||||||
|
public String getImageUrl() {
|
||||||
|
return FileUrlUtil.getFileUrl(this.imageUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,25 +14,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="dishesName" column="dishes_name" />
|
||||||
|
<result property="imageUrl" column="image_url" />
|
||||||
|
<result property="price" column="price" />
|
||||||
|
<result property="saleNum" column="sale_num" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectMenuCollectionDishesVo">
|
<sql id="selectMenuCollectionDishesVo">
|
||||||
select id, user_id, shopstall_id, dishes_id, revision, del_flag, create_by, create_time, update_by, update_time from menu_collection_dishes
|
select mcd.id, mcd.user_id, mcd.shopstall_id, mcd.dishes_id, mcd.revision, mcd.del_flag, mcd.create_by,
|
||||||
|
mcd.create_time, mcd.update_by, mcd.update_time, md.dishes_name, md.image_url, md.price, mdsr.sale_num
|
||||||
|
from menu_collection_dishes mcd
|
||||||
|
left join menu_dishes md on md.dishes_id = mcd.dishes_id
|
||||||
|
left join menu_dishes_sale_record mdsr on mcd.dishes_id = mdsr.dishes_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectMenuCollectionDishesList" parameterType="com.bonus.canteen.core.menu.domain.MenuCollectionDishes" resultMap="MenuCollectionDishesResult">
|
<select id="selectMenuCollectionDishesList" parameterType="com.bonus.canteen.core.menu.domain.MenuCollectionDishes" resultMap="MenuCollectionDishesResult">
|
||||||
<include refid="selectMenuCollectionDishesVo"/>
|
<include refid="selectMenuCollectionDishesVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="userId != null "> and user_id = #{userId}</if>
|
<if test="userId != null "> and mcd.user_id = #{userId}</if>
|
||||||
<if test="shopstallId != null "> and shopstall_id = #{shopstallId}</if>
|
<if test="shopstallId != null "> and mcd.shopstall_id = #{shopstallId}</if>
|
||||||
<if test="dishesId != null "> and dishes_id = #{dishesId}</if>
|
<if test="dishesId != null "> and mcd.dishes_id = #{dishesId}</if>
|
||||||
<if test="revision != null "> and revision = #{revision}</if>
|
<if test="revision != null "> and mcd.revision = #{revision}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectMenuCollectionDishesById" parameterType="Long" resultMap="MenuCollectionDishesResult">
|
<select id="selectMenuCollectionDishesById" parameterType="Long" resultMap="MenuCollectionDishesResult">
|
||||||
<include refid="selectMenuCollectionDishesVo"/>
|
<include refid="selectMenuCollectionDishesVo"/>
|
||||||
where id = #{id}
|
where mcd.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertMenuCollectionDishes" parameterType="com.bonus.canteen.core.menu.domain.MenuCollectionDishes" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertMenuCollectionDishes" parameterType="com.bonus.canteen.core.menu.domain.MenuCollectionDishes" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue