14 changed files with 1620 additions and 0 deletions
@ -0,0 +1,107 @@ |
|||
/** |
|||
* 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.indexcal; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.indexcal.AgencyScoreDTO; |
|||
import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; |
|||
import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; |
|||
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-09-02 |
|||
*/ |
|||
@Mapper |
|||
public interface AgencySubScoreDao extends BaseDao<AgencyScoreEntity> { |
|||
|
|||
/** |
|||
* @param lists |
|||
* @Description 【街道】中间表插入 |
|||
* @author zxc |
|||
* @date 2020/8/27 5:05 下午 |
|||
*/ |
|||
void insertStreetRecord(@Param("lists") List<AgencyScoreDTO> lists); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @param indexCode |
|||
* @Description 删除旧记录 |
|||
* @author zxc |
|||
* @date 2020/9/2 15:47 |
|||
*/ |
|||
void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode, @Param("dataType") String dataType); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @Description 查询【fact_index_agency_score】相关信息 |
|||
* @author zxc |
|||
* @date 2020/9/1 9:41 上午 |
|||
*/ |
|||
List<AgencyScoreDTO> selectAgencyScoreInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @Description 区下级街道得分平均值 |
|||
* @author zxc |
|||
* @date 2020/8/31 1:51 下午 |
|||
*/ |
|||
List<SubAgencyScoreAvgResultDTO> selectAgencyScoreAvg(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode, @Param("dataType") String dataType); |
|||
|
|||
|
|||
/** |
|||
* 根据入参查询 区/街道相关分数表 记录 |
|||
* |
|||
* @param customerId |
|||
* @param monthId |
|||
* @return java.util.List<com.epmet.dto.indexcal.AgencyScoreDTO> |
|||
* @Author zhangyong |
|||
* @Date 10:43 2020-09-03 |
|||
**/ |
|||
List<AgencyScoreDTO> selectListAgencyScore(@Param("customerId") String customerId, @Param("monthId") String monthId); |
|||
|
|||
/** |
|||
* 批量插入区/街道相关分数表 |
|||
* |
|||
* @param list |
|||
* @param customerId |
|||
* @return void |
|||
* @Author zhangyong |
|||
* @Date 11:11 2020-09-04 |
|||
**/ |
|||
void batchInsertAgencyScoreData(@Param("list") List<AgencyScoreEntity> list, @Param("customerId") String customerId); |
|||
|
|||
/** |
|||
* 根据入参查询 区/街道相关分数表id |
|||
* |
|||
* @param customerId |
|||
* @param monthId |
|||
* @return java.util.List<java.lang.String> |
|||
* @Author zhangyong |
|||
* @Date 10:43 2020-09-03 |
|||
**/ |
|||
List<String> selectListAgencyId(@Param("customerId") String customerId, @Param("monthId") String monthId); |
|||
} |
@ -0,0 +1,105 @@ |
|||
/** |
|||
* 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.indexcal; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; |
|||
import com.epmet.dto.screen.FactIndexCommunityScoreDTO; |
|||
import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; |
|||
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-31 |
|||
*/ |
|||
@Mapper |
|||
public interface CommunitySubScoreDao extends BaseDao<FactIndexCommunityScoreEntity> { |
|||
|
|||
/** |
|||
* @param lists |
|||
* @Description 【社区】中间表插入 |
|||
* @author zxc |
|||
* @date 2020/8/27 5:05 下午 |
|||
*/ |
|||
void insertCommunityPartyRecord(@Param("lists") List<FactIndexCommunityScoreDTO> lists); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @Description 删除旧记录 |
|||
* @author zxc |
|||
* @date 2020/9/1 9:03 上午 |
|||
*/ |
|||
void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @Description 查询社区相关信息 |
|||
* @author zxc |
|||
* @date 2020/9/1 9:41 上午 |
|||
*/ |
|||
List<FactIndexCommunityScoreDTO> selectCommunityInfo(@Param("customerId") String customerId, @Param("monthId") String monthId); |
|||
|
|||
/** |
|||
* 根据入参查询 查询社区相关信息 |
|||
* |
|||
* @param customerId |
|||
* @param monthId |
|||
* @return java.util.List<com.epmet.dto.screen.FactIndexCommunityScoreDTO> |
|||
* @Author zhangyong |
|||
* @Date 10:43 2020-09-03 |
|||
**/ |
|||
List<FactIndexCommunityScoreDTO> selectListCommunityScore(@Param("customerId") String customerId, @Param("monthId") String monthId); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @Description 街道下级所有社区得分平均值 |
|||
* @author zxc |
|||
* @date 2020/8/31 1:51 下午 |
|||
*/ |
|||
List<SubCommunityAvgResultDTO> selectSubCommAvgScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); |
|||
|
|||
/** |
|||
* 批量插入 社区相关分数表 |
|||
* |
|||
* @param list |
|||
* @param customerId |
|||
* @return void |
|||
* @Author zhangyong |
|||
* @Date 11:11 2020-09-04 |
|||
**/ |
|||
void batchInsertCommunityScoreData(@Param("list") List<FactIndexCommunityScoreEntity> list, @Param("customerId") String customerId); |
|||
|
|||
/** |
|||
* 根据入参查询 查询社区id |
|||
* |
|||
* @param customerId |
|||
* @param monthId |
|||
* @return java.util.List<java.util.String> |
|||
* @Author zhangyong |
|||
* @Date 10:43 2020-09-03 |
|||
**/ |
|||
List<String> selectListCommunityId(@Param("customerId") String customerId, @Param("monthId") String monthId); |
|||
} |
@ -0,0 +1,86 @@ |
|||
/** |
|||
* 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.indexcal; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.indexcal.CalculateCommonFormDTO; |
|||
import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 党员相关分值 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-08-31 |
|||
*/ |
|||
@Mapper |
|||
public interface CpcSubScoreDao extends BaseDao<CpcScoreEntity> { |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @param gridId |
|||
* @return java.math.BigDecimal |
|||
* @author yinzuomei |
|||
* @description 获取网格内党员的联系群众能力考评分(平均值) |
|||
* @Date 2020/8/31 10:56 |
|||
**/ |
|||
BigDecimal selectGridContactMassesAvgValue(@Param("customerId") String customerId, |
|||
@Param("monthId") String monthId, |
|||
@Param("gridId") String gridId); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return java.util.List<java.math.BigDecimal> |
|||
* @author yinzuomei |
|||
* @description 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 |
|||
* @Date 2020/8/31 12:10 |
|||
**/ |
|||
List<BigDecimal> selectListGridContactMassesAvgValue(CalculateCommonFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param calculateCommonFormDTO |
|||
* @return java.util.List<java.math.BigDecimal> |
|||
* @author yinzuomei |
|||
* @description 网格内党员的参与议事能力考评分(平均值) 最大值最小值 |
|||
* @Date 2020/8/31 14:42 |
|||
**/ |
|||
List<BigDecimal> selectListJoinIssueAvgValue(CalculateCommonFormDTO calculateCommonFormDTO); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @param gridId |
|||
* @return java.math.BigDecimal |
|||
* @author yinzuomei |
|||
* @description 组织内党员的参与议事能力考评分(平均值) |
|||
* @Date 2020/8/31 15:51 |
|||
**/ |
|||
BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); |
|||
|
|||
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); |
|||
|
|||
List<CpcScoreEntity> getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode); |
|||
|
|||
int insertBatch(@Param("list") Collection<CpcScoreEntity> values); |
|||
} |
@ -0,0 +1,92 @@ |
|||
/** |
|||
* 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.indexcal; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.indexcal.DeptScoreDTO; |
|||
import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; |
|||
import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; |
|||
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-09-02 |
|||
*/ |
|||
@Mapper |
|||
public interface DeptSubScoreDao extends BaseDao<DeptScoreEntity> { |
|||
|
|||
/** |
|||
* 根据入参查询 区直部门分值表 记录 |
|||
* |
|||
* @param customerId |
|||
* @param monthId |
|||
* @return java.util.List<com.epmet.dto.indexcal.DeptScoreDTO> |
|||
* @Author zhangyong |
|||
* @Date 10:43 2020-09-03 |
|||
**/ |
|||
List<DeptScoreDTO> selectListDeptScore(@Param("customerId") String customerId, @Param("monthId") String monthId); |
|||
|
|||
/** |
|||
* 批量插入 区直部门分值表 |
|||
* |
|||
* @param list |
|||
* @param customerId |
|||
* @return void |
|||
* @Author zhangyong |
|||
* @Date 11:11 2020-09-04 |
|||
**/ |
|||
void batchInsertDeptScoreData(@Param("list") List<DeptScoreEntity> list, @Param("customerId") String customerId); |
|||
|
|||
/** |
|||
* 根据入参查询 区直部门分值表id |
|||
* |
|||
* @param customerId |
|||
* @param monthId |
|||
* @return java.lang.String |
|||
* @Author zhangyong |
|||
* @Date 10:43 2020-09-03 |
|||
**/ |
|||
List<String> selectListDeptId(@Param("customerId") String customerId, @Param("monthId") String monthId); |
|||
|
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @param indexCode |
|||
* @Description 所有直属部门治理能力平均值 |
|||
* @author zxc |
|||
* @date 2020/9/4 10:53 上午 |
|||
*/ |
|||
List<SubAgencyScoreAvgResultDTO> selectGovernDeptScoreAvg(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @param deptId |
|||
* @return int |
|||
* @author yinzuomei |
|||
* @description |
|||
* @Date 2020/9/7 14:30 |
|||
**/ |
|||
int deleteByDeptIdAndMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("deptId") String deptId); |
|||
} |
@ -0,0 +1,114 @@ |
|||
/** |
|||
* 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.indexcal; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.indexcal.CalculateCommonFormDTO; |
|||
import com.epmet.dto.indexcal.GridScoreDTO; |
|||
import com.epmet.dto.screen.FactIndexGridScoreDTO; |
|||
import com.epmet.dto.screen.result.SubGridAvgResultDTO; |
|||
import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity; |
|||
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-31 |
|||
*/ |
|||
@Mapper |
|||
public interface GridSubScoreDao extends BaseDao<GridScoreEntity> { |
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @param indexCode |
|||
* @param isTotal 1:总分;0不是 |
|||
* @return int |
|||
* @author yinzuomei |
|||
* @description |
|||
* @Date 2020/8/31 14:00 |
|||
**/ |
|||
int deleteByCusAndMonthId(@Param("customerId") String customerId, |
|||
@Param("monthId") String monthId, |
|||
@Param("indexCode") String indexCode, |
|||
@Param("isTotal") String isTotal); |
|||
|
|||
/** |
|||
* @param gridScoreEntityList |
|||
* @return int |
|||
* @author yinzuomei |
|||
* @description |
|||
* @Date 2020/8/31 14:01 |
|||
**/ |
|||
int insertBatches(List<GridScoreEntity> gridScoreEntityList); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return java.util.List<com.epmet.dto.indexcal.GridScoreDTO> |
|||
* @author yinzuomei |
|||
* @description |
|||
* @Date 2020/8/31 16:42 |
|||
**/ |
|||
List<GridScoreDTO> selectList(CalculateCommonFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @param monthId |
|||
* @Description 下属所有网格的平均值 |
|||
* @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,90 @@ |
|||
/** |
|||
* 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.entity.evaluationindex.indexcal; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 区/街道相关分数表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-09-02 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@TableName("fact_index_sub_agency_score") |
|||
public class AgencySubScoreEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织id(eg:社区或者街道id) |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 上级组织id |
|||
*/ |
|||
private String parentAgencyId; |
|||
|
|||
/** |
|||
* 年度ID: yyyy |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 月维度Id: yyyyMM |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 1:总分;0不是;默认0 |
|||
*/ |
|||
private String isTotal; |
|||
|
|||
/** |
|||
* 分值 |
|||
*/ |
|||
private BigDecimal score; |
|||
|
|||
/** |
|||
* 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan |
|||
*/ |
|||
private String indexCode; |
|||
|
|||
/** |
|||
* 数据类型 district :全区;street:街道 |
|||
*/ |
|||
private String dataType; |
|||
|
|||
} |
@ -0,0 +1,90 @@ |
|||
/** |
|||
* 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.entity.evaluationindex.indexcal; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 党员相关分值 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-08-31 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@TableName("fact_index_sub_cpc_score") |
|||
public class CpcSubScoreEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格所属的机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
|
|||
/** |
|||
* 年维度Id: yyyy |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 月维度Id: yyyyMM |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 用户id |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 分值 |
|||
*/ |
|||
private BigDecimal score; |
|||
|
|||
/** |
|||
* 指标code |
|||
*/ |
|||
private String indexCode; |
|||
|
|||
/** |
|||
* 所有指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allParentIndexCode; |
|||
|
|||
/** |
|||
* 是否是总分 1是0不是 |
|||
*/ |
|||
private String isTotal; |
|||
} |
@ -0,0 +1,90 @@ |
|||
/** |
|||
* 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.entity.evaluationindex.indexcal; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 区直部门分值表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-09-02 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@TableName("fact_index_sub_dept_score") |
|||
public class DeptSubScoreEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 部门id |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 部门所属的组织id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 年度ID: yyyy |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 月维度Id: yyyyMM |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 1:总分;0不是;默认0 |
|||
*/ |
|||
private String isTotal; |
|||
|
|||
/** |
|||
* 分值 |
|||
*/ |
|||
private BigDecimal score; |
|||
|
|||
/** |
|||
* 治理能力:zhilinengli; |
|||
*/ |
|||
private String indexCode; |
|||
|
|||
/** |
|||
* 所有指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allParentIndexCode; |
|||
|
|||
} |
@ -0,0 +1,95 @@ |
|||
/** |
|||
* 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.entity.evaluationindex.indexcal; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 网格相关分值 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-08-31 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@TableName("fact_index_sub_grid_score") |
|||
public class GridSubScoreEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 网格所属的机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 所有上级ID,用英文逗号分开 |
|||
*/ |
|||
private String allParentIds; |
|||
|
|||
/** |
|||
* 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 年度ID: yyyy |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 月维度Id: yyyyMM |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 1:总分;0不是 |
|||
*/ |
|||
private String isTotal; |
|||
|
|||
/** |
|||
* 分值 |
|||
*/ |
|||
private BigDecimal score; |
|||
|
|||
/** |
|||
* 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan |
|||
*/ |
|||
private String indexCode; |
|||
|
|||
/** |
|||
* 所有指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allParentIndexCode; |
|||
|
|||
} |
@ -0,0 +1,160 @@ |
|||
<?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.indexcal.AgencySubScoreDao"> |
|||
|
|||
<!-- 【街道】中间表插入 --> |
|||
<insert id="insertStreetRecord"> |
|||
INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) |
|||
VALUES |
|||
<foreach collection="lists" item="item" separator=","> |
|||
( |
|||
REPLACE ( UUID(), '-', '' ), |
|||
#{item.customerId}, |
|||
#{item.agencyId}, |
|||
#{item.parentAgencyId}, |
|||
#{item.yearId}, |
|||
#{item.quarterId}, |
|||
#{item.monthId}, |
|||
#{item.dataType}, |
|||
#{item.score}, |
|||
#{item.indexCode}, |
|||
#{item.delFlag}, |
|||
#{item.revision}, |
|||
#{item.createdBy}, |
|||
NOW(), |
|||
#{item.updatedBy}, |
|||
NOW() |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
<!-- 删除旧记录 --> |
|||
<delete id="deleteOldRecord"> |
|||
DELETE |
|||
FROM |
|||
fact_index_agency_score |
|||
WHERE |
|||
del_flag = '0' |
|||
AND customer_id = #{customerId} |
|||
AND month_id = #{monthId} |
|||
AND index_code = #{indexCode} |
|||
AND data_type = #{dataType} |
|||
</delete> |
|||
|
|||
<select id="selectListAgencyScore" resultType="com.epmet.dto.indexcal.AgencyScoreDTO"> |
|||
SELECT |
|||
CUSTOMER_ID customerId, |
|||
AGENCY_ID agencyId, |
|||
PARENT_AGENCY_ID parentAgencyId, |
|||
YEAR_ID yearId, |
|||
MONTH_ID monthId, |
|||
SCORE score, |
|||
INDEX_CODE indexCode |
|||
FROM |
|||
fact_index_agency_score |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
ORDER BY AGENCY_ID |
|||
</select> |
|||
|
|||
<!-- 查询街道相关信息 --> |
|||
<select id="selectAgencyScoreInfo" resultType="com.epmet.dto.indexcal.AgencyScoreDTO"> |
|||
SELECT |
|||
CUSTOMER_ID, |
|||
AGENCY_ID, |
|||
MONTH_ID, |
|||
QUARTER_ID, |
|||
YEAR_ID, |
|||
SCORE, |
|||
INDEX_CODE, |
|||
PARENT_AGENCY_ID |
|||
FROM |
|||
fact_index_agency_score |
|||
WHERE |
|||
del_flag = 0 |
|||
AND CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
AND INDEX_CODE != "jiedaoxiangguan" |
|||
AND data_type = #{dataType} |
|||
</select> |
|||
|
|||
<select id="selectAgencyScoreAvg" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO"> |
|||
SELECT |
|||
fics.agency_id, |
|||
fics.month_id, |
|||
fics.quarter_id, |
|||
fics.year_id, |
|||
ROUND(AVG( fics.score ),6) AS score, |
|||
fics.customer_id, |
|||
PARENT_AGENCY_ID AS parentId |
|||
FROM |
|||
fact_index_agency_score fics |
|||
WHERE |
|||
fics.del_flag = '0' |
|||
AND fics.customer_id = #{customerId} |
|||
AND fics.month_id = #{monthId} |
|||
AND fics.index_code = #{indexCode} |
|||
AND fics.DATA_TYPE = #{dataType} |
|||
GROUP BY fics.parent_agency_id |
|||
</select> |
|||
|
|||
<insert id="batchInsertAgencyScoreData" parameterType="map"> |
|||
insert into fact_index_agency_score |
|||
( |
|||
ID, |
|||
CUSTOMER_ID, |
|||
|
|||
AGENCY_ID, |
|||
PARENT_AGENCY_ID, |
|||
YEAR_ID, |
|||
QUARTER_ID, |
|||
MONTH_ID, |
|||
DATA_TYPE, |
|||
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.agencyId}, |
|||
#{item.parentAgencyId}, |
|||
|
|||
#{item.yearId}, |
|||
#{item.quarterId}, |
|||
#{item.monthId}, |
|||
#{item.dataType}, |
|||
#{item.score}, |
|||
#{item.indexCode}, |
|||
0, |
|||
0, |
|||
'APP_USER', |
|||
now(), |
|||
'APP_USER', |
|||
now() |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
<select id="selectListAgencyId" resultType="String"> |
|||
SELECT |
|||
AGENCY_ID agencyId |
|||
FROM |
|||
fact_index_agency_score |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
ORDER BY AGENCY_ID |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,156 @@ |
|||
<?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.indexcal.CommunitySubScoreDao"> |
|||
|
|||
<!-- 党建能力【社区】中间表插入 --> |
|||
<insert id="insertCommunityPartyRecord"> |
|||
INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) |
|||
VALUES |
|||
<foreach collection="lists" item="item" separator=","> |
|||
( |
|||
REPLACE(UUID(),'-',''), |
|||
#{item.customerId}, |
|||
#{item.agencyId}, |
|||
#{item.parentAgencyId}, |
|||
#{item.yearId}, |
|||
#{item.quarterId}, |
|||
#{item.monthId}, |
|||
#{item.score}, |
|||
#{item.indexCode}, |
|||
#{item.allParentIndexCode}, |
|||
#{item.delFlag}, |
|||
#{item.revision}, |
|||
#{item.createdBy}, |
|||
NOW(), |
|||
#{item.updatedBy}, |
|||
NOW() |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
<!-- 删除旧记录 --> |
|||
<delete id="deleteOldRecord"> |
|||
DELETE |
|||
FROM |
|||
fact_index_community_score |
|||
WHERE |
|||
del_flag = '0' |
|||
AND customer_id = #{customerId} |
|||
AND month_id = #{monthId} |
|||
</delete> |
|||
|
|||
<!-- 查询社区相关信息 --> |
|||
<select id="selectCommunityInfo" resultType="com.epmet.dto.screen.FactIndexCommunityScoreDTO"> |
|||
SELECT |
|||
CUSTOMER_ID, |
|||
AGENCY_ID, |
|||
MONTH_ID, |
|||
QUARTER_ID, |
|||
YEAR_ID, |
|||
SCORE, |
|||
INDEX_CODE, |
|||
PARENT_AGENCY_ID |
|||
FROM |
|||
fact_index_community_score |
|||
WHERE |
|||
del_flag = 0 |
|||
AND CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
AND INDEX_CODE = "dangjiannengli" |
|||
OR INDEX_CODE = "zhilinengli" |
|||
OR INDEX_CODE = "fuwunengli" |
|||
</select> |
|||
|
|||
<!-- 街道下级所有社区服务能力得分平均值 --> |
|||
<select id="selectSubCommAvgScore" resultType="com.epmet.dto.indexcal.SubCommunityAvgResultDTO"> |
|||
SELECT |
|||
fics.PARENT_AGENCY_ID AS agencyId, |
|||
fics.month_id, |
|||
fics.quarter_id, |
|||
fics.year_id, |
|||
ROUND(AVG( fics.score ),6) AS score, |
|||
fics.customer_id, |
|||
sca.pid AS parentId |
|||
FROM |
|||
fact_index_community_score fics |
|||
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fics.PARENT_AGENCY_ID |
|||
WHERE |
|||
fics.del_flag = '0' |
|||
AND sca.DEL_FLAG = 0 |
|||
AND fics.customer_id = #{customerId} |
|||
AND fics.month_id = #{monthId} |
|||
AND fics.index_code = #{indexCode} |
|||
GROUP BY fics.parent_agency_id |
|||
</select> |
|||
|
|||
<select id="selectListCommunityScore" resultType="com.epmet.dto.screen.FactIndexCommunityScoreDTO"> |
|||
SELECT |
|||
CUSTOMER_ID customerId, |
|||
AGENCY_ID agencyId, |
|||
PARENT_AGENCY_ID parentAgencyId, |
|||
YEAR_ID yearId, |
|||
MONTH_ID monthId, |
|||
SCORE score, |
|||
INDEX_CODE indexCode |
|||
FROM |
|||
fact_index_community_score |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
ORDER BY AGENCY_ID |
|||
</select> |
|||
|
|||
<insert id="batchInsertCommunityScoreData" parameterType="map"> |
|||
insert into fact_index_community_score |
|||
( |
|||
ID, |
|||
CUSTOMER_ID, |
|||
AGENCY_ID, |
|||
PARENT_AGENCY_ID, |
|||
YEAR_ID, |
|||
QUARTER_ID, |
|||
MONTH_ID, |
|||
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.agencyId}, |
|||
#{item.parentAgencyId}, |
|||
#{item.yearId}, |
|||
#{item.quarterId}, |
|||
#{item.monthId}, |
|||
#{item.score}, |
|||
#{item.indexCode}, |
|||
0, |
|||
0, |
|||
'APP_USER', |
|||
now(), |
|||
'APP_USER', |
|||
now() |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
<select id="selectListCommunityId" resultType="String"> |
|||
SELECT |
|||
AGENCY_ID agencyId |
|||
FROM |
|||
fact_index_community_score |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
ORDER BY AGENCY_ID |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,144 @@ |
|||
<?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.indexcal.CpcSubScoreDao"> |
|||
|
|||
<delete id="deleteByMonthId"> |
|||
delete from fact_index_cpc_score |
|||
where |
|||
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} |
|||
and MONTH_ID = #{monthId,jdbcType=VARCHAR} |
|||
<if test="indexCode != null and indexCode !=''"> |
|||
and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} |
|||
</if> |
|||
</delete> |
|||
|
|||
<resultMap type="com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity" id="cpcScoreMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="gridId" column="GRID_ID"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="monthId" column="MONTH_ID"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="revision" column="REVISION"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<select id="getPartScore" resultType="com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity"> |
|||
select |
|||
CUSTOMER_ID,AGENCY_ID,GRID_ID,YEAR_ID,MONTH_ID,USER_ID,SCORE,INDEX_CODE FROM fact_index_cpc_score |
|||
WHERE |
|||
CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} |
|||
and MONTH_ID = #{monthId,jdbcType=VARCHAR} |
|||
and ALL_PARENT_INDEX_CODE = #{allParentCode,jdbcType=VARCHAR} |
|||
</select> |
|||
|
|||
|
|||
<!-- 获取网格内党员的联系群众能力考评分(平均值) --> |
|||
<select id="selectGridContactMassesAvgValue" parameterType="map" resultType="java.math.BigDecimal"> |
|||
SELECT |
|||
round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE |
|||
FROM |
|||
fact_index_cpc_score m |
|||
WHERE |
|||
m.DEL_FLAG = '0' |
|||
AND m.CUSTOMER_ID =#{customerId} |
|||
AND m.MONTH_ID = #{monthId} |
|||
AND m.GRID_ID = #{gridId} |
|||
and m.INDEX_CODE='lianxiqunzhong' |
|||
GROUP BY |
|||
m.GRID_ID |
|||
</select> |
|||
|
|||
<!-- 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 --> |
|||
<select id="selectListGridContactMassesAvgValue" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.math.BigDecimal"> |
|||
SELECT |
|||
round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE |
|||
FROM |
|||
fact_index_cpc_score m |
|||
WHERE |
|||
m.DEL_FLAG = '0' |
|||
AND m.CUSTOMER_ID =#{customerId} |
|||
AND m.MONTH_ID = #{monthId} |
|||
and m.INDEX_CODE='lianxiqunzhong' |
|||
GROUP BY |
|||
m.GRID_ID |
|||
</select> |
|||
|
|||
<!-- 网格内党员的参与议事能力考评分(平均值) 最大值最小值 --> |
|||
<select id="selectListJoinIssueAvgValue" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultType="java.math.BigDecimal"> |
|||
SELECT |
|||
round(AVG( SCORE ),6) AS AVG_JOIN_ISSUE_SCORE |
|||
FROM |
|||
fact_index_cpc_score m |
|||
WHERE |
|||
m.DEL_FLAG = '0' |
|||
AND m.CUSTOMER_ID =#{customerId} |
|||
AND m.MONTH_ID = #{monthId} |
|||
and m.INDEX_CODE='canyuyishi' |
|||
GROUP BY |
|||
m.GRID_ID |
|||
</select> |
|||
|
|||
<!-- --> |
|||
<select id="selectGridJoinIssueAvgValue" parameterType="map" resultType="java.math.BigDecimal"> |
|||
SELECT |
|||
round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE |
|||
FROM |
|||
fact_index_cpc_score m |
|||
WHERE |
|||
m.DEL_FLAG = '0' |
|||
AND m.CUSTOMER_ID =#{customerId} |
|||
AND m.MONTH_ID = #{monthId} |
|||
AND m.GRID_ID = #{gridId} |
|||
and m.INDEX_CODE='canyuyishi' |
|||
GROUP BY |
|||
m.GRID_ID |
|||
</select> |
|||
|
|||
<insert id="insertBatch"> |
|||
INSERT INTO `fact_index_cpc_score` ( |
|||
`ID`, |
|||
`CUSTOMER_ID`, |
|||
`GRID_ID`, |
|||
`AGENCY_ID`, |
|||
`YEAR_ID`, |
|||
`MONTH_ID`, |
|||
`USER_ID`, |
|||
`SCORE`, |
|||
`INDEX_CODE`, |
|||
`ALL_PARENT_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), |
|||
#{item.customerId}, |
|||
#{item.gridId}, |
|||
#{item.agencyId}, |
|||
#{item.yearId}, |
|||
#{item.monthId}, |
|||
#{item.userId}, |
|||
#{item.score}, |
|||
#{item.indexCode}, |
|||
#{item.allParentIndexCode}, |
|||
0, |
|||
0, |
|||
'APP_USER', |
|||
now(), |
|||
'APP_USER', |
|||
now() |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
</mapper> |
@ -0,0 +1,103 @@ |
|||
<?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.indexcal.DeptSubScoreDao"> |
|||
|
|||
<select id="selectListDeptScore" resultType="com.epmet.dto.indexcal.DeptScoreDTO"> |
|||
SELECT |
|||
CUSTOMER_ID customerId, |
|||
DEPT_ID deptId, |
|||
YEAR_ID yearId, |
|||
MONTH_ID monthId, |
|||
SCORE score, |
|||
INDEX_CODE indexCode |
|||
FROM |
|||
fact_index_dept_score |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
ORDER BY DEPT_ID |
|||
</select> |
|||
|
|||
<!-- 所有直属部门治理能力平均值 --> |
|||
<select id="selectGovernDeptScoreAvg" resultType="com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO"> |
|||
SELECT |
|||
fidc.agency_id, |
|||
fidc.month_id, |
|||
fidc.quarter_id, |
|||
fidc.year_id, |
|||
AVG( fidc.score ) AS score, |
|||
fidc.customer_id, |
|||
sca.pid AS parentId |
|||
FROM |
|||
fact_index_dept_score fidc |
|||
LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = fidc.AGENCY_ID |
|||
WHERE |
|||
fidc.del_flag = '0' |
|||
AND fidc.customer_id = #{customerId} |
|||
AND fidc.month_id = #{monthId} |
|||
AND fidc.index_code = #{indexCode} |
|||
GROUP BY fidc.agency_id |
|||
</select> |
|||
|
|||
<insert id="batchInsertDeptScoreData" parameterType="map"> |
|||
insert into fact_index_dept_score |
|||
( |
|||
ID, |
|||
CUSTOMER_ID, |
|||
DEPT_ID, |
|||
AGENCY_ID, |
|||
QUARTER_ID, |
|||
YEAR_ID, |
|||
MONTH_ID, |
|||
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.deptId}, |
|||
#{item.agencyId}, |
|||
#{item.quarterId}, |
|||
#{item.yearId}, |
|||
|
|||
#{item.monthId}, |
|||
#{item.score}, |
|||
#{item.indexCode}, |
|||
#{item.delFlag}, |
|||
0, |
|||
'APP_USER', |
|||
now(), |
|||
'APP_USER', |
|||
now() |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
<select id="selectListDeptId" resultType="String"> |
|||
SELECT |
|||
DEPT_ID deptId |
|||
FROM |
|||
fact_index_dept_score |
|||
WHERE |
|||
DEL_FLAG = '0' |
|||
AND CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
ORDER BY DEPT_ID |
|||
</select> |
|||
|
|||
<delete id="deleteByDeptIdAndMonthId" parameterType="map"> |
|||
delete from fact_index_dept_score where CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
and DEPT_ID=#{deptId} |
|||
</delete> |
|||
</mapper> |
@ -0,0 +1,188 @@ |
|||
<?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.indexcal.GridSubScoreDao"> |
|||
|
|||
<delete id="deleteByCusAndMonthId" parameterType="map"> |
|||
DELETE |
|||
FROM |
|||
fact_index_grid_score |
|||
WHERE |
|||
CUSTOMER_ID = #{customerId} |
|||
AND MONTH_ID = #{monthId} |
|||
AND INDEX_CODE = #{indexCode} |
|||
</delete> |
|||
|
|||
<insert id="insertBatches"> |
|||
INSERT INTO `fact_index_grid_score` ( |
|||
`ID`, |
|||
`CUSTOMER_ID`, |
|||
`GRID_ID`, |
|||
`AGENCY_ID`, |
|||
`ALL_PARENT_IDS`, |
|||
`QUARTER_ID`, |
|||
`YEAR_ID`, |
|||
`MONTH_ID`, |
|||
`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), |
|||
#{item.customerId}, |
|||
#{item.gridId}, |
|||
#{item.agencyId}, |
|||
#{item.allParentIds}, |
|||
#{item.quarterId}, |
|||
#{item.yearId}, |
|||
#{item.monthId}, |
|||
#{item.isTotal}, |
|||
#{item.score}, |
|||
#{item.indexCode}, |
|||
0, |
|||
0, |
|||
'APP_USER', |
|||
now(), |
|||
'APP_USER', |
|||
now() |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
<resultMap id="GridScoreDTOMap" type="com.epmet.dto.indexcal.GridScoreDTO"> |
|||
<result property="gridId" column="GRID_ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="agencyId" column="AGENCY_ID"/> |
|||
<result property="allParentIds" column="ALL_PARENT_IDS"/> |
|||
<result property="quarterId" column="QUARTER_ID"/> |
|||
<result property="yearId" column="YEAR_ID"/> |
|||
<result property="monthId" column="MONTH_ID"/> |
|||
<collection property="detailList" ofType="com.epmet.dto.indexcal.GridScoreDetailDTO" > |
|||
<result property="score" column="SCORE"/> |
|||
<result property="indexCode" column="INDEX_CODE"/> |
|||
</collection> |
|||
</resultMap> |
|||
<select id="selectList" parameterType="com.epmet.dto.indexcal.CalculateCommonFormDTO" resultMap="GridScoreDTOMap"> |
|||
SELECT |
|||
m.GRID_ID, |
|||
m.CUSTOMER_ID, |
|||
m.AGENCY_ID, |
|||
m.ALL_PARENT_IDS, |
|||
m.QUARTER_ID, |
|||
m.YEAR_ID, |
|||
m.MONTH_ID, |
|||
M.SCORE, |
|||
M.INDEX_CODE |
|||
FROM |
|||
fact_index_grid_score m |
|||
WHERE |
|||
m.DEL_FLAG = '0' |
|||
AND m.CUSTOMER_ID =#{customerId} |
|||
AND m.MONTH_ID =#{monthId} |
|||
</select> |
|||
|
|||
|
|||
|
|||
<!-- 下属所有网格的平均值 --> |
|||
<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, |
|||
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, |
|||
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.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