手持机搜索原料供应商
This commit is contained in:
parent
a2962159e5
commit
5dc4ba5602
|
|
@ -2,10 +2,9 @@ package com.bonus.canteen.core.drp.controller;
|
|||
|
||||
import com.bonus.canteen.core.drp.api.DrpAuthorityApi;
|
||||
import com.bonus.canteen.core.drp.dto.AndroidSearchMaterialDTO;
|
||||
import com.bonus.canteen.core.drp.service.AndroidInventoryBonusService;
|
||||
import com.bonus.canteen.core.drp.service.AndroidInventoryService;
|
||||
import com.bonus.canteen.core.drp.vo.AndroidSearchMaterialVO;
|
||||
import com.bonus.canteen.core.drp.vo.DrpListSupplierVO;
|
||||
import com.bonus.common.houqin.utils.LeRequest;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import javax.validation.Valid;
|
||||
|
|
@ -29,7 +28,7 @@ public class AndroidInventoryController {
|
|||
private static final Logger log = LoggerFactory.getLogger(AndroidInventoryController.class);
|
||||
@Autowired
|
||||
@Lazy
|
||||
private AndroidInventoryBonusService androidInventoryBonusService;
|
||||
private AndroidInventoryService androidInventoryService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private DrpAuthorityApi drpAuthorityApi;
|
||||
|
|
@ -38,7 +37,7 @@ public class AndroidInventoryController {
|
|||
@ApiOperation("电子秤/手持机-根据原料名称模糊查询原料配置信息")
|
||||
public List<AndroidSearchMaterialVO> searchMaterial(@RequestBody @Valid AndroidSearchMaterialDTO dto, @RequestHeader Map<String, String> headers) {
|
||||
dto.setAreaId(this.drpAuthorityApi.getAreaIdByDeviceSn(headers));
|
||||
return this.androidInventoryBonusService.searchMaterial(dto);
|
||||
return this.androidInventoryService.searchMaterial(dto);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -46,7 +45,7 @@ public class AndroidInventoryController {
|
|||
@ApiOperation("电子秤/手持机-供应商列表")
|
||||
public List<DrpListSupplierVO> androidListSupplier(@RequestHeader Map<String, String> headers) {
|
||||
Long areaId = this.drpAuthorityApi.getAreaIdByDeviceSn(headers);
|
||||
return this.androidInventoryBonusService.androidListSupplier(areaId);
|
||||
return this.androidInventoryService.androidListSupplier(areaId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
package com.bonus.canteen.core.drp.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.bonus.canteen.core.drp.dto.AndroidSearchMaterialDTO;
|
||||
import com.bonus.canteen.core.drp.model.DrpInventory;
|
||||
import com.bonus.canteen.core.drp.vo.AndroidSearchMaterialVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DrpInventoryBonusMapper extends BaseMapper<DrpInventory> {
|
||||
|
||||
List<AndroidSearchMaterialVO> selectAndroidMaterialList(@Param("content") AndroidSearchMaterialDTO content, @Param("pinyinInitials") String pinyinInitials, @Param("pinyinFull") String pinyinFull, @Param("delFlag") Integer delFlag);
|
||||
|
||||
}
|
||||
|
|
@ -2,7 +2,9 @@ package com.bonus.canteen.core.drp.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bonus.canteen.core.drp.dto.AndroidSearchMaterialDTO;
|
||||
import com.bonus.canteen.core.drp.model.DrpInventory;
|
||||
import com.bonus.canteen.core.drp.vo.AndroidSearchMaterialVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
|
@ -21,9 +23,9 @@ public interface DrpInventoryMapper extends BaseMapper<DrpInventory> {
|
|||
//
|
||||
// @Select({"select category_id id, parent_id, category_name from menu_material_category where del_flag = #{delFlag}"})
|
||||
// List<MenuCategoryTreeVO> selectCategoryTree(Integer delFlag);
|
||||
//
|
||||
// List<AndroidSearchMaterialVO> selectAndroidMaterialList(@Param("content") AndroidSearchMaterialDTO content, @Param("pinyinInitials") String pinyinInitials, @Param("pinyinFull") String pinyinFull, @Param("delFlag") Integer delFlag);
|
||||
//
|
||||
|
||||
List<AndroidSearchMaterialVO> selectAndroidMaterialList(@Param("content") AndroidSearchMaterialDTO content, @Param("pinyinInitials") String pinyinInitials, @Param("pinyinFull") String pinyinFull, @Param("delFlag") Integer delFlag);
|
||||
|
||||
// List<AndroidSearchInventoryMaterialVO> searchInventoryMaterial(@Param("content") AndroidSearchInventoryMaterialDTO content, @Param("pinyinInitials") String pinyinInitials, @Param("pinyinFull") String pinyinFull, @Param("delFlag") Integer delFlag);
|
||||
//
|
||||
// InventoryModel getInventoryNumByMaterialId(@Param("materialId") Long materialId, @Param("warehouseId") Long warehouseId, @Param("unitId") Long unitId);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Select;
|
|||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DrpSupplierBonusMapper extends BaseMapper<DrpSupplier> {
|
||||
public interface DrpSupplierMapper extends BaseMapper<DrpSupplier> {
|
||||
@Select({"select supplier_id, supplier_num, supplier_name, address from drp_supplier where status = #{status} and area_id = #{areaId} and del_flag = #{delFlag}"})
|
||||
List<DrpListSupplierVO> selectSupplierListAndroid(@Param("status") Integer status, @Param("areaId") Long areaId, @Param("delFlag") Integer delFlag);
|
||||
|
||||
|
|
@ -3,8 +3,8 @@ package com.bonus.canteen.core.drp.service;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bonus.canteen.core.drp.constant.DrpSupplierStatusEnum;
|
||||
import com.bonus.canteen.core.drp.dto.AndroidSearchMaterialDTO;
|
||||
import com.bonus.canteen.core.drp.mapper.DrpInventoryBonusMapper;
|
||||
import com.bonus.canteen.core.drp.mapper.DrpSupplierBonusMapper;
|
||||
import com.bonus.canteen.core.drp.mapper.DrpInventoryMapper;
|
||||
import com.bonus.canteen.core.drp.mapper.DrpSupplierMapper;
|
||||
import com.bonus.canteen.core.drp.vo.AndroidSearchMaterialVO;
|
||||
import com.bonus.canteen.core.drp.vo.DrpListSupplierVO;
|
||||
import com.bonus.common.houqin.constant.DelFlagEnum;
|
||||
|
|
@ -17,24 +17,24 @@ import org.springframework.stereotype.Service;
|
|||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class AndroidInventoryBonusService {
|
||||
public class AndroidInventoryService {
|
||||
@Generated
|
||||
private static final Logger log = LoggerFactory.getLogger(AndroidInventoryBonusService.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(AndroidInventoryService.class);
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
private DrpInventoryBonusMapper drpInventoryBonusMapper;
|
||||
private DrpInventoryMapper drpInventoryMapper;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private DrpSupplierBonusMapper drpSupplierBonusMapper;
|
||||
private DrpSupplierMapper drpSupplierMapper;
|
||||
|
||||
public List<AndroidSearchMaterialVO> searchMaterial(AndroidSearchMaterialDTO content) {
|
||||
String materialName = ObjectUtil.isNull(content.getMaterialName()) ? "" : content.getMaterialName();
|
||||
return this.drpInventoryBonusMapper.selectAndroidMaterialList(content, materialName.toUpperCase(), materialName.toLowerCase(), DelFlagEnum.DEL_FALSE.key());
|
||||
return this.drpInventoryMapper.selectAndroidMaterialList(content, materialName.toUpperCase(), materialName.toLowerCase(), DelFlagEnum.DEL_FALSE.key());
|
||||
}
|
||||
|
||||
public List<DrpListSupplierVO> androidListSupplier(Long areaId) {
|
||||
return this.drpSupplierBonusMapper.selectSupplierListAndroid(DrpSupplierStatusEnum.NORMAL.key(), areaId, DelFlagEnum.DEL_FALSE.key());
|
||||
return this.drpSupplierMapper.selectSupplierListAndroid(DrpSupplierStatusEnum.NORMAL.key(), areaId, DelFlagEnum.DEL_FALSE.key());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.canteen.core.drp.mapper.DrpInventoryBonusMapper">
|
||||
|
||||
<!-- AI电子秤原料搜索 -->
|
||||
<select id="selectAndroidMaterialList"
|
||||
resultType="com.bonus.canteen.core.drp.vo.AndroidSearchMaterialVO">
|
||||
select
|
||||
mm.material_id,
|
||||
mm.material_name,
|
||||
mm.material_code,
|
||||
mmc.category_name,
|
||||
ds.supplier_id,
|
||||
ds.supplier_name,
|
||||
mm.unit_id,
|
||||
du.unit_name,
|
||||
du.weigh_type,
|
||||
du.rate,
|
||||
did.unit_price
|
||||
from
|
||||
menu_material mm
|
||||
left join (
|
||||
select
|
||||
a.*
|
||||
from
|
||||
drp_into_detail as a,
|
||||
( select b.material_id, max( b.id ) as id from drp_into_detail as b group by b.material_id ) as c
|
||||
where
|
||||
a.material_id = c.material_id
|
||||
and a.id = c.id
|
||||
) did on mm.material_id = did.material_id
|
||||
left join menu_material_category mmc on mm.category_id = mmc.category_id
|
||||
left join drp_supplier ds on did.supplier_id = ds.supplier_id
|
||||
left join drp_unit du on mm.unit_id = du.unit_id
|
||||
where
|
||||
mm.del_flag = #{delFlag}
|
||||
<if test="content.materialCode != null and content.materialCode != ''">
|
||||
and mm.material_code = #{content.materialCode}
|
||||
</if>
|
||||
<if test="content.materialName != null and content.materialName != ''">
|
||||
and (
|
||||
mm.material_name like concat(concat('%', #{content.materialName}), '%')
|
||||
or mm.pinyin_initials like concat(concat('%', #{pinyinInitials}), '%')
|
||||
or mm.pinyin_full like concat(concat('%', #{pinyinFull}), '%')
|
||||
)
|
||||
</if>
|
||||
<if test="content.categoryIdList != null and content.categoryIdList.size() > 0">
|
||||
and mm.category_id in
|
||||
<foreach collection="content.categoryIdList" item="categoryId" separator="," open="(" close=")">
|
||||
#{categoryId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="content.barCode != null and content.barCode != ''">
|
||||
and mm.bar_code = #{content.areaId}
|
||||
</if>
|
||||
<if test="content.areaId != null and content.areaId != 0">
|
||||
and ds.area_id = #{content.areaId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,594 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.canteen.core.drp.mapper.DrpInventoryMapper">
|
||||
|
||||
<update id="minusInventoryNumById">
|
||||
UPDATE drp_inventory
|
||||
SET material_num = material_num - #{fetchNum}
|
||||
WHERE
|
||||
inventory_id = #{inventoryId}
|
||||
</update>
|
||||
<update id="plusInventoryNumById">
|
||||
UPDATE drp_inventory
|
||||
SET material_num = material_num + #{materialNum}
|
||||
WHERE
|
||||
inventory_id = #{inventoryId}
|
||||
</update>
|
||||
|
||||
<!-- <!– 获取所有原料信息 –>-->
|
||||
<!-- <select id="selectAllMaterialList" resultType="net.xnzn.core.drp.vo.DrpListAllMaterialVO">-->
|
||||
<!-- select-->
|
||||
<!-- mm.material_id,-->
|
||||
<!-- mm.material_name,-->
|
||||
<!-- mm.material_code,-->
|
||||
<!-- mmc.category_id,-->
|
||||
<!-- mmc.category_name,-->
|
||||
<!-- ds.supplier_id,-->
|
||||
<!-- ds.supplier_name,-->
|
||||
<!-- du.unit_id,-->
|
||||
<!-- du.unit_name,-->
|
||||
<!-- did.unit_price,-->
|
||||
<!-- did.pur_num-->
|
||||
<!-- from-->
|
||||
<!-- menu_material mm-->
|
||||
<!-- left join (-->
|
||||
<!-- select-->
|
||||
<!-- a.*-->
|
||||
<!-- from-->
|
||||
<!-- drp_into_detail as a,-->
|
||||
<!-- ( select b.material_id, max( b.id ) as id from drp_into_detail as b LEFT JOIN drp_into_inventory AS c ON-->
|
||||
<!-- c.into_id = b.into_id-->
|
||||
<!-- WHERE c.warehouse_id = #{warehouseId} group by b.material_id ) as c-->
|
||||
<!-- where-->
|
||||
<!-- a.material_id = c.material_id-->
|
||||
<!-- and a.id = c.id-->
|
||||
<!-- ) did on mm.material_id = did.material_id-->
|
||||
<!-- left join menu_material_category mmc on mm.category_id = mmc.category_id-->
|
||||
<!-- left join drp_supplier ds on did.supplier_id = ds.supplier_id-->
|
||||
<!-- left join drp_unit du on did.unit_id = du.unit_id-->
|
||||
<!-- where-->
|
||||
<!-- mm.del_flag = #{delFlag}-->
|
||||
<!-- <if test="content.materialCode != null and content.materialCode != ''">-->
|
||||
<!-- and mm.material_code = #{content.materialCode}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.materialName != null and content.materialName != ''">-->
|
||||
<!-- and (-->
|
||||
<!-- mm.material_name like concat(concat('%', #{content.materialName}), '%')-->
|
||||
<!-- or mm.pinyin_initials like concat(concat('%', #{pinyinInitials}), '%')-->
|
||||
<!-- or mm.pinyin_full like concat(concat('%', #{pinyinFull}), '%')-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="categoryIdList != null and categoryIdList.size() > 0">-->
|
||||
<!-- and mm.category_id in-->
|
||||
<!-- <foreach close=")" collection="categoryIdList" item="categoryId" open="(" separator=",">-->
|
||||
<!-- #{categoryId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <!– AI电子秤原料搜索 –>-->
|
||||
<!-- <select id="selectAndroidMaterialList"-->
|
||||
<!-- resultType="net.xnzn.core.drp.vo.AndroidSearchMaterialVO">-->
|
||||
<!-- select-->
|
||||
<!-- mm.material_id,-->
|
||||
<!-- mm.material_name,-->
|
||||
<!-- mm.material_code,-->
|
||||
<!-- mmc.category_name,-->
|
||||
<!-- ds.supplier_id,-->
|
||||
<!-- ds.supplier_name,-->
|
||||
<!-- mm.unit_id,-->
|
||||
<!-- du.unit_name,-->
|
||||
<!-- du.weigh_type,-->
|
||||
<!-- du.rate,-->
|
||||
<!-- did.unit_price-->
|
||||
<!-- from-->
|
||||
<!-- menu_material mm-->
|
||||
<!-- left join (-->
|
||||
<!-- select-->
|
||||
<!-- a.*-->
|
||||
<!-- from-->
|
||||
<!-- drp_into_detail as a,-->
|
||||
<!-- ( select b.material_id, max( b.id ) as id from drp_into_detail as b group by b.material_id ) as c-->
|
||||
<!-- where-->
|
||||
<!-- a.material_id = c.material_id-->
|
||||
<!-- and a.id = c.id-->
|
||||
<!-- ) did on mm.material_id = did.material_id-->
|
||||
<!-- left join menu_material_category mmc on mm.category_id = mmc.category_id-->
|
||||
<!-- left join drp_supplier ds on did.supplier_id = ds.supplier_id-->
|
||||
<!-- left join drp_unit du on mm.unit_id = du.unit_id-->
|
||||
<!-- where-->
|
||||
<!-- mm.del_flag = #{delFlag}-->
|
||||
<!-- <if test="content.materialCode != null and content.materialCode != ''">-->
|
||||
<!-- and mm.material_code = #{content.materialCode}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.materialName != null and content.materialName != ''">-->
|
||||
<!-- and (-->
|
||||
<!-- mm.material_name like concat(concat('%', #{content.materialName}), '%')-->
|
||||
<!-- or mm.pinyin_initials like concat(concat('%', #{pinyinInitials}), '%')-->
|
||||
<!-- or mm.pinyin_full like concat(concat('%', #{pinyinFull}), '%')-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.categoryIdList != null and content.categoryIdList.size() > 0">-->
|
||||
<!-- and mm.category_id in-->
|
||||
<!-- <foreach collection="content.categoryIdList" item="categoryId" separator="," open="(" close=")">-->
|
||||
<!-- #{categoryId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.barCode != null and content.barCode != ''">-->
|
||||
<!-- and mm.bar_code = #{content.barCode}-->
|
||||
<!-- </if>-->
|
||||
<!-- </select>-->
|
||||
|
||||
<!-- <select id="searchInventoryMaterial"-->
|
||||
<!-- resultType="net.xnzn.core.drp.vo.AndroidSearchInventoryMaterialVO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- a.inventory_id,-->
|
||||
<!-- a.material_id,-->
|
||||
<!-- b.material_name,-->
|
||||
<!-- b.material_code,-->
|
||||
<!-- b.category_id,-->
|
||||
<!-- e.category_name,-->
|
||||
<!-- a.unit_id,-->
|
||||
<!-- d.unit_name,-->
|
||||
<!-- d.rate,-->
|
||||
<!-- a.material_num-->
|
||||
<!-- FROM-->
|
||||
<!-- drp_inventory a-->
|
||||
<!-- LEFT JOIN menu_material b ON a.material_id = b.material_id-->
|
||||
<!-- LEFT JOIN drp_unit d ON d.unit_id = a.unit_id-->
|
||||
<!-- LEFT JOIN menu_material_category e ON e.category_id = b.category_id-->
|
||||
<!-- <where>-->
|
||||
<!-- b.del_flag = #{delFlag}-->
|
||||
<!-- and a.material_num > 0-->
|
||||
<!-- <if test="content.materialCode != null and content.materialCode != ''">-->
|
||||
<!-- and b.material_code = #{content.materialCode}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.materialName != null and content.materialName != ''">-->
|
||||
<!-- and (-->
|
||||
<!-- b.material_name like concat(concat('%', #{content.materialName}), '%')-->
|
||||
<!-- or b.pinyin_initials like concat(concat('%', #{pinyinInitials}), '%')-->
|
||||
<!-- or b.pinyin_full like concat(concat('%', #{pinyinFull}), '%')-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.categoryIdList != null and content.categoryIdList.size() > 0">-->
|
||||
<!-- and b.category_id in-->
|
||||
<!-- <foreach collection="content.categoryIdList" item="categoryId" separator="," open="(" close=")">-->
|
||||
<!-- #{categoryId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.warehouseId != null">-->
|
||||
<!-- and a.warehouse_id = #{content.warehouseId}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.barCode != null and content.barCode != ''">-->
|
||||
<!-- and b.bar_code = #{content.barCode}-->
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
<!-- ORDER BY-->
|
||||
<!-- a.material_id,-->
|
||||
<!-- a.unit_id-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="getInventoryNumByMaterialId" resultType="net.xnzn.core.drp.po.InventoryModel">-->
|
||||
<!-- SELECT-->
|
||||
<!-- <if test="warehouseId != null">-->
|
||||
<!-- inventory_id,-->
|
||||
<!-- material_num inventoryNum-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="warehouseId == null">-->
|
||||
<!-- max( inventory_id) inventory_id,-->
|
||||
<!-- sum(material_num) inventoryNum-->
|
||||
<!-- </if>-->
|
||||
<!-- FROM-->
|
||||
<!-- drp_inventory-->
|
||||
<!-- WHERE-->
|
||||
<!-- material_id = #{materialId}-->
|
||||
<!-- <if test="warehouseId != null">-->
|
||||
<!-- AND warehouse_id = #{warehouseId}-->
|
||||
<!-- </if>-->
|
||||
<!-- AND unit_id = #{unitId}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="selectInventoryByMaterialIdList" resultType="net.xnzn.core.drp.vo.MaterialInventoryVO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- material_id,-->
|
||||
<!-- unit_id,-->
|
||||
<!-- sum(material_num) inventoryNum-->
|
||||
<!-- FROM-->
|
||||
<!-- drp_inventory-->
|
||||
<!-- where-->
|
||||
<!-- material_id in-->
|
||||
<!-- <foreach collection="materialIdList" item="materialId" separator="," open="(" close=")">-->
|
||||
<!-- #{materialId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- <if test="warehouseId != null">-->
|
||||
<!-- and warehouse_id = #{warehouseId}-->
|
||||
<!-- </if>-->
|
||||
<!-- group by-->
|
||||
<!-- material_id,-->
|
||||
<!-- unit_id-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="pageMaterialInventory" resultType="net.xnzn.core.drp.vo.DrpMaterialInventoryPageVO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- a.material_id,-->
|
||||
<!-- b.material_name,-->
|
||||
<!-- b.material_code,-->
|
||||
<!-- a.unit_id,-->
|
||||
<!-- c.unit_name,-->
|
||||
<!-- b.category_id,-->
|
||||
<!-- d.category_name,-->
|
||||
<!-- b.image_url,-->
|
||||
<!-- b.bar_code,-->
|
||||
<!-- sum( a.material_num ) AS inventoryNum-->
|
||||
<!-- FROM-->
|
||||
<!-- drp_inventory a-->
|
||||
<!-- LEFT JOIN menu_material b ON a.material_id = b.material_id-->
|
||||
<!-- LEFT JOIN drp_unit c ON c.unit_id = a.unit_id-->
|
||||
<!-- LEFT JOIN menu_material_category d ON d.category_id = b.category_id-->
|
||||
<!-- left join drp_warehouse e on e.warehouse_id = a.warehouse_id-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="content.materialName != null and content.materialName != ''">-->
|
||||
<!-- and b.material_name like #{content.materialName}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.categoryIdList != null and content.categoryIdList.size() > 0">-->
|
||||
<!-- and b.category_id in-->
|
||||
<!-- <foreach collection="content.categoryIdList" item="categoryId" separator="," open="(" close=")">-->
|
||||
<!-- #{categoryId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.barCode != null and content.barCode != ''">-->
|
||||
<!-- and b.bar_code = #{content.barCode}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="warehouseAuthority != null and warehouseAuthority.size() > 0">-->
|
||||
<!-- and a.warehouse_id in-->
|
||||
<!-- <foreach collection="warehouseAuthority" item="warehouseId" separator="," open="(" close=")">-->
|
||||
<!-- #{warehouseId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.inventoryStatus != null">-->
|
||||
<!-- and a.inventory_status = #{content.inventoryStatus}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.warehouseIdList != null and content.warehouseIdList.size() > 0">-->
|
||||
<!-- AND a.warehouse_id in-->
|
||||
<!-- <foreach collection="content.warehouseIdList" item="item" separator="," open="(" close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="areaAuth != null and areaAuth.size() > 0">-->
|
||||
<!-- and e.area_id in-->
|
||||
<!-- <foreach collection="areaAuth" item="areaId" separator="," open="(" close=")">-->
|
||||
<!-- #{areaId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.areaId != null">-->
|
||||
<!-- and e.area_id = #{content.areaId}-->
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
<!-- GROUP BY-->
|
||||
<!-- a.material_id,-->
|
||||
<!-- b.material_name,-->
|
||||
<!-- b.material_code,-->
|
||||
<!-- a.unit_id,-->
|
||||
<!-- c.unit_name,-->
|
||||
<!-- b.category_id,-->
|
||||
<!-- d.category_name,-->
|
||||
<!-- b.image_url,-->
|
||||
<!-- b.bar_code-->
|
||||
<!-- ORDER BY-->
|
||||
<!-- a.material_id,-->
|
||||
<!-- a.unit_id-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="listAllWarehouseInventory" resultType="net.xnzn.core.drp.vo.DrpMaterialInventoryDetailPageVO">-->
|
||||
<!-- SELECT a.inventory_id,-->
|
||||
<!-- a.warehouse_id,-->
|
||||
<!-- b.warehouse_name,-->
|
||||
<!-- a.material_num,-->
|
||||
<!-- a.inventory_status,-->
|
||||
<!-- a.min_num,-->
|
||||
<!-- a.max_num,-->
|
||||
<!-- a.material_id,-->
|
||||
<!-- a.unit_id,-->
|
||||
<!-- b.area_id,-->
|
||||
<!-- aa.area_name-->
|
||||
<!-- FROM drp_inventory a-->
|
||||
<!-- LEFT JOIN drp_warehouse b on b.warehouse_id = a.warehouse_id-->
|
||||
<!-- left join alloc_area aa on aa.area_id = b.area_id-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="materialId != null">-->
|
||||
<!-- AND a.material_id = #{materialId}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="unitId != null">-->
|
||||
<!-- AND a.unit_id = #{unitId}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.warehouseIdList != null and content.warehouseIdList.size() > 0">-->
|
||||
<!-- AND a.warehouse_id in-->
|
||||
<!-- <foreach collection="content.warehouseIdList" item="item" separator="," open="(" close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="warehouseAuthority != null and warehouseAuthority.size() > 0">-->
|
||||
<!-- and a.warehouse_id in-->
|
||||
<!-- <foreach collection="warehouseAuthority" item="warehouseId" separator="," open="(" close=")">-->
|
||||
<!-- #{warehouseId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="areaAuth != null and areaAuth.size() > 0">-->
|
||||
<!-- and b.area_id in-->
|
||||
<!-- <foreach collection="areaAuth" item="areaId" separator="," open="(" close=")">-->
|
||||
<!-- #{areaId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.materialIdList != null and content.materialIdList.size() > 0">-->
|
||||
<!-- AND a.material_id in-->
|
||||
<!-- <foreach collection="content.materialIdList" item="item" separator="," open="(" close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.unitIdList != null and content.unitIdList.size() > 0">-->
|
||||
<!-- AND a.unit_id in-->
|
||||
<!-- <foreach collection="content.unitIdList" item="item" separator="," open="(" close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.areaId != null">-->
|
||||
<!-- and b.area_id = #{content.areaId}-->
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="getMaterialWarehouseInventory"-->
|
||||
<!-- resultType="net.xnzn.core.drp.vo.DrpMaterialWarehouseInventoryVO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- a.warehouse_id,-->
|
||||
<!-- b.warehouse_name,-->
|
||||
<!-- a.material_num-->
|
||||
<!-- FROM-->
|
||||
<!-- drp_inventory a-->
|
||||
<!-- LEFT JOIN drp_warehouse b ON b.warehouse_id = a.warehouse_id-->
|
||||
<!-- WHERE-->
|
||||
<!-- b.del_flag = #{delFlag}-->
|
||||
<!-- AND a.material_id = #{content.materialId}-->
|
||||
<!-- AND a.unit_id = #{content.unitId}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="checkInventoryNum" resultType="java.math.BigDecimal">-->
|
||||
<!-- SELECT-->
|
||||
<!-- SUM( material_num )-->
|
||||
<!-- FROM-->
|
||||
<!-- drp_inventory-->
|
||||
<!-- WHERE-->
|
||||
<!-- warehouse_id = #{warehouseId}-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="getWarehouseCategory" resultType="net.xnzn.core.drp.dto.WarehouseCategoryPageDTO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- mm.category_id,-->
|
||||
<!-- mmc.category_name,-->
|
||||
<!-- mmc.category_type-->
|
||||
<!-- FROM-->
|
||||
<!-- drp_inventory di-->
|
||||
<!-- LEFT JOIN menu_material mm ON di.material_id = mm.material_id-->
|
||||
<!-- LEFT JOIN menu_material_category mmc ON mm.category_id = mmc.category_id-->
|
||||
<!-- WHERE-->
|
||||
<!-- di.del_flag = 2-->
|
||||
<!-- AND di.warehouse_id = #{content.warehouseId}-->
|
||||
<!-- <if test="content.categoryIdList != null and content.categoryIdList.size() > 0">-->
|
||||
<!-- and mmc.category_id in-->
|
||||
<!-- <foreach collection="content.categoryIdList" item="categoryId" separator="," open="(" close=")">-->
|
||||
<!-- #{categoryId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- GROUP BY-->
|
||||
<!-- mm.category_id,-->
|
||||
<!-- mmc.category_name,-->
|
||||
<!-- mmc.category_type-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="materialInventoryExport" resultType="net.xnzn.core.drp.vo.DrpMaterialInventoryExportVO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- a.inventory_id,-->
|
||||
<!-- a.material_id,-->
|
||||
<!-- a.unit_id,-->
|
||||
<!-- b.material_name,-->
|
||||
<!-- b.material_code,-->
|
||||
<!-- c.unit_name,-->
|
||||
<!-- d.category_name,-->
|
||||
<!-- b.bar_code,-->
|
||||
<!-- dw.warehouse_name,-->
|
||||
<!-- a.inventory_status,-->
|
||||
<!-- sum( a.material_num ) AS materialNum,-->
|
||||
<!-- a.warehouse_id-->
|
||||
<!-- FROM-->
|
||||
<!-- drp_inventory a-->
|
||||
<!-- LEFT JOIN menu_material b ON a.material_id = b.material_id-->
|
||||
<!-- LEFT JOIN drp_unit c ON c.unit_id = b.unit_id-->
|
||||
<!-- LEFT JOIN menu_material_category d ON d.category_id = b.category_id-->
|
||||
<!-- LEFT JOIN drp_warehouse dw ON a.warehouse_id = dw.warehouse_id-->
|
||||
<!-- left join alloc_area aa on aa.area_id = dw.area_id-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="content.materialName != null and content.materialName != ''">-->
|
||||
<!-- and b.material_name like #{content.materialName}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.categoryIdList != null and content.categoryIdList.size() > 0">-->
|
||||
<!-- and b.category_id in-->
|
||||
<!-- <foreach collection="content.categoryIdList" item="categoryId" separator="," open="(" close=")">-->
|
||||
<!-- #{categoryId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.barCode != null and content.barCode != ''">-->
|
||||
<!-- and b.bar_code = #{content.barCode}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="warehouseAuthority != null and warehouseAuthority.size() > 0">-->
|
||||
<!-- and a.warehouse_id in-->
|
||||
<!-- <foreach collection="warehouseAuthority" item="warehouseId" separator="," open="(" close=")">-->
|
||||
<!-- #{warehouseId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.inventoryStatus != null">-->
|
||||
<!-- and a.inventory_status = #{content.inventoryStatus}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="areaAuth != null and areaAuth.size() > 0">-->
|
||||
<!-- and dw.area_id in-->
|
||||
<!-- <foreach collection="areaAuth" item="areaId" separator="," open="(" close=")">-->
|
||||
<!-- #{areaId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.warehouseIdList != null and content.warehouseIdList.size() > 0">-->
|
||||
<!-- AND a.warehouse_id in-->
|
||||
<!-- <foreach collection="content.warehouseIdList" item="item" separator="," open="(" close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.areaId != null">-->
|
||||
<!-- and dw.area_id = #{content.areaId}-->
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
<!-- GROUP BY-->
|
||||
<!-- a.inventory_id,-->
|
||||
<!-- b.material_name,-->
|
||||
<!-- b.material_code,-->
|
||||
<!-- c.unit_name,-->
|
||||
<!-- d.category_name,-->
|
||||
<!-- b.bar_code,-->
|
||||
<!-- a.material_id,-->
|
||||
<!-- a.unit_id,-->
|
||||
<!-- dw.warehouse_name,-->
|
||||
<!-- a.inventory_status,-->
|
||||
<!-- dw.area_id,-->
|
||||
<!-- aa.area_name,-->
|
||||
<!-- a.warehouse_id-->
|
||||
<!-- <!– HAVING 1 = 1-->
|
||||
|
||||
<!-- <if test="content.materialNumStart != null">-->
|
||||
<!-- and sum( a.material_num ) >= #{content.materialNumStart}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.materialNumEnd != null">-->
|
||||
<!-- and sum( a.material_num ) <![CDATA[ <= ]]> #{content.materialNumEnd}-->
|
||||
<!-- </if>–>-->
|
||||
<!-- ORDER BY-->
|
||||
<!-- a.material_id,-->
|
||||
<!-- a.unit_id-->
|
||||
|
||||
<!-- </select>-->
|
||||
<!-- <select id="pageDrpInventory" resultType="net.xnzn.core.drp.vo.DrpInventoryPageVO">-->
|
||||
<!-- SELECT-->
|
||||
<!-- a.inventory_id,-->
|
||||
<!-- a.warehouse_id,-->
|
||||
<!-- f.warehouse_name,-->
|
||||
<!-- a.material_id,-->
|
||||
<!-- b.material_code,-->
|
||||
<!-- b.material_name,-->
|
||||
<!-- b.category_id,-->
|
||||
<!-- e.category_name,-->
|
||||
<!-- a.unit_id,-->
|
||||
<!-- d.unit_name,-->
|
||||
<!-- a.min_num,-->
|
||||
<!-- a.max_num,-->
|
||||
<!-- a.material_num,-->
|
||||
<!-- a.inventory_status,-->
|
||||
<!-- b.image_url,-->
|
||||
<!-- b.bar_code,-->
|
||||
<!-- b.sales_mode-->
|
||||
<!-- FROM-->
|
||||
<!-- drp_inventory a-->
|
||||
<!-- LEFT JOIN menu_material b ON a.material_id = b.material_id-->
|
||||
<!-- LEFT JOIN drp_unit d ON d.unit_id = a.unit_id-->
|
||||
<!-- LEFT JOIN menu_material_category e ON e.category_id = b.category_id-->
|
||||
<!-- LEFT JOIN drp_warehouse f ON f.warehouse_id = a.warehouse_id-->
|
||||
<!-- <where>-->
|
||||
<!-- <if test="content.warehouseId != null">-->
|
||||
<!-- and a.warehouse_id = #{content.warehouseId}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.materialNum != null and content.materialNum != ''">-->
|
||||
<!-- and a.material_num > #{content.materialNum}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.materialId != null">-->
|
||||
<!-- and a.material_id = #{content.materialId}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.materialName != null and content.materialName != ''">-->
|
||||
<!-- and b.material_name like #{content.materialName}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.categoryIdList != null and content.categoryIdList.size() > 0">-->
|
||||
<!-- and b.category_id in-->
|
||||
<!-- <foreach collection="content.categoryIdList" item="categoryId" separator="," open="(" close=")">-->
|
||||
<!-- #{categoryId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.inventoryStatus != null">-->
|
||||
<!-- and a.inventory_status = #{content.inventoryStatus}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.barCode != null and content.barCode != ''">-->
|
||||
<!-- and b.bar_code = #{content.barCode}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.materialCode != null and content.materialCode != ''">-->
|
||||
<!-- and b.material_code like #{content.materialCode}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.initial != null and content.initial != ''">-->
|
||||
<!-- and b.pinyin_initials like CONCAT(#{content.initial},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.filterNegative != null">-->
|
||||
<!-- and a.material_num > 0-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.materialInfo != null and content.materialInfo != ''">-->
|
||||
<!-- and (-->
|
||||
<!-- b.material_name like concat('%', #{content.materialInfo}, '%')-->
|
||||
<!-- or b.pinyin_initials like concat(#{content.materialInfo}, '%')-->
|
||||
<!-- or b.bar_code like concat('%', #{content.materialInfo}, '%')-->
|
||||
<!-- or b.material_code like concat('%', #{content.materialInfo}, '%')-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.materialIdList != null and content.materialIdList.size() > 0">-->
|
||||
<!-- and b.material_id in-->
|
||||
<!-- <foreach collection="content.materialIdList" item="item" separator="," open="(" close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
<!-- ORDER BY-->
|
||||
<!-- a.material_id,-->
|
||||
<!-- a.unit_id-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="sumInventoryNumById" resultType="net.xnzn.core.drp.vo.DrpSumInventoryNumVO">-->
|
||||
<!-- SELECT a.material_id,-->
|
||||
<!-- a.unit_id,-->
|
||||
<!-- sum(a.unit_price * a.inventory_num) as inventoryAmount,-->
|
||||
<!-- b.warehouse_id-->
|
||||
<!-- FROM drp_into_detail a-->
|
||||
<!-- LEFT JOIN drp_into_inventory b ON b.into_id = a.into_id-->
|
||||
<!-- WHERE b.`status` = #{status}-->
|
||||
<!-- AND a.inventory_num > 0-->
|
||||
<!-- <if test="inventoryIdList != null and inventoryIdList.size() > 0">-->
|
||||
<!-- and a.inventory_id in-->
|
||||
<!-- <foreach collection="inventoryIdList" item="inventoryId" separator="," open="(" close=")">-->
|
||||
<!-- #{inventoryId}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- group by a.material_id, a.unit_id, b.warehouse_id-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="getInventoryMaterialAllTypes" resultType="net.xnzn.core.drp.vo.DrpAppAllMaterialTypesVO">-->
|
||||
<!-- SELECT distinct-->
|
||||
<!-- b.category_id,-->
|
||||
<!-- c.category_name-->
|
||||
<!-- FROM-->
|
||||
<!-- drp_inventory a-->
|
||||
<!-- LEFT JOIN menu_material b ON b.material_id = a.material_id-->
|
||||
<!-- LEFT JOIN menu_material_category c ON c.category_id = b.category_id-->
|
||||
<!-- WHERE-->
|
||||
<!-- a.del_flag = #{delFlag}-->
|
||||
<!-- AND b.del_flag = #{delFlag}-->
|
||||
<!-- AND c.del_flag = #{delFlag}-->
|
||||
<!-- <if test="content.warehouseId != null">-->
|
||||
<!-- AND a.warehouse_id = #{content.warehouseId}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="content.filterNegative != null">-->
|
||||
<!-- AND a.material_num > 0-->
|
||||
<!-- </if>-->
|
||||
<!-- </select>-->
|
||||
<!-- <select id="listInventoryCategory" resultType="java.lang.Long">-->
|
||||
<!-- SELECT DISTINCT-->
|
||||
<!-- mm.category_id-->
|
||||
<!-- FROM-->
|
||||
<!-- drp_inventory di-->
|
||||
<!-- LEFT JOIN menu_material mm ON mm.material_id = di.material_id-->
|
||||
<!-- WHERE-->
|
||||
<!-- di.warehouse_id = #{content.warehouseId}-->
|
||||
<!-- </select>-->
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue