diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketProduct.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketProduct.java index 29dc834..2c0f6c5 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketProduct.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/supermarket/domain/SupermarketProduct.java @@ -1,6 +1,7 @@ package com.bonus.canteen.core.supermarket.domain; import java.math.BigDecimal; +import com.bonus.canteen.core.common.utils.FileUrlUtil; import com.bonus.common.core.annotation.Excel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -73,5 +74,11 @@ public class SupermarketProduct extends BaseEntity { @ApiModelProperty(value = "库存数") private BigDecimal inventoryNum; + private String materialName; + private String unitName; + + public String getImgUrl() { + return FileUrlUtil.getFileUrl(this.imgUrl); + } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml index 715925f..d3e28cd 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/supermarket/SupermarketProductMapper.xml @@ -19,38 +19,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + - select product_id, supermarket_id, material_id, putaway_state, if_online, sale_price, pref_price, - person_limit, one_day_limit, img_url, inventory_num, create_by, create_time, update_by, update_time - from supermarket_product + select sp.product_id, sp.supermarket_id, sp.material_id, sp.putaway_state, sp.if_online, sp.sale_price, + sp.pref_price, sp.person_limit, sp.one_day_limit, sp.img_url, sp.inventory_num, sp.create_by, + sp.create_time, sp.update_by, sp.update_time, sm.material_name, spu.unit_name + from supermarket_product sp + left join supermarket_material sm on sm.material_id = sp.material_id + left join supply_product_unit spu on spu.unit_id = sm.unit_id