forked from rongchao/epmet-cloud-rizhao
				
			
				 28 changed files with 1255 additions and 4 deletions
			
			
		| @ -0,0 +1,34 @@ | |||
| package com.epmet.evaluationindex.screen.dto.form; | |||
| 
 | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.Min; | |||
| import javax.validation.constraints.NotBlank; | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  能力指数--接口入参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class AblityIndexFormDTO implements Serializable { | |||
|     private static final long serialVersionUID = -2880432640584616651L; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "客户ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) | |||
|     private String customerId; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "组织ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) | |||
|     private String agencyId; | |||
|     /** | |||
|      * 月份Id(格式:202009) | |||
|      */ | |||
|     @NotBlank(message = "月份ID不能为空",groups = {AblityIndexFormDTO.AddUserInternalGroup.class}) | |||
|     private String monthId; | |||
|     public interface AddUserInternalGroup {} | |||
| 
 | |||
| } | |||
| @ -0,0 +1,42 @@ | |||
| package com.epmet.evaluationindex.screen.dto.form; | |||
| 
 | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.NotBlank; | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  按月查询各项指标数据--接口入参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class AblityListFormDTO implements Serializable { | |||
|     private static final long serialVersionUID = -2880432640584616651L; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "客户ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) | |||
|     private String customerId; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "组织ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) | |||
|     private String agencyId; | |||
|     /** | |||
|      * 月份Id(格式:202009) | |||
|      */ | |||
|     @NotBlank(message = "月份ID不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) | |||
|     private String monthId; | |||
|     /** | |||
|      * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) | |||
|      */ | |||
|     @NotBlank(message = "类型不能为空",groups = {AblityListFormDTO.AddUserInternalGroup.class}) | |||
|     private String indexCode; | |||
|     /** | |||
|      * 所有有权重的指标code拼接的字符串 冒号隔开 | |||
|      */ | |||
|     private String allParentIndexCode; | |||
|     public interface AddUserInternalGroup {} | |||
| 
 | |||
| } | |||
| @ -0,0 +1,43 @@ | |||
| package com.epmet.evaluationindex.screen.dto.form; | |||
| 
 | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.NotBlank; | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  按月查询各项指标最近12个月数据--接口入参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class MonthAblityListFormDTO implements Serializable { | |||
|     private static final long serialVersionUID = -2880432640584616651L; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "客户ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) | |||
|     private String customerId; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "组织ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) | |||
|     private String agencyId; | |||
|     /** | |||
|      * 月份Id(格式:202009) | |||
|      */ | |||
|     @NotBlank(message = "月份ID不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) | |||
|     private String monthId; | |||
|     /** | |||
|      * 月份Id(格式:202009) | |||
|      */ | |||
|     @NotBlank(message = "类型key不能为空",groups = {MonthAblityListFormDTO.AddUserInternalGroup.class}) | |||
|     private String key; | |||
|     /** | |||
|      * 查询月份的前12个月对应的monthId | |||
|      */ | |||
|     private String startMonthId; | |||
|     public interface AddUserInternalGroup {} | |||
| 
 | |||
| 
 | |||
| } | |||
| @ -0,0 +1,33 @@ | |||
| package com.epmet.evaluationindex.screen.dto.form; | |||
| 
 | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.NotBlank; | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  能力指数--接口入参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class MonthScoreListFormDTO implements Serializable { | |||
|     private static final long serialVersionUID = -2880432640584616651L; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "客户ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) | |||
|     private String customerId; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "组织ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) | |||
|     private String agencyId; | |||
|     /** | |||
|      * 月份Id(格式:202009) | |||
|      */ | |||
|     @NotBlank(message = "月份ID不能为空",groups = {MonthScoreListFormDTO.AddUserInternalGroup.class}) | |||
|     private String monthId; | |||
|     public interface AddUserInternalGroup {} | |||
| 
 | |||
| } | |||
| @ -0,0 +1,39 @@ | |||
| package com.epmet.evaluationindex.screen.dto.form; | |||
| 
 | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.Min; | |||
| import javax.validation.constraints.NotBlank; | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  同级对比各项数据查询--接口入参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class PeerComparisonFormDTO implements Serializable { | |||
|     private static final long serialVersionUID = -2880432640584616651L; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "客户ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) | |||
|     private String customerId; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "组织ID不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) | |||
|     private String agencyId; | |||
|     /** | |||
|      * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) | |||
|      */ | |||
|     @NotBlank(message = "数据类型不能为空",groups = {PeerComparisonFormDTO.AddUserInternalGroup.class}) | |||
|     private String indexCode; | |||
|     /** | |||
|      * 查询条数 | |||
|      */ | |||
|     @Min(value = 1, message = "查询条数必须大于0", groups = {PeerComparisonFormDTO.AddUserInternalGroup.class }) | |||
|     private Integer pageSize; | |||
|     public interface AddUserInternalGroup {} | |||
| 
 | |||
| } | |||
| @ -0,0 +1,25 @@ | |||
| package com.epmet.evaluationindex.screen.dto.form; | |||
| 
 | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.Min; | |||
| import javax.validation.constraints.NotBlank; | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  是否根组织--接口入参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class RootAgencyFormDTO implements Serializable { | |||
|     private static final long serialVersionUID = -2880432640584616651L; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class}) | |||
|     private String agencyId; | |||
| 
 | |||
|     public interface AddUserInternalGroup {} | |||
| 
 | |||
| } | |||
| @ -0,0 +1,38 @@ | |||
| package com.epmet.evaluationindex.screen.dto.form; | |||
| 
 | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import javax.validation.constraints.NotBlank; | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  按月份查询各项能力分数--接口入参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class ScoreListFormDTO implements Serializable { | |||
|     private static final long serialVersionUID = -2880432640584616651L; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "客户ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) | |||
|     private String customerId; | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     @NotBlank(message = "组织ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) | |||
|     private String agencyId; | |||
|     /** | |||
|      * 月份Id(格式:202009) | |||
|      */ | |||
|     @NotBlank(message = "月份ID不能为空",groups = {ScoreListFormDTO.AddUserInternalGroup.class}) | |||
|     private String monthId; | |||
|     /** | |||
|      * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) | |||
|      */ | |||
|     private String indexCode; | |||
| 
 | |||
|     public interface AddUserInternalGroup {} | |||
| 
 | |||
| } | |||
| @ -0,0 +1,51 @@ | |||
| package com.epmet.evaluationindex.screen.dto.result; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import java.io.Serializable; | |||
| import java.util.List; | |||
| 
 | |||
| /** | |||
|  *  能力指数--接口返参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class AblityIndexResultDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = 3860268744336541373L; | |||
| 
 | |||
|     /** | |||
|      * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli | |||
|      */ | |||
|     private String indexCode; | |||
|     /** | |||
|      * 每项能力最近12月各项分数对象 | |||
|      */ | |||
|     private  List<AblityIndexResultDTO.ScoreListResultDTO> scoreList; | |||
| 
 | |||
|     @Data | |||
|     public static class ScoreListResultDTO implements Serializable { | |||
|         /** | |||
|          * 能力总分 | |||
|          */ | |||
|         private Double indexTotal; | |||
|         /** | |||
|          * 本级能力分 | |||
|          */ | |||
|         private Double agencyScore; | |||
|         /** | |||
|          * 下级能力分 | |||
|          */ | |||
|         private Double subAgencyScore; | |||
|         /** | |||
|          * 横坐标(202009) | |||
|          */ | |||
|         private String monthId; | |||
| 
 | |||
|     } | |||
| 
 | |||
| 
 | |||
| 
 | |||
| 
 | |||
| 
 | |||
| } | |||
| @ -0,0 +1,29 @@ | |||
| package com.epmet.evaluationindex.screen.dto.result; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  按月查询各项指标数据--接口返参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class AblityListResultDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = 3860268744336541373L; | |||
| 
 | |||
|     /** | |||
|      * 各项指标名称 | |||
|      */ | |||
|     private String name; | |||
|     /** | |||
|      * 指标对应值(数值或百分比) | |||
|      */ | |||
|     private String value = "0"; | |||
|     /** | |||
|      * 各项指标对应key值(index_dict字典表) | |||
|      */ | |||
|     private String key; | |||
| 
 | |||
| } | |||
| @ -0,0 +1,25 @@ | |||
| package com.epmet.evaluationindex.screen.dto.result; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  按月查询各项指标最近12个月数据--接口返参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class MonthAblityListResultDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = 3860268744336541373L; | |||
| 
 | |||
|     /** | |||
|      * 横坐标(202009) | |||
|      */ | |||
|     private String monthId; | |||
|     /** | |||
|      * 指标对应值(数值或百分比) | |||
|      */ | |||
|     private String ablity; | |||
| 
 | |||
| } | |||
| @ -0,0 +1,48 @@ | |||
| package com.epmet.evaluationindex.screen.dto.result; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import java.io.Serializable; | |||
| import java.util.List; | |||
| 
 | |||
| /** | |||
|  *  按月份查询各项能力最近12个月得分--接口返参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class MonthScoreListResultDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = 3860268744336541373L; | |||
| 
 | |||
|     /** | |||
|      * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli | |||
|      */ | |||
|     private String indexCode; | |||
|     /** | |||
|      * 每项能力最近12月各项分数对象 | |||
|      */ | |||
|     private  List<MonthScoreListResultDTO.ScoreListResultDTO> scoreList; | |||
| 
 | |||
|     @Data | |||
|     public static class ScoreListResultDTO implements Serializable { | |||
|         /** | |||
|          * 能力总分 | |||
|          */ | |||
|         private Double indexTotal; | |||
|         /** | |||
|          * 本级能力分 | |||
|          */ | |||
|         private Double agencyScore; | |||
|         /** | |||
|          * 下级能力分 | |||
|          */ | |||
|         private Double subAgencyScore; | |||
|         /** | |||
|          * 横坐标(202009) | |||
|          */ | |||
|         private String monthId; | |||
| 
 | |||
|     } | |||
| 
 | |||
| 
 | |||
| } | |||
| @ -0,0 +1,29 @@ | |||
| package com.epmet.evaluationindex.screen.dto.result; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  同级对比各项数据查询--接口返参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class PeerComparisonResultDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = 3860268744336541373L; | |||
| 
 | |||
|     /** | |||
|      * 组织Id | |||
|      */ | |||
|     private String agencyId; | |||
|     /** | |||
|      * 组织名称 | |||
|      */ | |||
|     private String agencyName; | |||
|     /** | |||
|      * 能力分值(保留一位小数) | |||
|      */ | |||
|     private Double score; | |||
| 
 | |||
| } | |||
| @ -0,0 +1,26 @@ | |||
| package com.epmet.evaluationindex.screen.dto.result; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  是否根组织--接口返参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class RootAgencyResultDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = 3860268744336541373L; | |||
| 
 | |||
|     /** | |||
|      * 是否根组织(是:true  否:false) | |||
|      */ | |||
|     private Boolean isRoot = true; | |||
| 
 | |||
|     /** | |||
|      * 数据更新至(上月月末时间) | |||
|      */ | |||
|     private String date; | |||
| 
 | |||
| } | |||
| @ -0,0 +1,33 @@ | |||
| package com.epmet.evaluationindex.screen.dto.result; | |||
| 
 | |||
| import lombok.Data; | |||
| 
 | |||
| import java.io.Serializable; | |||
| 
 | |||
| /** | |||
|  *  按月份查询各项能力分数--接口返参 | |||
|  * @Author sun | |||
|  */ | |||
| @Data | |||
| public class ScoreListResultDTO implements Serializable { | |||
| 
 | |||
|     private static final long serialVersionUID = 3860268744336541373L; | |||
| 
 | |||
|     /** | |||
|      * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) | |||
|      */ | |||
|     private String indexCode; | |||
|     /** | |||
|      * 总分(保留一位小数) | |||
|      */ | |||
|     private Double indexTotal; | |||
|     /** | |||
|      * 本级分数(保留一位小数) | |||
|      */ | |||
|     private Double agencyScore; | |||
|     /** | |||
|      * 下级分数(保留一位小数) | |||
|      */ | |||
|     private Double subAgencyScore; | |||
| 
 | |||
| } | |||
| @ -0,0 +1,36 @@ | |||
| package com.epmet.datareport.constant; | |||
| 
 | |||
| /** | |||
|  * @author sun | |||
|  * @dscription 数据 | |||
|  */ | |||
| public interface FactConstant { | |||
| 	/** | |||
| 	 * 能力指标 | |||
| 	 */ | |||
| 	String NLZB = "nenglizhibiao"; | |||
| 	/** | |||
| 	 * 党建能力 | |||
| 	 */ | |||
| 	String DJNL = "dangjiannengli"; | |||
| 	/** | |||
| 	 * 治理能力 | |||
| 	 */ | |||
| 	String ZLNL = "zhilinengli"; | |||
| 	/** | |||
| 	 * 服务能力 | |||
| 	 */ | |||
| 	String FWNL = "fuwunengli"; | |||
| 	/** | |||
| 	 * 全区相关 | |||
| 	 */ | |||
| 	String QUAN_QU_XIANG_GUAN = "quanquxiangguan"; | |||
| 	/** | |||
| 	 * 街道相关 | |||
| 	 */ | |||
| 	String JIE_DAO_XIANG_GUAN = "jiedaoxiangguan"; | |||
| 	/** | |||
| 	 * 社区相关 | |||
| 	 */ | |||
| 	String SHE_QU_XIANG_GUAN = "shequxiangguan"; | |||
| } | |||
| @ -0,0 +1,107 @@ | |||
| package com.epmet.datareport.controller.fact; | |||
| 
 | |||
| import com.epmet.commons.tools.annotation.LoginUser; | |||
| import com.epmet.commons.tools.security.dto.TokenDto; | |||
| import com.epmet.commons.tools.utils.Result; | |||
| import com.epmet.commons.tools.validator.ValidatorUtils; | |||
| import com.epmet.datareport.service.fact.FactIndexService; | |||
| import com.epmet.evaluationindex.screen.dto.form.*; | |||
| import com.epmet.evaluationindex.screen.dto.result.*; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestBody; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| 
 | |||
| import java.util.List; | |||
| 
 | |||
| /** | |||
|  * 数据改版api | |||
|  * @author sun | |||
|  */ | |||
| @RestController | |||
| @RequestMapping("fact") | |||
| public class FactIndexController { | |||
| 
 | |||
|     @Autowired | |||
|     private FactIndexService factIndexService; | |||
| 
 | |||
|     /** | |||
|      * @param tokenDTO | |||
|      * @Description  能力指数 | |||
|      * @author sun | |||
|      */ | |||
|     @PostMapping("index/ablityindex") | |||
|     public Result<List<AblityIndexResultDTO>> ablityIndex(@LoginUser TokenDto tokenDTO, @RequestBody AblityIndexFormDTO formDTO){ | |||
|         ValidatorUtils.validateEntity(formDTO, AblityIndexFormDTO.AddUserInternalGroup.class); | |||
|         return new Result<List<AblityIndexResultDTO>>().ok(factIndexService.ablityIndex(formDTO)); | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param tokenDTO | |||
|      * @Description  按月份查询各项能力分数 | |||
|      * @author sun | |||
|      */ | |||
|     @PostMapping("index/scorelist") | |||
|     public Result<List<ScoreListResultDTO>> scoreList(@LoginUser TokenDto tokenDTO, @RequestBody ScoreListFormDTO formDTO){ | |||
|         ValidatorUtils.validateEntity(formDTO, ScoreListFormDTO.AddUserInternalGroup.class); | |||
|         return new Result<List<ScoreListResultDTO>>().ok(factIndexService.scoreList(formDTO)); | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param tokenDTO | |||
|      * @Description  按月份查询各项能力最近12个月得分 | |||
|      * @author sun | |||
|      */ | |||
|     @PostMapping("index/monthscorelist") | |||
|     public Result<List<MonthScoreListResultDTO>> monthScoreList(@LoginUser TokenDto tokenDTO, @RequestBody MonthScoreListFormDTO formDTO){ | |||
|         ValidatorUtils.validateEntity(formDTO, MonthScoreListFormDTO.AddUserInternalGroup.class); | |||
|         return new Result<List<MonthScoreListResultDTO>>().ok(factIndexService.monthScoreList(formDTO)); | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param tokenDTO | |||
|      * @Description  按月查询各项指标数据 | |||
|      * @author sun | |||
|      */ | |||
|     @PostMapping("index/ablitylist") | |||
|     public Result<List<AblityListResultDTO>> ablityList(@LoginUser TokenDto tokenDTO, @RequestBody AblityListFormDTO formDTO){ | |||
|         ValidatorUtils.validateEntity(formDTO, AblityListFormDTO.AddUserInternalGroup.class); | |||
|         return new Result<List<AblityListResultDTO>>().ok(factIndexService.ablityList(formDTO)); | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param tokenDTO | |||
|      * @Description  按月查询各项指标最近12个月数据 | |||
|      * @author sun | |||
|      */ | |||
|     @PostMapping("index/monthablitylist") | |||
|     public Result<List<MonthAblityListResultDTO>> monthAblityList(@LoginUser TokenDto tokenDTO, @RequestBody MonthAblityListFormDTO formDTO){ | |||
|         ValidatorUtils.validateEntity(formDTO, MonthAblityListFormDTO.AddUserInternalGroup.class); | |||
|         return new Result<List<MonthAblityListResultDTO>>().ok(factIndexService.monthAblityList(formDTO)); | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param tokenDTO | |||
|      * @Description  同级对比各项数据查询 | |||
|      * @author sun | |||
|      */ | |||
|     @PostMapping("index/peercomparison") | |||
|     public Result<List<PeerComparisonResultDTO>> peerComparison(@LoginUser TokenDto tokenDTO, @RequestBody PeerComparisonFormDTO formDTO){ | |||
|         ValidatorUtils.validateEntity(formDTO, PeerComparisonFormDTO.AddUserInternalGroup.class); | |||
|         return new Result<List<PeerComparisonResultDTO>>().ok(factIndexService.peerComparison(formDTO)); | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param tokenDTO | |||
|      * @Description  是否根组织 | |||
|      * @author sun | |||
|      */ | |||
|     @PostMapping("index/rootagency") | |||
|     public Result<RootAgencyResultDTO> rootAgency(@LoginUser TokenDto tokenDTO, @RequestBody RootAgencyFormDTO formDTO){ | |||
|         ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class); | |||
|         return new Result<RootAgencyResultDTO>().ok(factIndexService.rootAgency(formDTO)); | |||
|     } | |||
| 
 | |||
| 
 | |||
| } | |||
| @ -0,0 +1,39 @@ | |||
| /** | |||
|  * 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.datareport.dao.fact; | |||
| 
 | |||
| import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO; | |||
| import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO; | |||
| import org.apache.ibatis.annotations.Mapper; | |||
| 
 | |||
| /** | |||
|  * 区/街道相关分数表 | |||
|  * | |||
|  * @author generator generator@elink-cn.com | |||
|  * @since v1.0.0 2020-09-02 | |||
|  */ | |||
| @Mapper | |||
| public interface FactIndexAgencyScoreDao { | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 分别查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 | |||
|      * @author sun | |||
|      */ | |||
|     ScoreListResultDTO selectScore(ScoreListFormDTO formDTO); | |||
| } | |||
| @ -0,0 +1,51 @@ | |||
| /** | |||
|  * 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.datareport.dao.fact; | |||
| 
 | |||
| import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; | |||
| import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; | |||
| import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; | |||
| import com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO; | |||
| import org.apache.ibatis.annotations.Mapper; | |||
| 
 | |||
| import java.util.LinkedList; | |||
| import java.util.List; | |||
| 
 | |||
| /** | |||
|  * 区/街道相关分数表 | |||
|  * | |||
|  * @author generator generator@elink-cn.com | |||
|  * @since v1.0.0 2020-09-02 | |||
|  */ | |||
| @Mapper | |||
| public interface FactIndexAgencySubScoreDao { | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 查询区县级、乡镇街道级组织某月份某项能力对应的各项指标 | |||
|      * @author sun | |||
|      */ | |||
|     List<AblityListResultDTO> selectAblityList(AblityListFormDTO formDTO); | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 查询区县级、乡镇街道级组织某项能力对应的一项指标过去12个月份数据 | |||
|      * @author sun | |||
|      */ | |||
|     LinkedList<MonthAblityListResultDTO> selectMonthAblityList(MonthAblityListFormDTO formDTO); | |||
| } | |||
| @ -0,0 +1,51 @@ | |||
| /** | |||
|  * 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.datareport.dao.fact; | |||
| 
 | |||
| import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; | |||
| import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; | |||
| import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; | |||
| import com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO; | |||
| import org.apache.ibatis.annotations.Mapper; | |||
| 
 | |||
| import java.util.LinkedList; | |||
| import java.util.List; | |||
| 
 | |||
| /** | |||
|  * 区/街道相关分数表 | |||
|  * | |||
|  * @author generator generator@elink-cn.com | |||
|  * @since v1.0.0 2020-09-02 | |||
|  */ | |||
| @Mapper | |||
| public interface FactIndexCommunitySubScoreDao { | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 查询社区级组织某一月份某项能力对应的各项指标 | |||
|      * @author sun | |||
|      */ | |||
|     List<AblityListResultDTO> selectCommunityAblityList(AblityListFormDTO formDTO); | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 查询社区级组织某项能力对应的一项指标过去12个月份数据 | |||
|      * @author sun | |||
|      */ | |||
|     LinkedList<MonthAblityListResultDTO> selectCommunityMonthAblityList(MonthAblityListFormDTO formDTO); | |||
| } | |||
| @ -0,0 +1,63 @@ | |||
| package com.epmet.datareport.service.fact; | |||
| 
 | |||
| import com.epmet.evaluationindex.screen.dto.form.*; | |||
| import com.epmet.evaluationindex.screen.dto.result.*; | |||
| 
 | |||
| import java.util.List; | |||
| 
 | |||
| /** | |||
|  * 数据改版api | |||
|  * @author sun | |||
|  */ | |||
| public interface FactIndexService { | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description  能力指数 | |||
|      * @author sun | |||
|      */ | |||
|     List<AblityIndexResultDTO> ablityIndex(AblityIndexFormDTO formDTO); | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description  按月份查询各项能力分数 | |||
|      * @author sun | |||
|      */ | |||
|     List<ScoreListResultDTO> scoreList(ScoreListFormDTO formDTO); | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description  按月份查询各项能力最近12个月得分 | |||
|      * @author sun | |||
|      */ | |||
|     List<MonthScoreListResultDTO> monthScoreList(MonthScoreListFormDTO formDTO); | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description  按月查询各项指标数据 | |||
|      * @author sun | |||
|      */ | |||
|     List<AblityListResultDTO> ablityList(AblityListFormDTO formDTO); | |||
| 
 | |||
|     /** | |||
|      * @param  formDTO | |||
|      * @Description  按月查询各项指标最近12个月数据 | |||
|      * @author sun | |||
|      */ | |||
|     List<MonthAblityListResultDTO> monthAblityList(MonthAblityListFormDTO formDTO); | |||
| 
 | |||
|     /** | |||
|      * @param  formDTO | |||
|      * @Description  同级对比各项数据查询 | |||
|      * @author sun | |||
|      */ | |||
|     List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO); | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description  是否根组织 | |||
|      * @author sun | |||
|      */ | |||
|     RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO); | |||
| 
 | |||
| } | |||
| @ -0,0 +1,235 @@ | |||
| package com.epmet.datareport.service.fact.impl; | |||
| 
 | |||
| import com.epmet.commons.dynamic.datasource.annotation.DataSource; | |||
| import com.epmet.commons.tools.constant.NumConstant; | |||
| import com.epmet.commons.tools.exception.ErrorCode; | |||
| import com.epmet.commons.tools.exception.RenException; | |||
| import com.epmet.constant.DataSourceConstant; | |||
| import com.epmet.datareport.constant.FactConstant; | |||
| import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; | |||
| import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; | |||
| import com.epmet.datareport.dao.fact.FactIndexAgencyScoreDao; | |||
| import com.epmet.datareport.dao.fact.FactIndexAgencySubScoreDao; | |||
| import com.epmet.datareport.dao.fact.FactIndexCommunitySubScoreDao; | |||
| import com.epmet.datareport.service.fact.FactIndexService; | |||
| import com.epmet.evaluationindex.screen.dto.form.*; | |||
| import com.epmet.evaluationindex.screen.dto.result.*; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| 
 | |||
| import java.text.ParseException; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.*; | |||
| 
 | |||
| /** | |||
|  * 数据改版api | |||
|  * | |||
|  * @author sun | |||
|  */ | |||
| @Service | |||
| @DataSource(DataSourceConstant.EVALUATION_INDEX) | |||
| public class FactIndexServiceImpl implements FactIndexService { | |||
| 
 | |||
|     @Autowired | |||
|     private ScreenCustomerAgencyDao screenCustomerAgencyDao; | |||
|     @Autowired | |||
|     private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; | |||
|     @Autowired | |||
|     private FactIndexAgencyScoreDao factIndexAgencyScoreDao; | |||
|     @Autowired | |||
|     private FactIndexAgencySubScoreDao factIndexAgencySubScoreDao; | |||
|     @Autowired | |||
|     private FactIndexCommunitySubScoreDao factIndexCommunitySubScoreDao; | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 能力指数 | |||
|      * @author sun | |||
|      */ | |||
|     @Override | |||
|     public List<AblityIndexResultDTO> ablityIndex(AblityIndexFormDTO formDTO) { | |||
|         LinkedList<AblityIndexResultDTO> resultDTO = new LinkedList<>(); | |||
|         //分别查询过去12个月党建能力、治理能力、服务能力各自总分乘权重后的分值,每个月份三个分值的加和就是当月的能力指数的分值  fact_index_agency_score  按月份升序
 | |||
|         //1.查询组织过去12个月党建能力指标
 | |||
|         //LinkedList<AblityIndexResultDTO.MonthScoreResultDTO.ScoreListResultDTO> djList = factIndexAgencyScoreDao.;
 | |||
|         LinkedList<AblityIndexResultDTO.ScoreListResultDTO> djList = null; | |||
|         //2.查询组织过去12个月治理能力指标
 | |||
|         LinkedList<AblityIndexResultDTO.ScoreListResultDTO> zlList = null; | |||
|         //3.查询组织过去12个月服务能力指标
 | |||
|         LinkedList<AblityIndexResultDTO.ScoreListResultDTO> fwList = null; | |||
|         //4.遍历计算每个月能力指数
 | |||
|         LinkedList<AblityIndexResultDTO.ScoreListResultDTO> nlList = new LinkedList<>(); | |||
|         for (int i = 0; i < djList.size(); i++) { | |||
|             AblityIndexResultDTO.ScoreListResultDTO nldto = new AblityIndexResultDTO.ScoreListResultDTO(); | |||
|             nldto.setIndexTotal(djList.get(i).getIndexTotal() + zlList.get(i).getIndexTotal() + fwList.get(i).getIndexTotal()); | |||
|             nldto.setAgencyScore(djList.get(i).getAgencyScore() + zlList.get(i).getAgencyScore() + fwList.get(i).getAgencyScore()); | |||
|             nldto.setSubAgencyScore(djList.get(i).getSubAgencyScore() + zlList.get(i).getSubAgencyScore() + fwList.get(i).getSubAgencyScore()); | |||
|             nldto.setMonthId(djList.get(i).getMonthId()); | |||
|             nlList.add(nldto); | |||
|         } | |||
|         //5.封装数据并返回
 | |||
|         AblityIndexResultDTO nl = new AblityIndexResultDTO(); | |||
|         nl.setIndexCode(FactConstant.NLZB); | |||
|         nl.setScoreList(djList); | |||
|         resultDTO.add(nl); | |||
|         AblityIndexResultDTO dj = new AblityIndexResultDTO(); | |||
|         dj.setIndexCode(FactConstant.DJNL); | |||
|         dj.setScoreList(djList); | |||
|         resultDTO.add(dj); | |||
|         AblityIndexResultDTO zl = new AblityIndexResultDTO(); | |||
|         zl.setIndexCode(FactConstant.ZLNL); | |||
|         zl.setScoreList(djList); | |||
|         resultDTO.add(zl); | |||
|         AblityIndexResultDTO fw = new AblityIndexResultDTO(); | |||
|         fw.setIndexCode(FactConstant.FWNL); | |||
|         fw.setScoreList(djList); | |||
|         resultDTO.add(fw); | |||
| 
 | |||
|         return resultDTO; | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 按月份查询各项能力分数 | |||
|      * @author sun | |||
|      */ | |||
|     @Override | |||
|     public List<ScoreListResultDTO> scoreList(ScoreListFormDTO formDTO) { | |||
|         //1.查询当前组织某一月份党建能力对应的总分、本级分、下级分
 | |||
|         formDTO.setIndexCode(FactConstant.DJNL); | |||
|         ScoreListResultDTO dj = factIndexAgencyScoreDao.selectScore(formDTO); | |||
|         //2.查询当前组织某一月份治理能力对应的总分、本级分、下级分
 | |||
|         //3.查询当前组织某一月份服务能力对应的总分、本级分、下级分
 | |||
| 
 | |||
|         return null; | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 按月份查询各项能力最近12个月得分 | |||
|      * @author sun | |||
|      */ | |||
|     @Override | |||
|     public List<MonthScoreListResultDTO> monthScoreList(MonthScoreListFormDTO formDTO) { | |||
|         return null; | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 按月查询各项指标数据 | |||
|      * @author sun | |||
|      */ | |||
|     @Override | |||
|     public List<AblityListResultDTO> ablityList(AblityListFormDTO formDTO) { | |||
|         List<AblityListResultDTO> resultList = new ArrayList<>(); | |||
|         //按月份查询当前组织各项指标数据 fact_index_agency_sub_score
 | |||
|         //1.根据组织Id查询组织信息
 | |||
|         CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); | |||
|         if (null == agency) { | |||
|             throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getAgencyId())); | |||
|         } | |||
|         //2.根据组织级别拼接查询条件,判断查询不同数据表
 | |||
|         //区县级、乡镇街道级
 | |||
|         if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { | |||
|             if ("district".equals(agency.getLevel())) { | |||
|                 formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); | |||
|             } else { | |||
|                 formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); | |||
|             } | |||
|             resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); | |||
| 
 | |||
|             //社区级
 | |||
|         } else if ("community".equals(agency.getLevel())) { | |||
|             formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); | |||
|             resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); | |||
|         } else { | |||
|             throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); | |||
|         } | |||
|         //3.调用方法判断各项指标是数字指标还是百分比指标 //TODO
 | |||
|         return resultList; | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 按月查询各项指标最近12个月数据 | |||
|      * @author sun | |||
|      */ | |||
|     @Override | |||
|     public List<MonthAblityListResultDTO> monthAblityList(MonthAblityListFormDTO formDTO) { | |||
|         LinkedList<MonthAblityListResultDTO> resultList = new LinkedList<>(); | |||
|         //1.计算所查月份前12个月的monthId
 | |||
|         formDTO.setStartMonthId(getDate(formDTO.getMonthId())); | |||
|         //2.根据组织Id查询组织信息
 | |||
|         CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getAgencyId()); | |||
|         if (null == agency) { | |||
|             throw new RenException(String.format("查询到组织信息失败,组织Id:%s", formDTO.getAgencyId())); | |||
|         } | |||
| 
 | |||
|         //3.根据组织级别拼接查询条件,判断查询不同数据表
 | |||
|         //区县级、乡镇街道级
 | |||
|         if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { | |||
|             resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); | |||
| 
 | |||
|             //社区级
 | |||
|         } else if ("community".equals(agency.getLevel())) { | |||
|             resultList =  factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); | |||
|         } else { | |||
|             throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getAgencyId())); | |||
|         } | |||
|         //3.调用方法判断各项指标是数字指标还是百分比指标//TODO
 | |||
|         return resultList; | |||
|     } | |||
| 
 | |||
|     public String getDate(String newDate) { | |||
|         String date = ""; | |||
|         SimpleDateFormat sdf = new SimpleDateFormat("yyyymm"); | |||
|         try { | |||
|             Calendar ds = Calendar.getInstance(); | |||
|             ds.setTime(sdf.parse(newDate)); | |||
|             ds.add(Calendar.YEAR, -1); | |||
|             date = sdf.format(ds.getTime()); | |||
|         } catch (RenException | ParseException e) { | |||
|             e.printStackTrace(); | |||
|         } | |||
|         return date; | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 同级对比各项数据查询 | |||
|      * @author sun | |||
|      */ | |||
|     @Override | |||
|     public List<PeerComparisonResultDTO> peerComparison(PeerComparisonFormDTO formDTO) { | |||
|         //1.根据组织Id的上级组织Id查询同级组织对应类型的得分排名(查询最近一个月数据)
 | |||
|         List<PeerComparisonResultDTO> resultList = screenIndexDataMonthlyDao.selectScoreList(formDTO); | |||
|         return resultList; | |||
|     } | |||
| 
 | |||
|     /** | |||
|      * @param formDTO | |||
|      * @Description 是否根组织 | |||
|      * @author sun | |||
|      */ | |||
|     @Override | |||
|     public RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO) { | |||
|         RootAgencyResultDTO resultDTO = new RootAgencyResultDTO(); | |||
|         //1.根据agencyId查询是否为根级组织
 | |||
|         int num = screenCustomerAgencyDao.selectRootAgency(formDTO.getAgencyId()); | |||
|         if (num < NumConstant.ONE) { | |||
|             resultDTO.setIsRoot(false); | |||
|         } | |||
|         //2.计算统计数据更新时间
 | |||
|         SimpleDateFormat d = new SimpleDateFormat("yyyy-MM-dd"); | |||
|         Calendar calendar = Calendar.getInstance(); | |||
|         //获取当前月第一天日期
 | |||
|         calendar.add(Calendar.MONTH, 0); | |||
|         calendar.set(Calendar.DAY_OF_MONTH, 1); | |||
|         //获取上月最后一天日期
 | |||
|         calendar.set(Calendar.HOUR, -24); | |||
|         resultDTO.setDate(d.format(calendar.getTime())); | |||
| 
 | |||
|         return resultDTO; | |||
|     } | |||
| 
 | |||
| } | |||
| @ -0,0 +1,10 @@ | |||
| <?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.datareport.dao.fact.FactIndexAgencyScoreDao"> | |||
| 
 | |||
|     <select id="selectScore" resultType="com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO"> | |||
| 
 | |||
|     </select> | |||
| 
 | |||
| </mapper> | |||
| @ -0,0 +1,42 @@ | |||
| <?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.datareport.dao.fact.FactIndexAgencySubScoreDao"> | |||
| 
 | |||
|     <select id="selectAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO"> | |||
|         SELECT | |||
|             fact.index_code AS "key", | |||
|             IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", | |||
|             dict.index_name AS "name" | |||
|         FROM | |||
|             fact_index_agency_sub_score fact | |||
|         LEFT JOIN index_dict dict ON fact.index_code = dict.index_code | |||
|         WHERE | |||
|             fact.del_flag = '0' | |||
|         AND dict.del_flag = '0' | |||
|         AND fact.all_parent_index_code = #{allParentIndexCode} | |||
|         AND customer_id = #{customerId} | |||
|         AND agency_id = #{agencyId} | |||
|         AND month_id = #{monthId} | |||
|     </select> | |||
| 
 | |||
|     <select id="selectMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO"> | |||
|         SELECT | |||
|             fact.month_id AS "monthId", | |||
|             IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity" | |||
|         FROM | |||
|             fact_index_agency_sub_score fact | |||
|         LEFT JOIN index_dict dict ON fact.index_code = dict.index_code | |||
|         WHERE | |||
|             fact.del_flag = '0' | |||
|         AND dict.del_flag = '0' | |||
|         AND customer_id = #{customerId} | |||
|         AND agency_id = #{agencyId} | |||
|         AND month_id <= #{monthId} | |||
|         AND month_id > #{startMonthId} | |||
|         AND fact.index_code = #{key} | |||
|         ORDER BY | |||
|             fact.month_id ASC | |||
|     </select> | |||
| 
 | |||
| </mapper> | |||
| @ -0,0 +1,42 @@ | |||
| <?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.datareport.dao.fact.FactIndexCommunitySubScoreDao"> | |||
| 
 | |||
|     <select id="selectCommunityAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO"> | |||
|         SELECT | |||
|             fact.index_code AS "key", | |||
|             IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", | |||
|             dict.index_name AS "name" | |||
|         FROM | |||
|             fact_index_community_sub_score fact | |||
|         LEFT JOIN index_dict dict ON fact.index_code = dict.index_code | |||
|         WHERE | |||
|             fact.del_flag = '0' | |||
|         AND dict.del_flag = '0' | |||
|         AND fact.all_parent_index_code = #{allParentIndexCode} | |||
|         AND customer_id = #{customerId} | |||
|         AND agency_id = #{agencyId} | |||
|         AND month_id = #{monthId} | |||
|     </select> | |||
| 
 | |||
|     <select id="selectCommunityMonthAblityList" resultType="com.epmet.evaluationindex.screen.dto.result.MonthAblityListResultDTO"> | |||
|         SELECT | |||
|             fact.month_id AS "monthId", | |||
|             IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "ablity" | |||
|         FROM | |||
|             fact_index_community_sub_score fact | |||
|         LEFT JOIN index_dict dict ON fact.index_code = dict.index_code | |||
|         WHERE | |||
|             fact.del_flag = '0' | |||
|         AND dict.del_flag = '0' | |||
|         AND customer_id = #{customerId} | |||
|         AND agency_id = #{agencyId} | |||
|         AND month_id <= #{monthId} | |||
|         AND month_id > #{startMonthId} | |||
|         AND fact.index_code = #{key} | |||
|         ORDER BY | |||
|             fact.month_id ASC | |||
|     </select> | |||
| 
 | |||
| </mapper> | |||
					Loading…
					
					
				
		Reference in new issue