代码提交
This commit is contained in:
parent
3c694f2fd9
commit
5bd24cec66
|
|
@ -25,7 +25,6 @@ import org.springframework.stereotype.Service;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
@ -198,7 +197,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private BigDecimal computeScoreByMaName(BigDecimal ordercount,List<Ownerdomin> owns, DeptConfigRateSummary config) {
|
private BigDecimal computeScoreByMaName(BigDecimal ordercount,List<Ownerdomin> owns, DeptConfigRateSummary config) {
|
||||||
if (config == null || owns == null || owns.isEmpty()) return BigDecimal.ZERO;
|
if (config == null || owns == null || owns.isEmpty()) return BigDecimal.ZERO;
|
||||||
|
|
||||||
BigDecimal ownedTotal = BigDecimal.ZERO;
|
BigDecimal ownedTotal = BigDecimal.ZERO;
|
||||||
|
|
@ -232,7 +231,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||||
} else {
|
} else {
|
||||||
return rate.multiply(score).setScale(2, RoundingMode.HALF_UP);
|
return rate.multiply(score).setScale(2, RoundingMode.HALF_UP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeptConfigTypeSummary> selectDeptConfigTypeSummary(DeptConfigTypeSummary entity) {
|
public List<DeptConfigTypeSummary> selectDeptConfigTypeSummary(DeptConfigTypeSummary entity) {
|
||||||
|
|
@ -356,4 +355,3 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||||
return getChildList(list, t).size() > 0 ? true : false;
|
return getChildList(list, t).size() > 0 ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,7 @@
|
||||||
<result property="adminUserId" column="admin_user_id" />
|
<result property="adminUserId" column="admin_user_id" />
|
||||||
<result property="initPassword" column="init_password" />
|
<result property="initPassword" column="init_password" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="selectDeptTree">
|
|
||||||
SELECT * FROM sys_dept WHERE del_flag = '0' ORDER BY parent_id, order_num
|
|
||||||
</select>
|
|
||||||
<select id="selectDeptList" parameterType="com.bonus.system.api.domain.SysDept" resultMap="SysDeptResult">
|
<select id="selectDeptList" parameterType="com.bonus.system.api.domain.SysDept" resultMap="SysDeptResult">
|
||||||
<include refid="selectDeptVo"/>
|
<include refid="selectDeptVo"/>
|
||||||
where d.del_flag = '0'
|
where d.del_flag = '0'
|
||||||
|
|
@ -106,15 +104,24 @@
|
||||||
SELECT
|
SELECT
|
||||||
my.type_name AS deptName,
|
my.type_name AS deptName,
|
||||||
sd.dept_name AS companyName,
|
sd.dept_name AS companyName,
|
||||||
mdc.dept_id AS companyId,
|
grouped.dept_id AS companyId,
|
||||||
mdc.config_type AS configType,
|
grouped.config_type AS configType,
|
||||||
mdc.config_value AS configValue,
|
grouped.config_value AS configValue,
|
||||||
mdc.config_rate AS configRate,
|
grouped.config_rate AS configRate,
|
||||||
IFNULL(order_stat.order_count, 0) AS orderCount
|
IFNULL(order_stat.order_count, 0) AS orderCount
|
||||||
FROM
|
FROM
|
||||||
ma_dept_config mdc
|
(
|
||||||
LEFT JOIN sys_dept sd ON sd.dept_id = mdc.dept_id
|
SELECT
|
||||||
LEFT JOIN ma_type my ON my.type_id = mdc.type_id
|
dept_id,
|
||||||
|
type_id,
|
||||||
|
config_type,
|
||||||
|
SUM(config_value) AS config_value,
|
||||||
|
SUM(config_rate) AS config_rate
|
||||||
|
FROM ma_dept_config
|
||||||
|
GROUP BY dept_id, type_id, config_type
|
||||||
|
) grouped
|
||||||
|
LEFT JOIN sys_dept sd ON sd.dept_id = grouped.dept_id
|
||||||
|
LEFT JOIN ma_type my ON my.type_id = grouped.type_id
|
||||||
|
|
||||||
-- 设备订单数量子查询
|
-- 设备订单数量子查询
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
|
|
@ -131,12 +138,9 @@
|
||||||
LEFT JOIN sys_dept sd ON moi.buyer_company = sd.dept_id
|
LEFT JOIN sys_dept sd ON moi.buyer_company = sd.dept_id
|
||||||
GROUP BY sd.dept_id, mt2.type_id
|
GROUP BY sd.dept_id, mt2.type_id
|
||||||
) order_stat
|
) order_stat
|
||||||
ON order_stat.dept_id = mdc.dept_id
|
ON order_stat.dept_id = grouped.dept_id
|
||||||
AND order_stat.parent_type_id = mdc.type_id
|
AND order_stat.parent_type_id = grouped.type_id
|
||||||
|
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="selectDeptConfigTypeSummary"
|
<select id="selectDeptConfigTypeSummary"
|
||||||
resultType="com.bonus.material.equipment.domain.DeptConfigTypeSummary">
|
resultType="com.bonus.material.equipment.domain.DeptConfigTypeSummary">
|
||||||
|
|
@ -154,7 +158,7 @@
|
||||||
d.dept_id AS companyId,
|
d.dept_id AS companyId,
|
||||||
mt.type_name AS NAME,
|
mt.type_name AS NAME,
|
||||||
d.config_description as `desc`,
|
d.config_description as `desc`,
|
||||||
SUM(CAST(d.config_rate AS DECIMAL(10, 2))) AS `value`,
|
d.config_rate AS `value`,
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
CASE WHEN COUNT(1) > 0 THEN 1 ELSE 0 END
|
CASE WHEN COUNT(1) > 0 THEN 1 ELSE 0 END
|
||||||
|
|
@ -207,7 +211,7 @@
|
||||||
GROUP BY
|
GROUP BY
|
||||||
d.dept_id,
|
d.dept_id,
|
||||||
d.config_type,
|
d.config_type,
|
||||||
d.type_id;
|
d.type_id
|
||||||
</select>
|
</select>
|
||||||
<select id="listFromDevInfo" resultType="com.bonus.material.equipment.domain.NewmydevInfo">
|
<select id="listFromDevInfo" resultType="com.bonus.material.equipment.domain.NewmydevInfo">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -226,6 +230,9 @@
|
||||||
GROUP BY
|
GROUP BY
|
||||||
mt.type_id
|
mt.type_id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectDeptTree" resultType="com.bonus.material.equipment.domain.SysDept">
|
||||||
|
SELECT * FROM sys_dept WHERE del_flag = '0' ORDER BY parent_id, order_num
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue