装备,工具租赁价批量修改
This commit is contained in:
parent
ca864ee291
commit
ff80946f86
|
|
@ -1,13 +1,11 @@
|
|||
package com.bonus.material.upOrDown.equipment.controller;
|
||||
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.material.upOrDown.equipment.domain.EquipmentEntity;
|
||||
import com.bonus.material.upOrDown.equipment.service.UpOrDownEquipmentService;
|
||||
import com.bonus.material.upOrDown.equipment.domain.EquipmentEntity;
|
||||
import com.bonus.material.upOrDown.tool.entity.ToolEntity;
|
||||
import com.bonus.material.upOrDown.tool.service.UpOrDownToolService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -79,14 +77,16 @@ public class UpOrDownEquipmentController extends BaseController {
|
|||
|
||||
/**
|
||||
* 批量上架
|
||||
* @param ids
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量上架装备")
|
||||
@PostMapping("/batch/up")
|
||||
public AjaxResult upToolBatch(@RequestBody List<Long> ids) {
|
||||
upOrDownEquipmentService.upEquipmentBatch(ids);
|
||||
return AjaxResult.success();
|
||||
public AjaxResult upToolBatch(@RequestBody List<EquipmentEntity> entity) {
|
||||
if (CollectionUtils.isEmpty(entity)) {
|
||||
return AjaxResult.warn("请选择要批量上架的装备");
|
||||
}
|
||||
return upOrDownEquipmentService.upEquipmentBatch(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
package com.bonus.material.upOrDown.equipment.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.material.devchange.domain.MaDevFile;
|
||||
import com.bonus.material.device.domain.vo.DevInfoPropertyVo;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -342,4 +340,10 @@ public class EquipmentEntity {
|
|||
|
||||
private String remainingStopYear;
|
||||
|
||||
@ApiModelProperty(value = "租赁单价")
|
||||
private BigDecimal leasePrice;
|
||||
|
||||
@ApiModelProperty(value = "是否改价")
|
||||
private Boolean isChangePrice;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,12 @@ public interface UpOrDownEquipmentMapper {
|
|||
|
||||
void downEquipmentById(Long equipmentId);
|
||||
|
||||
void upEquipmentBatch(List<Long> ids);
|
||||
/**
|
||||
* 批量修改装备上架状态及租赁价
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
int upEquipmentBatch(List<EquipmentEntity> list);
|
||||
|
||||
void downEquipmentBatch(List<Long> ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.upOrDown.equipment.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.upOrDown.equipment.domain.EquipmentEntity;
|
||||
import com.bonus.material.upOrDown.tool.entity.ToolEntity;
|
||||
|
||||
|
|
@ -11,7 +12,12 @@ public interface UpOrDownEquipmentService {
|
|||
|
||||
void downEquipmentById(Long equipmentId);
|
||||
|
||||
void upEquipmentBatch(List<Long> ids);
|
||||
/**
|
||||
* 批量修改装备上架状态及租赁价
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
AjaxResult upEquipmentBatch(List<EquipmentEntity> entity);
|
||||
|
||||
void downEquipmentBatch(List<Long> ids);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
package com.bonus.material.upOrDown.equipment.service.impl;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.upOrDown.equipment.domain.EquipmentEntity;
|
||||
import com.bonus.material.upOrDown.equipment.mapper.UpOrDownEquipmentMapper;
|
||||
import com.bonus.material.upOrDown.equipment.service.UpOrDownEquipmentService;
|
||||
import com.bonus.material.upOrDown.tool.entity.ToolEntity;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author 30791
|
||||
|
|
@ -15,6 +18,7 @@ import java.util.List;
|
|||
* Create by 2025/11/16 14:13
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class UpOrDownEquipmentServiceImpl implements UpOrDownEquipmentService {
|
||||
|
||||
@Resource
|
||||
|
|
@ -36,9 +40,31 @@ public class UpOrDownEquipmentServiceImpl implements UpOrDownEquipmentService {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改装备上架状态及租赁价
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void upEquipmentBatch(List<Long> ids) {
|
||||
upOrDownEquipmentMapper.upEquipmentBatch(ids) ;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult upEquipmentBatch(List<EquipmentEntity> entity) {
|
||||
try {
|
||||
entity.stream()
|
||||
.filter(Objects::nonNull)
|
||||
// 仅处理未修改价格的设备
|
||||
.filter(equipment -> !equipment.getIsChangePrice())
|
||||
.forEach(equipment -> {
|
||||
log.debug("设备ID:{} 未修改价格,置空leasePrice", equipment.getMaId());
|
||||
equipment.setLeasePrice(null);
|
||||
});
|
||||
int result = upOrDownEquipmentMapper.upEquipmentBatch(entity);
|
||||
if (result == 0) {
|
||||
throw new RuntimeException("批量上架失败");
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error("批量上架失败:{}", e.getMessage());
|
||||
}
|
||||
return AjaxResult.success("批量上架成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.upOrDown.tool.controller;
|
||||
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
|
|
@ -122,14 +123,16 @@ public class UpOrDownToolController extends BaseController {
|
|||
|
||||
/**
|
||||
* 批量上架
|
||||
* @param ids
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量上架工具")
|
||||
@PostMapping("/batch/up")
|
||||
public AjaxResult upToolBatch(@RequestBody List<Long> ids) {
|
||||
toolService.upToolBatch(ids);
|
||||
return AjaxResult.success();
|
||||
public AjaxResult upToolBatch(@RequestBody List<ToolEntity> entity) {
|
||||
if (CollectionUtils.isEmpty(entity)) {
|
||||
return AjaxResult.warn("请选择要批量上架的工具");
|
||||
}
|
||||
return toolService.upToolBatch(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.upOrDown.tool.entity;
|
|||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.material.device.domain.vo.DevInfoPropertyVo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
|
|
@ -186,4 +187,10 @@ public class ToolEntity {
|
|||
private String fileList;
|
||||
|
||||
private List<DevInfoPropertyVo> propertyVoList;
|
||||
|
||||
@ApiModelProperty(value = "租赁单价")
|
||||
private BigDecimal leasePrice;
|
||||
|
||||
@ApiModelProperty(value = "是否改价")
|
||||
private Boolean isChangePrice;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,12 @@ public interface UpOrDownToolMapper {
|
|||
|
||||
List<ToolEntity> listByCode(ToolEntity entity);
|
||||
|
||||
int upToolBatch(List<Long> ids);
|
||||
/**
|
||||
* 批量修改工具上架及租赁价
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
int upToolBatch(List<ToolEntity> list);
|
||||
|
||||
int downToolBatch(List<Long> ids);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,12 @@ public interface UpOrDownToolService {
|
|||
|
||||
AjaxResult upToolByCode(ToolEntity entity);
|
||||
|
||||
|
||||
void upToolBatch(List<Long> ids);
|
||||
/**
|
||||
* 批量修改工具上架及租赁价
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
AjaxResult upToolBatch(List<ToolEntity> entity);
|
||||
|
||||
void downToolBatch(List<Long> ids);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,13 @@ import com.bonus.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.material.upOrDown.tool.entity.ToolEntity;
|
||||
import com.bonus.material.upOrDown.tool.mapper.UpOrDownToolMapper;
|
||||
import com.bonus.material.upOrDown.tool.service.UpOrDownToolService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author 30791
|
||||
|
|
@ -16,6 +19,7 @@ import java.util.List;
|
|||
*/
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class UpOrDownToolServiceImpl implements UpOrDownToolService {
|
||||
|
||||
@Resource
|
||||
|
|
@ -51,9 +55,31 @@ public class UpOrDownToolServiceImpl implements UpOrDownToolService {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量修改工具上架及租赁价
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void upToolBatch(List<Long> ids) {
|
||||
upOrDownToolMapper.upToolBatch(ids) ;
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult upToolBatch(List<ToolEntity> entity) {
|
||||
try {
|
||||
entity.stream()
|
||||
.filter(Objects::nonNull)
|
||||
// 仅处理未修改价格的工具
|
||||
.filter(equipment -> !equipment.getIsChangePrice())
|
||||
.forEach(equipment -> {
|
||||
log.debug("工具ID:{} 未修改价格,置空leasePrice", equipment.getId());
|
||||
equipment.setLeasePrice(null);
|
||||
});
|
||||
int result = upOrDownToolMapper.upToolBatch(entity);
|
||||
if (result == 0) {
|
||||
throw new RuntimeException("批量上架失败");
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error("批量上架失败:{}", e.getMessage());
|
||||
}
|
||||
return AjaxResult.success("批量上架成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.create_time as createTime,
|
||||
d.up_down_status as upDownStatus,
|
||||
bcd.order_user as orderUser,
|
||||
bcd.address as address
|
||||
bcd.address as address,
|
||||
COALESCE(d.lease_price, mt.lease_price) as dayLeasePrice
|
||||
FROM ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = d.on_company
|
||||
LEFT JOIN bm_company_info c ON d.on_company = c.company_id
|
||||
|
|
@ -81,7 +82,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
tt.create_time as createTime,
|
||||
tl.up_down_status AS upDownStatus,
|
||||
bcd.order_user as orderUser,
|
||||
bcd.address as address
|
||||
bcd.address as address,
|
||||
COALESCE(tl.lease_price, tt.lease_price) AS dayLeasePrice
|
||||
FROM
|
||||
tool_ledger tl
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = tl.company_id
|
||||
|
|
|
|||
|
|
@ -77,10 +77,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.update_time AS updateTime, -- 第23列
|
||||
d.on_company AS companyId, -- 第24列
|
||||
sd.dept_name AS companyName, -- 第25列
|
||||
c.operate_address AS operateAddress -- 第26列
|
||||
c.operate_address AS operateAddress, -- 第26列
|
||||
COALESCE(d.lease_price, mt.lease_price) AS dayLeasePrice
|
||||
FROM
|
||||
ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.on_company = sd.dept_id
|
||||
LEFT JOIN ma_type mt ON d.type_id = mt.type_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
INNER JOIN ma_type_view mtv ON mtv.typeId = d.type_id
|
||||
LEFT JOIN bm_file_info bfi ON d.ma_id = bfi.model_id AND bfi.file_type = '0' AND bfi.task_type = '17'
|
||||
|
|
@ -171,7 +173,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
tl.update_time AS updateTime, -- 23. 对应 updateTime
|
||||
tl.company_id AS companyId, -- 24. 对应 companyId
|
||||
sd.dept_name AS companyName, -- 25. 对应 companyName
|
||||
c.operate_address AS operateAddress -- 26. 对应 operateAddress(列数对齐!)
|
||||
c.operate_address AS operateAddress, -- 26. 对应 operateAddress(列数对齐!)
|
||||
COALESCE(tl.lease_price, tt.lease_price) AS dayLeasePrice
|
||||
FROM
|
||||
tool_ledger tl
|
||||
LEFT JOIN sys_dept sd ON tl.company_id = sd.dept_id
|
||||
|
|
@ -284,7 +287,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
d.create_time as createTime,
|
||||
d.update_time as updateTime,
|
||||
d.expiration_time,
|
||||
d.entry_status
|
||||
d.entry_status,
|
||||
COALESCE(d.lease_price, mt4.lease_price) as dayLeasePrice
|
||||
FROM ma_dev_info d
|
||||
LEFT JOIN sys_dept sd ON d.on_company = sd.dept_id
|
||||
LEFT JOIN bm_company_info c ON sd.dept_id = c.company_id
|
||||
|
|
@ -1625,7 +1629,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
tl.company_id AS companyId, -- 24. 对应 companyId
|
||||
sd.dept_name AS companyName, -- 25. 对应 companyName
|
||||
c.operate_address AS operateAddress, -- 26. 对应 operateAddress(列数对齐!)
|
||||
tt.create_time AS companyCreateTime
|
||||
tt.create_time AS companyCreateTime,
|
||||
COALESCE(tl.lease_price, tt.lease_price) AS dayLeasePrice
|
||||
|
||||
FROM tool_ledger tl
|
||||
LEFT JOIN sys_dept sd ON tl.company_id = sd.dept_id
|
||||
|
|
|
|||
|
|
@ -253,12 +253,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
CASE
|
||||
WHEN DATE(hh.rent_over_time) = DATE(hh.pre_outbound_time) THEN 1
|
||||
ELSE TIMESTAMPDIFF(DAY, hh.pre_outbound_time, hh.rent_over_time) + 1
|
||||
END AS dateDays
|
||||
END AS dateDays,
|
||||
COALESCE(mdi.lease_price, mt.lease_price) as dayLeasePrice
|
||||
FROM ma_order_details hh
|
||||
LEFT JOIN ma_order_info moi ON hh.order_id = moi.order_id
|
||||
LEFT JOIN ma_dev_info mdi ON hh.ma_id = mdi.ma_id
|
||||
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
|
||||
LEFT JOIN bm_file_info bfi ON hh.ma_id = bfi.model_id and bfi.task_type = 17 and bfi.file_type = 0
|
||||
left join ma_type mt ON mdi.type_id = mt.type_id
|
||||
AND bfi.file_type = 0
|
||||
WHERE hh.id = #{id}
|
||||
and hh.devType = '0'
|
||||
|
|
@ -292,7 +293,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
CASE
|
||||
WHEN DATE(hh.rent_over_time) = DATE(hh.pre_outbound_time) THEN 1
|
||||
ELSE TIMESTAMPDIFF(DAY, hh.pre_outbound_time, hh.rent_over_time) + 1
|
||||
END AS dateDays
|
||||
END AS dateDays,
|
||||
COALESCE(mdi.lease_price, tt.lease_price) AS leasePrice
|
||||
FROM ma_order_details hh
|
||||
LEFT JOIN ma_order_info moi ON hh.order_id = moi.order_id
|
||||
LEFT JOIN tool_ledger mdi ON hh.ma_id = mdi.id
|
||||
|
|
|
|||
|
|
@ -81,14 +81,19 @@
|
|||
</update>
|
||||
|
||||
<update id="upEquipmentBatch">
|
||||
UPDATE
|
||||
ma_dev_info
|
||||
UPDATE ma_dev_info
|
||||
SET
|
||||
up_down_status = 1
|
||||
up_down_status = 1,
|
||||
lease_price = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN ma_id = #{item.maId} THEN #{item.leasePrice}
|
||||
</foreach>
|
||||
ELSE lease_price
|
||||
END
|
||||
WHERE
|
||||
ma_id IN
|
||||
<foreach collection="list" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.maId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
|
@ -143,9 +148,11 @@
|
|||
mdi.max_working_hours AS maxServiceLifeYears,
|
||||
0 AS repairCount,
|
||||
0 AS usageCount,
|
||||
sc.name AS province
|
||||
sc.name AS province,
|
||||
COALESCE(mdi.lease_price, mt.lease_price) AS leasePrice
|
||||
from ma_dev_info mdi
|
||||
INNER JOIN ma_type_view mtv ON mtv.typeId = mdi.type_id
|
||||
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
|
||||
LEFT JOIN jj_sing_project jsp ON mdi.on_project = jsp.pro_code
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.on_company
|
||||
LEFT JOIN (SELECT max( next_check_time) next_check_time,ma_id from ma_dev_qc GROUP BY ma_id ) mdq on
|
||||
|
|
@ -239,9 +246,11 @@
|
|||
mdi.max_working_hours AS maxServiceLifeYears,
|
||||
0 AS repairCount,
|
||||
0 AS usageCount,
|
||||
sc.name AS province
|
||||
sc.name AS province,
|
||||
COALESCE(mdi.lease_price, mt.lease_price) AS leasePrice
|
||||
from ma_dev_info mdi
|
||||
INNER JOIN ma_type_view mtv ON mtv.typeId = mdi.type_id
|
||||
LEFT JOIN ma_type mt ON mdi.type_id = mt.type_id
|
||||
LEFT JOIN jj_sing_project jsp ON mdi.on_project = jsp.pro_code
|
||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.on_company
|
||||
LEFT JOIN (SELECT max( next_check_time) next_check_time,ma_id from ma_dev_qc GROUP BY ma_id ) mdq on
|
||||
|
|
|
|||
|
|
@ -2,14 +2,19 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.material.upOrDown.tool.mapper.UpOrDownToolMapper">
|
||||
<update id="upToolBatch">
|
||||
UPDATE
|
||||
tool_ledger
|
||||
UPDATE tool_ledger
|
||||
SET
|
||||
up_down_status = 1
|
||||
up_down_status = 1,
|
||||
lease_price = CASE
|
||||
<foreach collection="list" item="item" separator="">
|
||||
WHEN id = #{item.id} THEN #{item.leasePrice}
|
||||
</foreach>
|
||||
ELSE lease_price
|
||||
END
|
||||
WHERE
|
||||
id IN
|
||||
<foreach collection="list" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||
#{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
|
@ -47,7 +52,8 @@
|
|||
SUM(COALESCE ( tl.in_num, 0 )) AS inNum,
|
||||
SUM(COALESCE ( tl.scrap_num, 0 )) AS scrapNum,
|
||||
SUM(COALESCE ( tl.repair_num, 0 )) AS repairNum,
|
||||
SUM(COALESCE ( tl.total_num, 0 )) AS totalNum
|
||||
SUM(COALESCE ( tl.total_num, 0 )) AS totalNum,
|
||||
COALESCE(tl.lease_price, tt.lease_price) AS leasePrice
|
||||
FROM
|
||||
tool_type tt
|
||||
LEFT JOIN tool_ledger tl ON tl.type_id = tt.type_id
|
||||
|
|
@ -104,7 +110,8 @@
|
|||
SUM(COALESCE ( tl.in_num, 0 )) AS inNum,
|
||||
SUM(COALESCE ( tl.scrap_num, 0 )) AS scrapNum,
|
||||
SUM(COALESCE ( tl.repair_num, 0 )) AS repairNum,
|
||||
SUM(COALESCE ( tl.total_num, 0 )) AS totalNum
|
||||
SUM(COALESCE ( tl.total_num, 0 )) AS totalNum,
|
||||
COALESCE(tl.lease_price, tt.lease_price) AS leasePrice
|
||||
FROM
|
||||
tool_type tt
|
||||
LEFT JOIN tool_ledger tl ON tl.type_id = tt.type_id
|
||||
|
|
@ -167,7 +174,8 @@
|
|||
SUM(COALESCE ( tl.in_num, 0 )) AS inNum,
|
||||
SUM(COALESCE ( tl.scrap_num, 0 )) AS scrapNum,
|
||||
SUM(COALESCE ( tl.repair_num, 0 )) AS repairNum,
|
||||
SUM(COALESCE ( tl.total_num, 0 )) AS totalNum
|
||||
SUM(COALESCE ( tl.total_num, 0 )) AS totalNum,
|
||||
COALESCE(tl.lease_price, tt.lease_price) AS leasePrice
|
||||
FROM
|
||||
tool_type tt
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue