Browse Source

Merge remote-tracking branch 'origin/dev_pyscreen' into dev_temp

master
yinzuomei 5 years ago
parent
commit
607e71f0f3
  1. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java
  2. 11
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java
  3. 21
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectGridDailyDao.xml
  4. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java

@ -39,5 +39,9 @@ public interface ScreenProjectGridDailyDao{
* @author yinzuomei
* @description 下级网格的效率解决率列表
**/
List<EfficiencyAnalysisResultDTO> queryGridEfficiencyAnalysis(@Param("customerId") String customerId, @Param("areaCode") String areaCode);
List<EfficiencyAnalysisResultDTO> queryGridEfficiencyAnalysis(@Param("customerId") String customerId,
@Param("areaCode") String areaCode,
@Param("dateId")String dateId);
String selectLastDateId(String customerId);
}

11
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java

@ -17,7 +17,10 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.alibaba.druid.util.StringUtils;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectGridDailyDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectGridDailyService;
@ -48,6 +51,12 @@ public class ScreenProjectGridDailyServiceImpl implements ScreenProjectGridDail
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
public List<EfficiencyAnalysisResultDTO> efficiencyAnalysis(String customerId, String areaCode) {
return screenProjectGridDailyDao.queryGridEfficiencyAnalysis(customerId,areaCode);
//先查询最后一次统计的dateId
String dateId=screenProjectGridDailyDao.selectLastDateId(customerId);
if(StringUtils.isEmpty(dateId)){
//如果为空,默认查询前一天
dateId= DateUtils.getBeforeNDay(NumConstant.ONE);
}
return screenProjectGridDailyDao.queryGridEfficiencyAnalysis(customerId,areaCode,dateId);
}
}

21
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectGridDailyDao.xml

@ -19,14 +19,19 @@
WHERE
m.DEL_FLAG = '0'
AND a.AREA_CODE LIKE concat( #{areaCode}, '%')
AND M.DATE_ID=(
select t1.DATE_ID from screen_project_grid_daily t1
where t1.DEL_FLAG='0'
and t1.CUSTOMER_ID=#{customerId}
order by t1.DATE_ID desc
limit 1
)
AND M.DATE_ID=#{dateId}
</select>
<select id="selectLastDateId" resultType="java.lang.String">
SELECT
t1.DATE_ID
FROM
screen_project_grid_daily t1
WHERE
t1.DEL_FLAG = '0'
AND t1.CUSTOMER_ID = #{customerId}
ORDER BY
t1.DATE_ID DESC
LIMIT 1
</select>
</mapper>

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml

@ -50,6 +50,6 @@
and t1.CUSTOMER_ID=#{customerId}
order by t1.DATE_ID desc
limit 1
)
)and m.customerId=#{customerId}
</select>
</mapper>
Loading…
Cancel
Save