33 changed files with 451 additions and 294 deletions
@ -0,0 +1,43 @@ |
|||
package com.epmet.dto.screencoll; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 大屏采集通用入参 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/9/9 10:25 |
|||
*/ |
|||
@Data |
|||
public class ScreenCollFormDTO<T> implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 4605543711669000348L; |
|||
/** |
|||
* 当为true时后台将先删除当前维度的数据,后新增 |
|||
*/ |
|||
private Boolean isFirst; |
|||
|
|||
/** |
|||
* 日期Id, 数据更新至:yyyyMMdd |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* yyyyMM |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 数据集合 |
|||
*/ |
|||
private List<T> dataList; |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return JSON.toJSONString(this); |
|||
} |
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* 孔村大屏数据采集api |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/9/9 10:18 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("kcscreencoll") |
|||
public class KcScreenCollController { |
|||
} |
@ -1,77 +0,0 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao.evaluationindex.screen; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.screen.FactIndexGridScoreDTO; |
|||
import com.epmet.dto.screen.result.SubGridAvgResultDTO; |
|||
import com.epmet.entity.evaluationindex.screen.FactIndexGridScoreEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 网格相关分值 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-08-28 |
|||
*/ |
|||
@Mapper |
|||
public interface FactIndexGridScoreDao extends BaseDao<FactIndexGridScoreEntity> { |
|||
|
|||
/** |
|||
* @Description 下属所有网格的平均值 |
|||
* @param customerId |
|||
* @param monthId |
|||
* @author zxc |
|||
* @date 2020/8/28 3:20 下午 |
|||
*/ |
|||
List<SubGridAvgResultDTO> selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); |
|||
|
|||
/** |
|||
* 根据入参查询 网格相关分值记录 |
|||
* @param customerId |
|||
* @param monthId |
|||
* @return java.util.List<com.epmet.dto.screen.FactIndexGridScoreDTO> |
|||
* @Author zhangyong |
|||
* @Date 10:43 2020-09-03 |
|||
**/ |
|||
List<FactIndexGridScoreDTO> selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId); |
|||
|
|||
/** |
|||
* 根据入参查询 网格id |
|||
* @param customerId |
|||
* @param monthId |
|||
* @return java.util.List<java.util.String> |
|||
* @Author zhangyong |
|||
* @Date 10:43 2020-09-03 |
|||
**/ |
|||
List<String> selectListGridId(@Param("customerId")String customerId, @Param("monthId")String monthId); |
|||
|
|||
/** |
|||
* 批量插入 网格相关分值表 |
|||
* |
|||
* @param list |
|||
* @param customerId |
|||
* @return void |
|||
* @Author zhangyong |
|||
* @Date 11:11 2020-09-04 |
|||
**/ |
|||
void batchInsertGridScoreData(@Param("list") List<FactIndexGridScoreDTO> list,@Param("customerId")String customerId); |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.epmet.support.normalizing.batch; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @author liujianjun |
|||
*/ |
|||
@Data |
|||
@AllArgsConstructor |
|||
public class IndexScoreVo implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 65642416224721650L; |
|||
/** |
|||
* 指标code |
|||
*/ |
|||
private String indexCode; |
|||
/** |
|||
* 所有指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allParentIndexCode; |
|||
/** |
|||
* 分值 |
|||
*/ |
|||
private BigDecimal score; |
|||
|
|||
|
|||
} |
@ -1,7 +1,7 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.evaluationindex.screen.FactIndexCommunityScoreDao"> |
|||
<mapper namespace="com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao"> |
|||
|
|||
<!-- 党建能力【社区】中间表插入 --> |
|||
<insert id="insertCommunityPartyRecord"> |
@ -1,103 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.evaluationindex.screen.FactIndexGridScoreDao"> |
|||
|
|||
<!-- 下属所有网格的平均值 --> |
|||
<select id="selectSubGridAvgScore" resultType="com.epmet.dto.screen.result.SubGridAvgResultDTO"> |
|||
SELECT |
|||
figc.agency_id AS agencyId, |
|||
figc.month_id as monthId, |
|||
figc.quarter_id as quarterId, |
|||
figc.year_id as yearId, |
|||
ROUND(AVG( figc.score ),6) AS score, |
|||
figc.customer_id as customerId, |
|||
sca.pid AS parentId |
|||
FROM |
|||
fact_index_grid_score figc |
|||
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = figc.AGENCY_ID |
|||
WHERE |
|||
figc.del_flag = '0' |
|||
AND sca.DEL_FLAG = 0 |
|||
AND figc.customer_id = #{customerId} |
|||
AND figc.month_id = #{monthId} |
|||
AND figc.index_code = #{indexCode} |
|||
GROUP BY figc.agency_id |
|||
</select> |
|||
|
|||
<select id="selectListGridScore" resultType="com.epmet.dto.screen.FactIndexGridScoreDTO"> |
|||
SELECT |
|||
CUSTOMER_ID customerId, |
|||
GRID_ID gridId, |
|||
AGENCY_ID agencyId, |
|||
YEAR_ID yearId, |
|||
MONTH_ID monthId, |
|||
IS_TOTAL isTotal, |
|||
SCORE score, |
|||
INDEX_CODE indexCode |
|||
FROM |
|||
fact_index_grid_score |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
ORDER BY GRID_ID |
|||
</select> |
|||
|
|||
<insert id="batchInsertGridScoreData" parameterType="map"> |
|||
insert into fact_index_grid_score |
|||
( |
|||
ID, |
|||
CUSTOMER_ID, |
|||
GRID_ID, |
|||
AGENCY_ID, |
|||
ALL_PARENT_IDS, |
|||
QUARTER_ID, |
|||
YEAR_ID, |
|||
MONTH_ID, |
|||
IS_TOTAL, |
|||
SCORE, |
|||
INDEX_CODE, |
|||
DEL_FLAG, |
|||
REVISION, |
|||
CREATED_BY, |
|||
CREATED_TIME, |
|||
UPDATED_BY, |
|||
UPDATED_TIME |
|||
) values |
|||
<foreach collection="list" item="item" index="index" separator=","> |
|||
( |
|||
(SELECT REPLACE(UUID(), '-', '') AS id), |
|||
#{customerId}, |
|||
#{item.gridId}, |
|||
#{item.agencyId}, |
|||
#{item.allParentIds}, |
|||
#{item.quarterId}, |
|||
|
|||
#{item.yearId}, |
|||
#{item.monthId}, |
|||
#{item.isTotal}, |
|||
#{item.score}, |
|||
#{item.indexCode}, |
|||
#{item.delFlag}, |
|||
0, |
|||
'APP_USER', |
|||
now(), |
|||
'APP_USER', |
|||
now() |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
<select id="selectListGridId" resultType="String"> |
|||
SELECT |
|||
GRID_ID gridId |
|||
FROM |
|||
fact_index_grid_score |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
ORDER BY GRID_ID |
|||
</select> |
|||
</mapper> |
Loading…
Reference in new issue