商品单位-仓库管理
This commit is contained in:
parent
0b183be6d5
commit
b8c05fb4cf
|
|
@ -27,6 +27,8 @@ public class SupermarketMaterial extends BaseEntity {
|
|||
@ApiModelProperty(value = "区域id")
|
||||
private Long areaId;
|
||||
|
||||
private String areaName;
|
||||
|
||||
/** 原料名称 */
|
||||
@Excel(name = "原料名称")
|
||||
@ApiModelProperty(value = "原料名称")
|
||||
|
|
@ -47,6 +49,8 @@ public class SupermarketMaterial extends BaseEntity {
|
|||
@ApiModelProperty(value = "类别id")
|
||||
private Long materialTypeId;
|
||||
|
||||
private String materialTypeName;
|
||||
|
||||
/** 类别ids */
|
||||
@Excel(name = "类别ids")
|
||||
@ApiModelProperty(value = "类别ids")
|
||||
|
|
@ -62,6 +66,8 @@ public class SupermarketMaterial extends BaseEntity {
|
|||
@ApiModelProperty(value = "单位")
|
||||
private Long unitId;
|
||||
|
||||
private String unitName;
|
||||
|
||||
/** 销售价 */
|
||||
@Excel(name = "销售价")
|
||||
@ApiModelProperty(value = "销售价")
|
||||
|
|
|
|||
|
|
@ -6,12 +6,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="com.bonus.canteen.core.supermarket.domain.SupermarketMaterial" id="SupermarketMaterialResult">
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="areaId" column="area_id" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="imgUrl" column="img_url" />
|
||||
<result property="materialTypeId" column="material_type_id" />
|
||||
<result property="materialTypeName" column="material_type_name" />
|
||||
<result property="barCode" column="bar_code" />
|
||||
<result property="unitId" column="unit_id" />
|
||||
<result property="unitName" column="unit_name" />
|
||||
<result property="salePrice" column="sale_price" />
|
||||
<result property="unitPrice" column="unit_price" />
|
||||
<result property="salesMode" column="sales_mode" />
|
||||
|
|
@ -28,43 +31,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectSupermarketMaterialVo">
|
||||
select material_id, area_id, material_name, material_code, img_url, material_type_id,
|
||||
bar_code, unit_id, sale_price, unit_price, sales_mode, shelf_life_type,
|
||||
shelf_life_days, pur_price_ceiling, big_category_id, `size`, description,
|
||||
create_by, create_time, update_by, update_time
|
||||
from supermarket_material
|
||||
select sm.material_id, sm.area_id, sm.material_name, sm.material_code, sm.img_url, sm.material_type_id,
|
||||
sm.bar_code, sm.unit_id, sm.sale_price, sm.unit_price, sm.sales_mode, sm.shelf_life_type,
|
||||
sm.shelf_life_days, sm.pur_price_ceiling, sm.big_category_id, sm.`size`, sm.description,
|
||||
sm.create_by, sm.create_time, sm.update_by, sm.update_time,
|
||||
ba.area_name, smt.material_type_name, spu.unit_name
|
||||
from supermarket_material sm
|
||||
left join basic_area ba on ba.area_id = sm.area_id
|
||||
left join supermarket_material_type smt on smt.material_type_id = sm.material_type_id
|
||||
left join supply_product_unit spu on spu.unit_id = sm.unit_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSupermarketMaterialList" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketMaterial" resultMap="SupermarketMaterialResult">
|
||||
<include refid="selectSupermarketMaterialVo"/>
|
||||
<where>
|
||||
<if test="areaId != null "> and area_id = #{areaId}</if>
|
||||
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
||||
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
||||
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
|
||||
<if test="areaId != null "> and sm.area_id = #{areaId}</if>
|
||||
<if test="materialName != null and materialName != ''"> and sm.material_name like concat('%', #{materialName}, '%')</if>
|
||||
<if test="materialCode != null and materialCode != ''"> and sm.material_code = #{materialCode}</if>
|
||||
<if test="imgUrl != null and imgUrl != ''"> and sm.img_url = #{imgUrl}</if>
|
||||
<if test="materialTypeIds != null and materialTypeIds.length > 0">
|
||||
and material_type_id in
|
||||
and sm.material_type_id in
|
||||
<foreach collection="materialTypeIds" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="barCode != null and barCode != ''"> and bar_code = #{barCode}</if>
|
||||
<if test="unitId != null "> and unit_id = #{unitId}</if>
|
||||
<if test="salePrice != null "> and sale_price = #{salePrice}</if>
|
||||
<if test="unitPrice != null "> and unit_price = #{unitPrice}</if>
|
||||
<if test="salesMode != null "> and sales_mode = #{salesMode}</if>
|
||||
<if test="shelfLifeType != null "> and shelf_life_type = #{shelfLifeType}</if>
|
||||
<if test="shelfLifeDays != null "> and shelf_life_days = #{shelfLifeDays}</if>
|
||||
<if test="purPriceCeiling != null "> and pur_price_ceiling = #{purPriceCeiling}</if>
|
||||
<if test="bigCategoryId != null "> and big_category_id = #{bigCategoryId}</if>
|
||||
<if test="size != null and size != ''"> and size = #{size}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="barCode != null and barCode != ''"> and sm.bar_code = #{barCode}</if>
|
||||
<if test="unitId != null "> and sm.unit_id = #{unitId}</if>
|
||||
<if test="salePrice != null "> and sm.sale_price = #{salePrice}</if>
|
||||
<if test="unitPrice != null "> and sm.unit_price = #{unitPrice}</if>
|
||||
<if test="salesMode != null "> and sm.sales_mode = #{salesMode}</if>
|
||||
<if test="shelfLifeType != null "> and sm.shelf_life_type = #{shelfLifeType}</if>
|
||||
<if test="shelfLifeDays != null "> and sm.shelf_life_days = #{shelfLifeDays}</if>
|
||||
<if test="purPriceCeiling != null "> and sm.pur_price_ceiling = #{purPriceCeiling}</if>
|
||||
<if test="bigCategoryId != null "> and sm.big_category_id = #{bigCategoryId}</if>
|
||||
<if test="size != null and size != ''"> and sm.`size` = #{size}</if>
|
||||
<if test="description != null and description != ''"> and sm.description = #{description}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSupermarketMaterialByMaterialId" parameterType="Long" resultMap="SupermarketMaterialResult">
|
||||
<include refid="selectSupermarketMaterialVo"/>
|
||||
where material_id = #{materialId}
|
||||
where sm.material_id = #{materialId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSupermarketMaterial" parameterType="com.bonus.canteen.core.supermarket.domain.SupermarketMaterial" useGeneratedKeys="true" keyProperty="materialId">
|
||||
|
|
|
|||
Loading…
Reference in New Issue