查询原料绑定供应商列表
This commit is contained in:
parent
521f3873d1
commit
5244e44638
|
|
@ -29,6 +29,10 @@ public class SupplierBindMaterial extends BaseEntity {
|
|||
@ApiModelProperty(value = "食堂id")
|
||||
private Long canteenId;
|
||||
|
||||
private String canteenName;
|
||||
|
||||
private String areaName;
|
||||
|
||||
/** 供应商ID */
|
||||
@Excel(name = "供应商ID")
|
||||
@ApiModelProperty(value = "供应商ID")
|
||||
|
|
@ -57,5 +61,27 @@ public class SupplierBindMaterial extends BaseEntity {
|
|||
@ApiModelProperty(value = "是否供应(1-是,2-否)")
|
||||
private Long ifSupply;
|
||||
|
||||
/** 原料名称 */
|
||||
@Excel(name = "原料名称")
|
||||
@ApiModelProperty(value = "原料名称")
|
||||
private String materialName;
|
||||
|
||||
/** 原料编码 */
|
||||
@Excel(name = "原料编码")
|
||||
@ApiModelProperty(value = "原料编码")
|
||||
private String materialCode;
|
||||
|
||||
/** 规格 */
|
||||
@ApiModelProperty(value = "规格")
|
||||
private String size;
|
||||
|
||||
@Excel(name = "类别名称")
|
||||
@ApiModelProperty(value = "类别名称")
|
||||
private String materialTypeName;
|
||||
|
||||
/** 供应商名称 */
|
||||
@Excel(name = "供应商名称")
|
||||
@ApiModelProperty(value = "供应商名称")
|
||||
private String supplierName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="com.bonus.canteen.core.ims.domain.SupplierBindMaterial" id="SupplierBindMaterialResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="canteenId" column="canteen_id" />
|
||||
<result property="canteenName" column="canteen_name" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="supplierId" column="supplier_id" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="categoryId" column="category_id" />
|
||||
<result property="alternativeSupplier" column="alternative_supplier" />
|
||||
<result property="ifSupply" column="if_supply" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="size" column="size" />
|
||||
<result property="materialTypeName" column="material_type_name" />
|
||||
<result property="supplierName" column="supplier_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
|
|
@ -18,24 +25,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectSupplierBindMaterialVo">
|
||||
select id, canteen_id, supplier_id, material_id, category_id, alternative_supplier, if_supply, create_by, create_time, update_by, update_time from ims_supplier_bind_material
|
||||
select isbm.id, isbm.canteen_id, isbm.supplier_id, isbm.material_id, isbm.category_id, isbm.alternative_supplier,
|
||||
isbm.if_supply, isbm.create_by, isbm.create_time, isbm.update_by, isbm.update_time, bc.canteen_name,
|
||||
ba.area_name, cm.material_code, cm.material_name, cm.size, cmt.material_type_name, isu.supplier_name
|
||||
from ims_supplier_bind_material isbm
|
||||
left join cook_material cm on cm.material_id = isbm.material_id
|
||||
left join cook_material_type cmt on cmt.material_type_id = cm.material_type_id
|
||||
left join ims_supplier isu on isu.supplier_id = isbm.supplier_id
|
||||
left join basic_canteen bc on bc.canteen_id = isbm.canteen_id
|
||||
left join basic_area ba on ba.area_id = bc.area_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSupplierBindMaterialList" parameterType="com.bonus.canteen.core.ims.domain.SupplierBindMaterial" resultMap="SupplierBindMaterialResult">
|
||||
<include refid="selectSupplierBindMaterialVo"/>
|
||||
<where>
|
||||
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
|
||||
<if test="supplierId != null "> and supplier_id = #{supplierId}</if>
|
||||
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||
<if test="categoryId != null "> and category_id = #{categoryId}</if>
|
||||
<if test="alternativeSupplier != null and alternativeSupplier != ''"> and alternative_supplier = #{alternativeSupplier}</if>
|
||||
<if test="ifSupply != null "> and if_supply = #{ifSupply}</if>
|
||||
<if test="canteenId != null "> and isbm.canteen_id = #{canteenId}</if>
|
||||
<if test="supplierId != null "> and isbm.supplier_id = #{supplierId}</if>
|
||||
<if test="materialId != null "> and isbm.material_id = #{materialId}</if>
|
||||
<if test="categoryId != null "> and isbm.category_id = #{categoryId}</if>
|
||||
<if test="alternativeSupplier != null and alternativeSupplier != ''"> and isbm.alternative_supplier = #{alternativeSupplier}</if>
|
||||
<if test="ifSupply != null "> and isbm.if_supply = #{ifSupply}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSupplierBindMaterialById" parameterType="Long" resultMap="SupplierBindMaterialResult">
|
||||
<include refid="selectSupplierBindMaterialVo"/>
|
||||
where id = #{id}
|
||||
where isbm.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSupplierBindMaterial" parameterType="com.bonus.canteen.core.ims.domain.SupplierBindMaterial" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
|
|||
Loading…
Reference in New Issue