代码提交
This commit is contained in:
parent
e58a0cebd3
commit
877c06a088
|
|
@ -98,6 +98,7 @@ public class PushProDataUseInfoController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
// 竣工未退预警数量
|
||||
@GetMapping(value = "getCompletionNotRefunded")
|
||||
public AjaxResult getCompletionNotRefunded(ProIdsBean bean) {
|
||||
try {
|
||||
|
|
@ -110,14 +111,14 @@ public class PushProDataUseInfoController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
//竣工未退预警数量
|
||||
//竣工未退预警总量
|
||||
@GetMapping(value = "getCompletionNotRefundedNum")
|
||||
public AjaxResult getCompletionNotRefundedNum(ProIdsBean bean) {
|
||||
try {
|
||||
List<MachineInfoBean> results = service.getCompletionNotRefunded(bean);
|
||||
BigDecimal totalNum = new BigDecimal(0);
|
||||
for (MachineInfoBean completionNotRefundedDetail : results) {
|
||||
totalNum.add(completionNotRefundedDetail.getNum());
|
||||
totalNum = totalNum.add(completionNotRefundedDetail.getNum());
|
||||
}
|
||||
return AjaxResult.success(totalNum);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -45,5 +45,7 @@ public class MachineInfoBean {
|
|||
private String maCode;
|
||||
// 剩余到期天数
|
||||
private Integer daysDiff;
|
||||
// 竣工时间
|
||||
private String actualEndDate;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ public class ProIdsBean {
|
|||
private String proName;
|
||||
private Integer typeId;
|
||||
private String typeName;
|
||||
private String typeModelName;
|
||||
private String deptName;
|
||||
private String proCenter;
|
||||
private Integer deptId;
|
||||
private BigDecimal typeNum;
|
||||
// 1 牵张设备 2 抱杆 3动力设备 4 变电专业设备 5安全工器具 6自主创新设备 7其他
|
||||
private Integer isStatics;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bp.pro_name as proName,
|
||||
sum(sai.num) typeNum,
|
||||
mt2.type_id as typeId,
|
||||
mt2.is_statics as isStatics,
|
||||
bp.pro_id as proId
|
||||
from slt_agreement_info sai
|
||||
left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id
|
||||
|
|
@ -35,7 +36,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sai.num as num,
|
||||
mm.assets_code as assetsCode,
|
||||
mt.rent_price as rentPrice,
|
||||
mm.keeper_name as typeKeeperName,
|
||||
'在用' as status
|
||||
from slt_agreement_info sai
|
||||
left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id
|
||||
|
|
@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
GROUP BY bp.pro_id
|
||||
</select>
|
||||
<select id="getTypeKeeperName" resultType="java.lang.String">
|
||||
select su.nick_name from ma_type_keeper mtk
|
||||
select group_concat(su.nick_name) from ma_type_keeper mtk
|
||||
left join sys_user su on mtk.user_id = su.user_id
|
||||
where mtk.type_id = #{typeId}
|
||||
</select>
|
||||
|
|
@ -174,18 +174,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN bm_project bp ON bai.project_id = bp.pro_id
|
||||
LEFT JOIN ma_type mt ON sai.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||
where 1=1
|
||||
where mm.next_check_time is not null
|
||||
<if test="proId != null">
|
||||
AND bp.pro_id = #{proId}
|
||||
</if>
|
||||
AND mm.next_check_time IS NOT NULL
|
||||
<if test="proId != null">
|
||||
GROUP BY bp.pro_id
|
||||
</if>
|
||||
</select>
|
||||
<select id="getApproachingDetails" resultType="com.bonus.material.push.domain.MachineInfoBean">
|
||||
SELECT
|
||||
sd.dept_name,
|
||||
bp.pro_center,
|
||||
bp.pro_name,
|
||||
sd.dept_name as deptName,
|
||||
bp.pro_center as proCenter,
|
||||
bp.pro_name as proName,
|
||||
mt2.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
mt.unit_name as unit,
|
||||
|
|
@ -204,7 +206,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN sys_dept sd on bp.imp_unit = sd.dept_id
|
||||
LEFT JOIN ma_type mt ON sai.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||
WHERE mm.next_check_time IS NOT NULL
|
||||
WHERE mm.next_check_time is not null
|
||||
<if test="proId != null">
|
||||
AND bp.pro_id = #{proId}
|
||||
</if>
|
||||
|
|
@ -229,7 +231,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="typeModelName != null and typeModelName !=''">
|
||||
AND mt.type_name = #{typeModelName}
|
||||
</if>
|
||||
<if test="proId != null">
|
||||
GROUP BY bp.pro_id
|
||||
</if>
|
||||
</select>
|
||||
<select id="getCompletionNotRefunded" resultType="com.bonus.material.push.domain.MachineInfoBean">
|
||||
select
|
||||
|
|
@ -237,7 +241,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sum(sai.num) num,
|
||||
mt2.type_id as typeId,
|
||||
sd.dept_name as deptName,
|
||||
sd.dept_id
|
||||
sd.dept_id as deptId
|
||||
from slt_agreement_info sai
|
||||
left join bm_agreement_info bai on sai.agreement_id = bai.agreement_id
|
||||
left join bm_project bp on bai.project_id = bp.pro_id
|
||||
|
|
@ -248,14 +252,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="proId != null">
|
||||
AND bp.pro_id = #{proId}
|
||||
</if>
|
||||
GROUP BY bp.pro_id,bp.imp_unit
|
||||
GROUP BY
|
||||
<if test="proId != null">
|
||||
bp.pro_id,
|
||||
</if>
|
||||
bp.imp_unit
|
||||
</select>
|
||||
<select id="getCompletionNotRefundedDetails" resultType="com.bonus.material.push.domain.MachineInfoBean">
|
||||
select
|
||||
bp.pro_name as proName,
|
||||
bp.pro_center as proCenter,
|
||||
bp.actual_end_date as actualEndDate,
|
||||
DATEDIFF(NOW(), bp.actual_end_date) as daysDiff,
|
||||
sum(sai.num) num,
|
||||
mt.type_name as typeModelName,
|
||||
mt.unit_name as unit,
|
||||
mt2.type_name as typeName,
|
||||
sd.dept_name as deptName
|
||||
from slt_agreement_info sai
|
||||
|
|
@ -284,7 +295,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="typeModelName != null and typeModelName !=''">
|
||||
AND mt.type_name = #{typeModelName}
|
||||
</if>
|
||||
GROUP BY bp.pro_id,bp.imp_unit
|
||||
GROUP BY
|
||||
<if test="proId != null">
|
||||
bp.pro_id,
|
||||
</if>
|
||||
bp.imp_unit
|
||||
</select>
|
||||
<select id="getInventoryAlert" resultType="com.bonus.material.push.domain.InventoryAlertBean">
|
||||
select
|
||||
|
|
@ -296,6 +311,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from ma_type mt
|
||||
left join ma_type mt2 on mt.parent_id = mt2.type_id
|
||||
where mt2.is_statics in (1,2,3,4,5,6,7)
|
||||
and mt.warn_num - mt.storage_num > 0
|
||||
<if test="typeName != null and typeName !=''">
|
||||
AND mt2.type_name = #{typeName}
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue