9 changed files with 157 additions and 191 deletions
@ -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); |
|
||||
} |
|
@ -1,7 +1,7 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?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"> |
<!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"> |
<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