@@ -1912,7 +1912,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
pmDemandReqVo.setDeptList(isQueryAll(pmDemandReqVo.getPurchaseDeptId()));
List<StatisticalChartsResVo> resVos = pmDemandMapper.countByProjectAttr(pmDemandReqVo);
for (StatisticalChartsResVo chartsResVo : resVos) {
- for (PmProjectStatus value : PmProjectStatus.values()) {
+ for (ProjectAttribute value : ProjectAttribute.values()) {
if (value.getCode().equals(chartsResVo.getColumnName())) {
chartsResVo.setColumnName(value.getInfo());
break;
@@ -93,11 +93,14 @@
resultType="com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo">
SELECT project_attr columnName, ifnull(COUNT(demand_id), 0) num, ifnull(sum(evaluation), 0) evaluationTotal
FROM `pm_demand`
- WHERE purchase_dept_id in
- <foreach collection="vo.deptList" item="item" index="index"
- separator="," open="(" close=")">
- #{item}
- </foreach>
+ <if test="vo.deptList != null and vo.deptList.size != 0 ">
+ WHERE purchase_dept_id
+ in
+ <foreach collection="vo.deptList" item="item" index="index"
+ separator="," open="(" close=")">
+ #{item}
+ </foreach>
+ </if>
GROUP BY project_attr
</select>