功能修改

master
sunjianxi 3 days ago
parent 2ac508ac46
commit 4b395e678e
  1. 25
      src/main/java/com/nov/KgLowDurable/controller/LdDemandEndController.java
  2. 6
      src/main/java/com/nov/KgLowDurable/controller/LdPurchaseEndController.java
  3. 7
      src/main/java/com/nov/KgLowDurable/mapper/LdDemandEndMapper.java
  4. 6
      src/main/java/com/nov/KgLowDurable/mapper/LdPurchaseEndMapper.java
  5. 6
      src/main/java/com/nov/KgLowDurable/pojo/entity/LdOneOutStorageDetail.java
  6. 2
      src/main/java/com/nov/KgLowDurable/service/ILdDemandEndService.java
  7. 2
      src/main/java/com/nov/KgLowDurable/service/ILdPurchaseEndService.java
  8. 12
      src/main/java/com/nov/KgLowDurable/service/Impl/LdDemandEndServiceImpl.java
  9. 15
      src/main/java/com/nov/KgLowDurable/service/Impl/LdPurchaseEndServiceImpl.java
  10. 6
      src/main/java/com/nov/KgLowDurable/service/Impl/LdTwoPutStorageServiceImpl.java
  11. 24
      src/main/resources/mapper/LdDemandEndMapper.xml
  12. 5
      src/main/resources/mapper/LdOneOutStorageDemandEndMapper.xml
  13. 50
      src/main/resources/mapper/LdOneOutStorageDetailMapper.xml
  14. 2
      src/main/resources/mapper/LdOnePutStorageDetailMapper.xml
  15. 21
      src/main/resources/mapper/LdPurchaseEndMapper.xml

@ -9,6 +9,7 @@ import com.nov.KgLowDurable.service.ILdDemandEndService;
import com.nov.KgLowDurable.util.Result; import com.nov.KgLowDurable.util.Result;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -20,6 +21,7 @@ import java.util.Map;
/** /**
* @author liweidong * @author liweidong
*/ */
@Slf4j
@RestController @RestController
@AllArgsConstructor @AllArgsConstructor
@RequestMapping("/demandEnd") @RequestMapping("/demandEnd")
@ -37,10 +39,15 @@ public class LdDemandEndController {
}) })
public Result list(@ApiParam(hidden = true) public Result list(@ApiParam(hidden = true)
@RequestParam(required = false) String demandNo, @RequestParam(required = false) String demandNo,
@RequestParam(required = false) String materialName,
@RequestParam(required = false) String model,
@RequestParam(required = false) String department,
@RequestParam(required = false) String year,
@RequestParam(required = false) String quarter,
@RequestParam(required = false ,defaultValue = "1") Integer pageNum, @RequestParam(required = false ,defaultValue = "1") Integer pageNum,
@RequestParam(required = false ,defaultValue = "10") Integer pageSize) { @RequestParam(required = false ,defaultValue = "10") Integer pageSize) {
return Result.OK(demandEndService.getDemandEndList(demandNo,pageNum,pageSize)); return Result.OK(demandEndService.getDemandEndList(demandNo,materialName,model,department,year,quarter,pageNum,pageSize));
} }
@ -82,12 +89,8 @@ public class LdDemandEndController {
@ApiImplicitParam(name = "optionType", value = "选项", dataType = "string", paramType = "query") @ApiImplicitParam(name = "optionType", value = "选项", dataType = "string", paramType = "query")
}) })
public Result getDemandEndData(@RequestParam String ids,@RequestParam String departmentId,@RequestParam String optionType) { public Result getDemandEndData(@RequestParam String ids,@RequestParam String departmentId,@RequestParam String optionType) {
try { List<LdOneOutStorageDetail> quarters = demandEndService.getDemandEndData(ids,departmentId,optionType);
List<LdOneOutStorageDetail> quarters = demandEndService.getDemandEndData(ids,departmentId,optionType); return Result.OK(quarters);
return Result.OK(quarters);
} catch (Exception e) {
return Result.error("获取需求单数据失败");
}
} }
@ -100,12 +103,8 @@ public class LdDemandEndController {
@ApiImplicitParam(name = "optionType", value = "选项", dataType = "string", paramType = "query") @ApiImplicitParam(name = "optionType", value = "选项", dataType = "string", paramType = "query")
}) })
public Result getDemandEndNyData(@RequestParam String ids,@RequestParam String departmentId,@RequestParam String optionType) { public Result getDemandEndNyData(@RequestParam String ids,@RequestParam String departmentId,@RequestParam String optionType) {
try { List<LdOneOutStorageDetailVO> quarters = demandEndService.getDemandEndNyData(ids,departmentId,optionType);
List<LdOneOutStorageDetailVO> quarters = demandEndService.getDemandEndNyData(ids,departmentId,optionType); return Result.OK(quarters);
return Result.OK(quarters);
} catch (Exception e) {
return Result.error("获取需求单数据失败");
}
} }

@ -32,10 +32,14 @@ public class LdPurchaseEndController {
}) })
public Result list(@ApiParam(hidden = true) public Result list(@ApiParam(hidden = true)
@RequestParam(required = false) String purchaseNo, @RequestParam(required = false) String purchaseNo,
@RequestParam(required = false) String materialName,
@RequestParam(required = false) String model,
@RequestParam(required = false) String year,
@RequestParam(required = false) String quarter,
@RequestParam(required = false ,defaultValue = "1") Integer pageNum, @RequestParam(required = false ,defaultValue = "1") Integer pageNum,
@RequestParam(required = false ,defaultValue = "10") Integer pageSize) { @RequestParam(required = false ,defaultValue = "10") Integer pageSize) {
return Result.OK(purchaseEndService.getPurchaseEndList(purchaseNo,pageNum,pageSize)); return Result.OK(purchaseEndService.getPurchaseEndList(purchaseNo,materialName,model,year,quarter,pageNum,pageSize));
} }
@GetMapping("/getAllQuarter") @GetMapping("/getAllQuarter")

@ -13,7 +13,12 @@ import java.util.List;
public interface LdDemandEndMapper extends BaseMapper<LdDemandEnd> { public interface LdDemandEndMapper extends BaseMapper<LdDemandEnd> {
List<LdDemandEnd> selectDemandEndList(@Param("demandNo") String demandNo); List<LdDemandEnd> selectDemandEndList(@Param("demandNo") String demandNo,
@Param("materialName") String materialName,
@Param("model") String model,
@Param("department") String department,
@Param("year") String year,
@Param("quarter") String quarter);
List<QuarterVO> getAllQuarter(); List<QuarterVO> getAllQuarter();

@ -12,7 +12,11 @@ import java.util.List;
*/ */
public interface LdPurchaseEndMapper extends BaseMapper<LdPurchaseEnd> { public interface LdPurchaseEndMapper extends BaseMapper<LdPurchaseEnd> {
List<LdPurchaseEnd> selectPurchaseEndList(@Param("purchaseNo") String purchaseNo); List<LdPurchaseEnd> selectPurchaseEndList(@Param("purchaseNo") String purchaseNo,
@Param("materialName") String materialName,
@Param("model") String model,
@Param("year") String year,
@Param("quarter") String quarter);
List<QuarterVO> getAllQuarters(); List<QuarterVO> getAllQuarters();

@ -1,6 +1,7 @@
package com.nov.KgLowDurable.pojo.entity; package com.nov.KgLowDurable.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@ -140,6 +141,11 @@ public class LdOneOutStorageDetail implements Serializable {
*/ */
private Long oneFormId; private Long oneFormId;
/**
* 库存数量
*/
@TableField(exist = false)
private BigDecimal num;

@ -25,7 +25,7 @@ public interface ILdDemandEndService extends IService<LdDemandEnd> {
* @param pageSize * @param pageSize
* @return * @return
*/ */
PageInfo<LdDemandEnd> getDemandEndList(String demandNo, Integer pageNum, Integer pageSize); PageInfo<LdDemandEnd> getDemandEndList(String demandNo,String materialName,String model,String department,String year,String quarter, Integer pageNum, Integer pageSize);
/** /**
* 获取需求单 * 获取需求单

@ -20,7 +20,7 @@ public interface ILdPurchaseEndService extends IService<LdPurchaseEnd> {
* @param pageSize * @param pageSize
* @return * @return
*/ */
PageInfo<LdPurchaseEnd> getPurchaseEndList(String purchaseNo, Integer pageNum, Integer pageSize); PageInfo<LdPurchaseEnd> getPurchaseEndList(String purchaseNo,String materialName,String model,String year,String quarter, Integer pageNum, Integer pageSize);
/** /**
* 获取采购单所有季度 * 获取采购单所有季度

@ -47,10 +47,10 @@ public class LdDemandEndServiceImpl extends ServiceImpl<LdDemandEndMapper, LdDem
ILdOneFormService oneFormService; ILdOneFormService oneFormService;
@Override @Override
public PageInfo<LdDemandEnd> getDemandEndList(String demandNo, Integer pageNum, Integer pageSize) { public PageInfo<LdDemandEnd> getDemandEndList(String demandNo,String materialName,String model,String department,String year,String quarter, Integer pageNum, Integer pageSize) {
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);
List<LdDemandEnd> ldPurchaseEndList = demandEndMapper.selectDemandEndList(demandNo); List<LdDemandEnd> ldPurchaseEndList = demandEndMapper.selectDemandEndList(demandNo,materialName,model,department,year,quarter);
PageInfo<LdDemandEnd> pageInfo = new PageInfo<>(ldPurchaseEndList); PageInfo<LdDemandEnd> pageInfo = new PageInfo<>(ldPurchaseEndList);
return pageInfo; return pageInfo;
} }
@ -301,10 +301,11 @@ public class LdDemandEndServiceImpl extends ServiceImpl<LdDemandEndMapper, LdDem
// 计算申请数量 // 计算申请数量
BigDecimal demandQuantity = new BigDecimal(demand.getNum()); BigDecimal demandQuantity = new BigDecimal(demand.getNum());
BigDecimal availableQty = inventory.getNum() != null ? inventory.getNum() : BigDecimal.ZERO; // BigDecimal availableQty = inventory.getNum() != null ? inventory.getNum() : BigDecimal.ZERO;
// 申请数量 = min(需求数量, 可用库存) // 申请数量 = min(需求数量, 可用库存)
BigDecimal applicationQty = demandQuantity.min(availableQty); // BigDecimal applicationQty = demandQuantity.min(availableQty);
BigDecimal applicationQty = demandQuantity;
// 如果可用库存为0,不生成出库明细 // 如果可用库存为0,不生成出库明细
if (applicationQty.compareTo(BigDecimal.ZERO) <= 0) { if (applicationQty.compareTo(BigDecimal.ZERO) <= 0) {
@ -317,7 +318,8 @@ public class LdDemandEndServiceImpl extends ServiceImpl<LdDemandEndMapper, LdDem
detail.setLdDemandEndId(demand.getId()); detail.setLdDemandEndId(demand.getId());
detail.setDepartment(demand.getDepartmentId()); detail.setDepartment(demand.getDepartmentId());
detail.setDepartmentName(demand.getDepartment()); detail.setDepartmentName(demand.getDepartment());
detail.setOneFormId(inventory.getId());
detail.setNum(inventory.getNum());
return detail; return detail;
} }

@ -42,9 +42,9 @@ public class LdPurchaseEndServiceImpl extends ServiceImpl<LdPurchaseEndMapper, L
ILdMaterialService materialService; ILdMaterialService materialService;
@Override @Override
public PageInfo<LdPurchaseEnd> getPurchaseEndList(String purchaseNo, Integer pageNum, Integer pageSize) { public PageInfo<LdPurchaseEnd> getPurchaseEndList(String purchaseNo,String materialName,String model,String year,String quarter, Integer pageNum, Integer pageSize) {
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);
List<LdPurchaseEnd> ldPurchaseEndList = purchaseEndMapper.selectPurchaseEndList(purchaseNo); List<LdPurchaseEnd> ldPurchaseEndList = purchaseEndMapper.selectPurchaseEndList(purchaseNo,materialName,model,year,quarter);
PageInfo<LdPurchaseEnd> pageInfo = new PageInfo<>(ldPurchaseEndList); PageInfo<LdPurchaseEnd> pageInfo = new PageInfo<>(ldPurchaseEndList);
return pageInfo; return pageInfo;
} }
@ -63,6 +63,7 @@ public class LdPurchaseEndServiceImpl extends ServiceImpl<LdPurchaseEndMapper, L
//查询一级入库是否有该采购单 //查询一级入库是否有该采购单
List<Long> idList = Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()); List<Long> idList = Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList());
List<LdOnePutStoragePurchaseEnd> onePutStoragePurchaseEndList = onePutStoragePurchaseEndService.selectByPurchaseEndId(idList); List<LdOnePutStoragePurchaseEnd> onePutStoragePurchaseEndList = onePutStoragePurchaseEndService.selectByPurchaseEndId(idList);
Map<Long,BigDecimal> map = new HashMap<>();
if(!CollectionUtils.isEmpty(onePutStoragePurchaseEndList)){ if(!CollectionUtils.isEmpty(onePutStoragePurchaseEndList)){
//获取一级库ID //获取一级库ID
List<Long> onePutStorageIds = onePutStoragePurchaseEndList.stream() List<Long> onePutStorageIds = onePutStoragePurchaseEndList.stream()
@ -79,10 +80,11 @@ public class LdPurchaseEndServiceImpl extends ServiceImpl<LdPurchaseEndMapper, L
List<LdOnePutStorageDetail> ldOnePutStorageDetailList = onePutStorageDetailService.getSummaryData(collect); List<LdOnePutStorageDetail> ldOnePutStorageDetailList = onePutStorageDetailService.getSummaryData(collect);
ldOnePutStorageDetailList.forEach(detail ->{ ldOnePutStorageDetailList.forEach(detail ->{
detail.setYetInboundQuantity(detail.getInboundQuantity()); map.put(detail.getMaterialId(),detail.getInboundQuantity());
//detail.setYetInboundQuantity(detail.getInboundQuantity());
}); });
ldOnePutStorageDetailList.sort(Comparator.comparing(LdOnePutStorageDetail::getMaterialCode)); /*ldOnePutStorageDetailList.sort(Comparator.comparing(LdOnePutStorageDetail::getMaterialCode));
return ldOnePutStorageDetailList; return ldOnePutStorageDetailList;*/
} }
} }
@ -105,6 +107,9 @@ public class LdPurchaseEndServiceImpl extends ServiceImpl<LdPurchaseEndMapper, L
onePutStorageDetail.setRequiredQuantity(new BigDecimal(ldPurchaseEnd.getNum())); onePutStorageDetail.setRequiredQuantity(new BigDecimal(ldPurchaseEnd.getNum()));
onePutStorageDetail.setUnitPrice(ldPurchaseEnd.getMoney()); onePutStorageDetail.setUnitPrice(ldPurchaseEnd.getMoney());
onePutStorageDetail.setLdPurchaseEndId(ldPurchaseEnd.getId()); onePutStorageDetail.setLdPurchaseEndId(ldPurchaseEnd.getId());
if(map.containsKey(ldPurchaseEnd.getMaterialId())){
onePutStorageDetail.setYetInboundQuantity(map.get(ldPurchaseEnd.getMaterialId()));
}
list.add(onePutStorageDetail); list.add(onePutStorageDetail);
} }
list.sort(Comparator.comparing(LdOnePutStorageDetail::getMaterialCode)); list.sort(Comparator.comparing(LdOnePutStorageDetail::getMaterialCode));

@ -353,9 +353,9 @@ public class LdTwoPutStorageServiceImpl extends ServiceImpl<LdTwoPutStorageMappe
* 校验易耗品明细 * 校验易耗品明细
*/ */
private void validateDetailForConsumer(LdTwoPutStorageDetail detail) { private void validateDetailForConsumer(LdTwoPutStorageDetail detail) {
if (detail.getInboundQuantity() == null || detail.getInboundQuantity().compareTo(BigDecimal.ZERO) <= 0) { // if (detail.getInboundQuantity() == null || detail.getInboundQuantity().compareTo(BigDecimal.ZERO) <= 0) {
throw new CustomerException("易耗品入库数量必须大于0"); // throw new CustomerException("易耗品入库数量必须大于0");
} // }
if(BatchConstant.DURABLE.equals(detail.getType())){ if(BatchConstant.DURABLE.equals(detail.getType())){
if (detail.getUnitPrice() == null || detail.getUnitPrice().compareTo(BigDecimal.ZERO) < 0) { if (detail.getUnitPrice() == null || detail.getUnitPrice().compareTo(BigDecimal.ZERO) < 0) {
throw new CustomerException("单价不能为负数"); throw new CustomerException("单价不能为负数");

@ -28,9 +28,27 @@
SELECT SELECT
<include refid="baseColumnList" /> <include refid="baseColumnList" />
FROM ld_demand_end FROM ld_demand_end
<if test="demandNo != null and demandNo !=''"> <where>
WHERE demand_no LIKE CONCAT('%', #{demandNo}, '%') <if test="demandNo != null and demandNo !=''">
</if> and demand_no LIKE CONCAT('%', #{demandNo}, '%')
</if>
<if test="materialName != null and materialName !=''">
and material_name LIKE CONCAT('%', #{materialName}, '%')
</if>
<if test="model != null and model !=''">
and model LIKE CONCAT('%', #{model}, '%')
</if>
<if test="department != null and department !=''">
and department LIKE CONCAT('%', #{department}, '%')
</if>
<if test="year != null and year !=''">
and year = #{year}
</if>
<if test="quarter != null and quarter !=''">
and quarter = #{quarter}
</if>
</where>
</select> </select>
<select id="getAllQuarter" resultType="com.nov.KgLowDurable.pojo.vo.QuarterVO"> <select id="getAllQuarter" resultType="com.nov.KgLowDurable.pojo.vo.QuarterVO">

@ -11,8 +11,9 @@
</resultMap> </resultMap>
<select id="selectByDemandEndId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDemandEnd"> <select id="selectByDemandEndId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDemandEnd">
select * from ld_one_out_storage_demand_end select a.* from ld_one_out_storage_demand_end a left join ld_one_out_storage b on a.one_out_storage_id = b.id
where demand_end_id in where b.status = 3
and demand_end_id in
<foreach collection="idList" item="id" open="(" separator="," close=")"> <foreach collection="idList" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

@ -30,20 +30,20 @@
<!-- 基础查询SQL --> <!-- 基础查询SQL -->
<sql id="baseColumnList"> <sql id="baseColumnList">
id, one_form_id, one_out_storage_id, one_out_storage_no, one_out_detail_code, ld_demand_end_id, material_id, material_name, material_code, model, type, unit, application_quantity, outbound_quantity, outbound_sum_quantity, shipper_status, out_storage_person, out_storage_time, department, department_name, department_people_id, department_people_name, remark a.id, a.one_form_id, a.one_out_storage_id, a.one_out_storage_no, a.one_out_detail_code, a.ld_demand_end_id, a.material_id, a.material_name, a.material_code, a.model, a.type, a.unit, a.application_quantity, a.outbound_quantity, a.outbound_sum_quantity, a.shipper_status, a.out_storage_person, a.out_storage_time, a.department, a.department_name, a.department_people_id, a.department_people_name, a.remark
</sql> </sql>
<select id="selectById" resultMap="ldOnePutStorageDetailResultMap"> <select id="selectById" resultMap="ldOnePutStorageDetailResultMap">
SELECT SELECT
<include refid="baseColumnList" /> <include refid="baseColumnList" />
FROM ld_one_out_storage_detail FROM ld_one_out_storage_detail a
WHERE id = #{id} WHERE id = #{id}
</select> </select>
<select id="selectByMaterialId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail"> <select id="selectByMaterialId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail">
SELECT SELECT
<include refid="baseColumnList" /> <include refid="baseColumnList" />
FROM ld_one_out_storage_detail FROM ld_one_out_storage_detail a
WHERE shipper_status = #{shipperStatus} WHERE shipper_status = #{shipperStatus}
AND one_out_storage_id = #{oneOutStorageId} AND one_out_storage_id = #{oneOutStorageId}
AND material_id = #{materialId} AND material_id = #{materialId}
@ -51,40 +51,46 @@
</select> </select>
<select id="selectByOneOutStorageIds" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail"> <select id="selectByOneOutStorageIds" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail">
SELECT SELECT
material_id, a.material_id,
material_code, a.material_code,
material_name, a.material_name,
model, a.model,
`type`, a.`type`,
unit, a.unit,
application_quantity, a.application_quantity,
ld_demand_end_id, a.ld_demand_end_id,
SUM(outbound_quantity) as outbound_quantity a.one_form_id,
FROM ld_one_out_storage_detail c.num,
where one_out_storage_id in SUM(a.outbound_quantity) as outbound_quantity
FROM ld_one_out_storage_detail a left join ld_one_out_storage b on a.one_out_storage_id = b.id
left join ld_one_form c on a.one_form_id = c.id
where b.status = 3
and a.one_out_storage_id in
<foreach collection="oneOutStorageIds" item="id" open="(" separator="," close=")"> <foreach collection="oneOutStorageIds" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
GROUP BY material_id,material_code, material_name, model, `type`, unit, application_quantity,ld_demand_end_id GROUP BY a.material_id,a.material_code, a.material_name, a.model, a.`type`, a.unit, a.application_quantity,a.ld_demand_end_id
ORDER BY material_code; ORDER BY a.material_code;
</select> </select>
<select id="selectByDemandEndId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail"> <select id="selectByDemandEndId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail">
select select
<include refid="baseColumnList" /> <include refid="baseColumnList" />
from ld_one_out_storage_detail from ld_one_out_storage_detail a left join ld_one_out_storage b on a.one_out_storage_id = b.id
where ld_demand_end_id = #{ldDemandEndId}; where b.status = 3
and ld_demand_end_id = #{ldDemandEndId};
</select> </select>
<select id="selectByOneOutStorageId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail"> <select id="selectByOneOutStorageId" resultType="com.nov.KgLowDurable.pojo.entity.LdOneOutStorageDetail">
SELECT SELECT
<include refid="baseColumnList" /> <include refid="baseColumnList" />
FROM ld_one_out_storage_detail FROM ld_one_out_storage_detail a
WHERE one_out_storage_id = #{oneOutStorageId} WHERE one_out_storage_id = #{oneOutStorageId}
</select> </select>
<select id="selectByOneOutId" resultType="com.nov.KgLowDurable.pojo.vo.LdOneOutStorageDetailVO"> <select id="selectByOneOutId" resultType="com.nov.KgLowDurable.pojo.vo.LdOneOutStorageDetailVO">
SELECT SELECT
<include refid="baseColumnList" /> <include refid="baseColumnList" />,b.num
FROM ld_one_out_storage_detail FROM ld_one_out_storage_detail a
WHERE one_out_storage_id = #{oneOutStorageId} left join ld_one_form b on a.one_form_id = b.id
WHERE a.one_out_storage_id = #{oneOutStorageId}
</select> </select>

@ -76,7 +76,6 @@
material_name, material_name,
material_code, material_code,
model, model,
type,
unit, unit,
required_quantity, required_quantity,
SUM(inbound_quantity) as inbound_quantity SUM(inbound_quantity) as inbound_quantity
@ -92,7 +91,6 @@
material_name, material_name,
material_code, material_code,
model, model,
type,
unit, unit,
required_quantity required_quantity
ORDER BY ld_purchase_end_id, material_id; ORDER BY ld_purchase_end_id, material_id;

@ -26,9 +26,24 @@
SELECT SELECT
<include refid="baseColumnList" /> <include refid="baseColumnList" />
FROM ld_purchase_end FROM ld_purchase_end
<if test="purchaseNo != null and purchaseNo !=''"> <where>
WHERE purchase_no LIKE CONCAT('%', #{purchaseNo}, '%') <if test="purchaseNo != null and purchaseNo !=''">
</if> and purchase_no LIKE CONCAT('%', #{purchaseNo}, '%')
</if>
<if test="materialName != null and materialName !=''">
and material_name LIKE CONCAT('%', #{materialName}, '%')
</if>
<if test="model != null and model !=''">
and model LIKE CONCAT('%', #{model}, '%')
</if>
<if test="year != null and year !=''">
and year = #{year}
</if>
<if test="quarter != null and quarter !=''">
and quarter = #{quarter}
</if>
</where>
</select> </select>
<select id="getAllQuarters" resultType="com.nov.KgLowDurable.pojo.vo.QuarterVO"> <select id="getAllQuarters" resultType="com.nov.KgLowDurable.pojo.vo.QuarterVO">

Loading…
Cancel
Save