23 changed files with 1848 additions and 56 deletions
@ -0,0 +1,94 @@ |
|||||
|
package com.elink.esua.epdc.controller; |
||||
|
|
||||
|
import com.elink.esua.epdc.annotation.ReportData; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserDisabilityTypeFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserMonthlySubsidyFormDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserResultDTO; |
||||
|
import com.elink.esua.epdc.service.CustomService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* 特殊人群分析 |
||||
|
* |
||||
|
* @author songyunpeng |
||||
|
* @email yujintao@elink-cn.com |
||||
|
* @date 2019/9/6 19:30 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("screenSpecialUser") |
||||
|
public class ApiScreenSpecialUserController { |
||||
|
|
||||
|
@Autowired |
||||
|
private CustomService customService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @Description 特殊人群分析-人群分布接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO> |
||||
|
**/ |
||||
|
@ReportData |
||||
|
@PostMapping("selectMonthlySubsidy") |
||||
|
public Result<SpecialPopulationDistributionResultDTO> selectPopulationDistribution(){ |
||||
|
return customService.selectPopulationDistribution(); |
||||
|
} |
||||
|
/** |
||||
|
* @Description 特殊人群分析-查人接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [specialUserFormDTO] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.result.SpecialUserResultDTO>> |
||||
|
**/ |
||||
|
@ReportData |
||||
|
@PostMapping("selectMonthlySubsidy") |
||||
|
public Result<PageData<SpecialUserResultDTO>> selectPageSpecialUser(@RequestBody SpecialUserFormDTO dto){ |
||||
|
return customService.selectPageSpecialUser(dto); |
||||
|
} |
||||
|
/** |
||||
|
* @Description 特殊人群分析-详情接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [suId] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.SpecialUserResultDTO> |
||||
|
**/ |
||||
|
@ReportData |
||||
|
@PostMapping("selectSpecialUserDetail/{suId}") |
||||
|
public Result<SpecialUserResultDTO> selectSpecialUserDetail(@PathVariable String suId){ |
||||
|
return customService.selectSpecialUserDetail(suId); |
||||
|
} |
||||
|
/** |
||||
|
* @Description 特殊人群分析-残疾类别分布接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [specialUserDisabilityTypeFormDTO] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO> |
||||
|
**/ |
||||
|
@ReportData |
||||
|
@PostMapping("selectDisabilityType") |
||||
|
public Result<PageData<SpecialUserDisabilityTypeResultDTO>> selectDisabilityType(@RequestBody SpecialUserDisabilityTypeFormDTO dto){ |
||||
|
return customService.selectDisabilityType(dto); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 特殊人群分析-月度补贴情况接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [specialUserDisabilityTypeFormDTO] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO> |
||||
|
**/ |
||||
|
@ReportData |
||||
|
@PostMapping("selectMonthlySubsidy") |
||||
|
public Result<PageData<SpecialUserMonthlySubsidyResultDTO>> selectMonthlySubsidy(@RequestBody SpecialUserMonthlySubsidyFormDTO dto){ |
||||
|
return customService.selectMonthlySubsidy(dto); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,147 @@ |
|||||
|
/** |
||||
|
* 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.elink.esua.epdc.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 特殊人群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2020-11-03 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SpecialUserDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 所属村庄 |
||||
|
*/ |
||||
|
private String suVillage; |
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
private String suName; |
||||
|
|
||||
|
/** |
||||
|
* 出生日期 |
||||
|
*/ |
||||
|
private Date suBirthday; |
||||
|
|
||||
|
/** |
||||
|
* 残疾证号 |
||||
|
*/ |
||||
|
private String suDisabilityNumber; |
||||
|
|
||||
|
/** |
||||
|
* 残疾类别及等级 |
||||
|
*/ |
||||
|
private String suDisabilityType; |
||||
|
|
||||
|
/** |
||||
|
* 是否低保 0:否1:是 |
||||
|
*/ |
||||
|
private String suIsLow; |
||||
|
|
||||
|
/** |
||||
|
* 保障人口 |
||||
|
*/ |
||||
|
private Integer suGuaranteedPopulation; |
||||
|
|
||||
|
/** |
||||
|
* 关系 |
||||
|
*/ |
||||
|
private String suRelationship; |
||||
|
|
||||
|
/** |
||||
|
* 低保金额 |
||||
|
*/ |
||||
|
private BigDecimal suLowMoney; |
||||
|
|
||||
|
/** |
||||
|
* 困难残疾人生活补贴 |
||||
|
*/ |
||||
|
private BigDecimal suLivingSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 重度残疾人护理补贴 |
||||
|
*/ |
||||
|
private BigDecimal suCareSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 经济困难老年人补贴 |
||||
|
*/ |
||||
|
private BigDecimal suElderlySubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 孤困儿童补贴 |
||||
|
*/ |
||||
|
private BigDecimal suChildSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 分散五保补贴 |
||||
|
*/ |
||||
|
private BigDecimal suFiveGuaranteesSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 是否贫困户 0:否1:是 |
||||
|
*/ |
||||
|
private String suIsPoor; |
||||
|
|
||||
|
/** |
||||
|
* 删除表示 0:否1:是 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
package com.elink.esua.epdc.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 残疾类别分布接口参数 |
||||
|
* |
||||
|
* @author songyunpeng |
||||
|
* @since v1.0.0 2020-05-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SpecialUserDisabilityTypeFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2379520294973498819L; |
||||
|
|
||||
|
/** |
||||
|
* 页码 |
||||
|
*/ |
||||
|
@Min(value = 1, message = "页码必须大于0") |
||||
|
private Integer pageIndex; |
||||
|
|
||||
|
/** |
||||
|
* 页容量 |
||||
|
*/ |
||||
|
@Min(value = 1, message = "页容量必须大于0") |
||||
|
private Integer pageSize; |
||||
|
} |
||||
@ -0,0 +1,71 @@ |
|||||
|
package com.elink.esua.epdc.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 查询特殊人群 参数 |
||||
|
* |
||||
|
* @author songyunpeng |
||||
|
* @since v1.0.0 2020-05-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SpecialUserFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2379520294973498819L; |
||||
|
|
||||
|
/** |
||||
|
* 页码 |
||||
|
*/ |
||||
|
@Min(value = 1, message = "页码必须大于0") |
||||
|
private Integer pageIndex; |
||||
|
|
||||
|
/** |
||||
|
* 页容量 |
||||
|
*/ |
||||
|
@Min(value = 1, message = "页容量必须大于0") |
||||
|
private Integer pageSize; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
private String suName; |
||||
|
/** |
||||
|
* 残疾类别及等级 |
||||
|
*/ |
||||
|
private String suDisabilityType; |
||||
|
/** |
||||
|
* 所属村庄 |
||||
|
*/ |
||||
|
private String suVillage; |
||||
|
/** |
||||
|
* 低保户 0:未选中 1:选中 |
||||
|
*/ |
||||
|
private String suIsLow; |
||||
|
/** |
||||
|
* 贫困户 0:未选中 1:选中 |
||||
|
*/ |
||||
|
private String suIsPoor; |
||||
|
/** |
||||
|
* 困难残疾人生活补贴 0:未选中 1:选中 |
||||
|
*/ |
||||
|
private String suLivingSubsidy; |
||||
|
/** |
||||
|
* 重度残疾人护理补贴 0:未选中 1:选中 |
||||
|
*/ |
||||
|
private String suCareSubsidy; |
||||
|
/** |
||||
|
* 经济困难老年人补贴 0:未选中 1:选中 |
||||
|
*/ |
||||
|
private String suElderlySubsidy; |
||||
|
/** |
||||
|
* 孤困儿童补贴 0:未选中 1:选中 |
||||
|
*/ |
||||
|
private String suChildSubsidy; |
||||
|
/** |
||||
|
* 分散五保补贴 0:未选中 1:选中 |
||||
|
*/ |
||||
|
private String suFiveGuaranteesSubsidy; |
||||
|
} |
||||
@ -0,0 +1,29 @@ |
|||||
|
package com.elink.esua.epdc.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 月度补贴情况接口参数 |
||||
|
* |
||||
|
* @author songyunpeng |
||||
|
* @since v1.0.0 2020-05-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SpecialUserMonthlySubsidyFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2379520294973498819L; |
||||
|
|
||||
|
/** |
||||
|
* 页码 |
||||
|
*/ |
||||
|
@Min(value = 1, message = "页码必须大于0") |
||||
|
private Integer pageIndex; |
||||
|
|
||||
|
/** |
||||
|
* 页容量 |
||||
|
*/ |
||||
|
@Min(value = 1, message = "页容量必须大于0") |
||||
|
private Integer pageSize; |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.elink.esua.epdc.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author: songyunpeng |
||||
|
* @Date: 2020/7/4 17:066 |
||||
|
* @Description: 批量导入特殊人群错误反馈 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class EpdcSpecialUserErrorResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 5643743407138967806L; |
||||
|
|
||||
|
/** |
||||
|
* 错误数据行数 |
||||
|
*/ |
||||
|
private String erroLine; |
||||
|
|
||||
|
/** |
||||
|
* 错误数据信息 |
||||
|
*/ |
||||
|
private String errorInfo; |
||||
|
} |
||||
@ -0,0 +1,50 @@ |
|||||
|
package com.elink.esua.epdc.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 特殊人群分布结果 |
||||
|
* |
||||
|
* @author songyunpeng |
||||
|
* @since v1.0.0 2020-05-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SpecialPopulationDistributionResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 总人数 |
||||
|
*/ |
||||
|
private Integer total; |
||||
|
|
||||
|
/** |
||||
|
* 20岁以下人数 |
||||
|
*/ |
||||
|
private Integer ageLevel1; |
||||
|
|
||||
|
/** |
||||
|
* 20-30岁人数 |
||||
|
*/ |
||||
|
private Integer ageLevel2; |
||||
|
|
||||
|
/** |
||||
|
* 30-40岁人数 |
||||
|
*/ |
||||
|
private Integer ageLevel3; |
||||
|
|
||||
|
/** |
||||
|
* 40-50岁人数 |
||||
|
*/ |
||||
|
private Integer ageLevel4; |
||||
|
|
||||
|
/** |
||||
|
* 50岁以上人数 |
||||
|
*/ |
||||
|
private Integer ageLevel5; |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.elink.esua.epdc.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 残疾类别分布接口参数 |
||||
|
* |
||||
|
* @author songyunpeng |
||||
|
* @since v1.0.0 2020-05-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SpecialUserDisabilityTypeResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2379520294973498819L; |
||||
|
|
||||
|
/** |
||||
|
* 残疾类别及等级 |
||||
|
*/ |
||||
|
private String suDisabilityType; |
||||
|
|
||||
|
/** |
||||
|
* 人数 |
||||
|
*/ |
||||
|
private Integer userTotal; |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
package com.elink.esua.epdc.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 月度补贴情况接口参数 |
||||
|
* |
||||
|
* @author songyunpeng |
||||
|
* @since v1.0.0 2020-05-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SpecialUserMonthlySubsidyResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2379520294973498819L; |
||||
|
|
||||
|
/** |
||||
|
* 村庄 |
||||
|
*/ |
||||
|
private Integer suVillage; |
||||
|
|
||||
|
/** |
||||
|
* 人数 |
||||
|
*/ |
||||
|
private Integer userTotal; |
||||
|
|
||||
|
/** |
||||
|
* 补贴金额 |
||||
|
*/ |
||||
|
private BigDecimal subsidyMoney; |
||||
|
} |
||||
@ -0,0 +1,98 @@ |
|||||
|
package com.elink.esua.epdc.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 查询特殊人群结果 |
||||
|
* |
||||
|
* @author songyunpeng |
||||
|
* @since v1.0.0 2020-05-20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SpecialUserResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2379520294973498819L; |
||||
|
|
||||
|
/** |
||||
|
* ID 主键 |
||||
|
*/ |
||||
|
private String suId; |
||||
|
|
||||
|
/** |
||||
|
* 所属村庄 |
||||
|
*/ |
||||
|
private String suVillage; |
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
private String suName; |
||||
|
|
||||
|
/** |
||||
|
* 出生日期 |
||||
|
*/ |
||||
|
private Date suBirthday; |
||||
|
|
||||
|
/** |
||||
|
* 残疾证号 |
||||
|
*/ |
||||
|
private String suDisabilityNumber; |
||||
|
|
||||
|
/** |
||||
|
* 残疾类别及等级 |
||||
|
*/ |
||||
|
private String suDisabilityType; |
||||
|
|
||||
|
/** |
||||
|
* 是否低保 0:否1:是 |
||||
|
*/ |
||||
|
private String suIsLow; |
||||
|
|
||||
|
/** |
||||
|
* 保障人口 |
||||
|
*/ |
||||
|
private Integer suGuaranteedPopulation; |
||||
|
|
||||
|
/** |
||||
|
* 关系 |
||||
|
*/ |
||||
|
private String suRelationship; |
||||
|
|
||||
|
/** |
||||
|
* 低保金额 |
||||
|
*/ |
||||
|
private BigDecimal suLowMoney; |
||||
|
|
||||
|
/** |
||||
|
* 困难残疾人生活补贴 |
||||
|
*/ |
||||
|
private BigDecimal suLivingSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 重度残疾人护理补贴 |
||||
|
*/ |
||||
|
private BigDecimal suCareSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 经济困难老年人补贴 |
||||
|
*/ |
||||
|
private BigDecimal suElderlySubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 孤困儿童补贴 |
||||
|
*/ |
||||
|
private BigDecimal suChildSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 分散五保补贴 |
||||
|
*/ |
||||
|
private BigDecimal suFiveGuaranteesSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 是否贫困户 0:否1:是 |
||||
|
*/ |
||||
|
private String suIsPoor; |
||||
|
} |
||||
@ -0,0 +1,89 @@ |
|||||
|
package com.elink.esua.epdc.modules.specialuser.controller; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserDisabilityTypeFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserMonthlySubsidyFormDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserResultDTO; |
||||
|
import com.elink.esua.epdc.modules.specialuser.service.SpecialUserService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* @author songyunpeng |
||||
|
* @Description |
||||
|
* @create 2020-11-04 |
||||
|
*/ |
||||
|
@RestController("screenSpecialUser") |
||||
|
public class EpdcScreenSpecialUserController { |
||||
|
|
||||
|
|
||||
|
@Autowired |
||||
|
private SpecialUserService specialUserService; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @Description 特殊人群分析-人群分布接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO> |
||||
|
**/ |
||||
|
@PostMapping("selectMonthlySubsidy") |
||||
|
public Result<SpecialPopulationDistributionResultDTO> selectPopulationDistribution(){ |
||||
|
return specialUserService.selectPopulationDistribution(); |
||||
|
} |
||||
|
/** |
||||
|
* @Description 特殊人群分析-查人接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [specialUserFormDTO] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.result.SpecialUserResultDTO>> |
||||
|
**/ |
||||
|
@PostMapping("selectMonthlySubsidy") |
||||
|
public Result<PageData<SpecialUserResultDTO>> selectPageSpecialUser(@RequestBody SpecialUserFormDTO dto){ |
||||
|
return specialUserService.selectPageSpecialUser(dto); |
||||
|
} |
||||
|
/** |
||||
|
* @Description 特殊人群分析-详情接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [suId] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.SpecialUserResultDTO> |
||||
|
**/ |
||||
|
@PostMapping("selectSpecialUserDetail/{suId}") |
||||
|
public Result<SpecialUserResultDTO> selectSpecialUserDetail(@PathVariable String suId){ |
||||
|
return specialUserService.selectSpecialUserDetail(suId); |
||||
|
} |
||||
|
/** |
||||
|
* @Description 特殊人群分析-残疾类别分布接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [specialUserDisabilityTypeFormDTO] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO> |
||||
|
**/ |
||||
|
@PostMapping("selectDisabilityType") |
||||
|
public Result<PageData<SpecialUserDisabilityTypeResultDTO>> selectDisabilityType(@RequestBody SpecialUserDisabilityTypeFormDTO dto){ |
||||
|
return specialUserService.selectDisabilityType(dto); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 特殊人群分析-月度补贴情况接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [specialUserDisabilityTypeFormDTO] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO> |
||||
|
**/ |
||||
|
@PostMapping("selectMonthlySubsidy") |
||||
|
public Result<PageData<SpecialUserMonthlySubsidyResultDTO>> selectMonthlySubsidy(@RequestBody SpecialUserMonthlySubsidyFormDTO dto){ |
||||
|
return specialUserService.selectMonthlySubsidy(dto); |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,135 @@ |
|||||
|
/** |
||||
|
* 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.elink.esua.epdc.modules.specialuser.controller; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
||||
|
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
||||
|
import com.elink.esua.epdc.dto.SpecialUserDTO; |
||||
|
import com.elink.esua.epdc.modules.specialuser.excel.SpecialUserExcel; |
||||
|
import com.elink.esua.epdc.modules.specialuser.service.SpecialUserService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
import java.io.InputStream; |
||||
|
import java.io.OutputStream; |
||||
|
import java.net.URLEncoder; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 特殊人群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2020-11-03 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("specialuser") |
||||
|
public class SpecialUserController { |
||||
|
|
||||
|
@Autowired |
||||
|
private SpecialUserService specialUserService; |
||||
|
|
||||
|
@GetMapping("page") |
||||
|
public Result<PageData<SpecialUserDTO>> page(@RequestParam Map<String, Object> params){ |
||||
|
PageData<SpecialUserDTO> page = specialUserService.page(params); |
||||
|
return new Result<PageData<SpecialUserDTO>>().ok(page); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("{id}") |
||||
|
public Result<SpecialUserDTO> get(@PathVariable("id") String id){ |
||||
|
SpecialUserDTO data = specialUserService.get(id); |
||||
|
return new Result<SpecialUserDTO>().ok(data); |
||||
|
} |
||||
|
|
||||
|
@PostMapping |
||||
|
public Result save(@RequestBody SpecialUserDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
||||
|
specialUserService.save(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@PutMapping |
||||
|
public Result update(@RequestBody SpecialUserDTO dto){ |
||||
|
//效验数据
|
||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
||||
|
specialUserService.update(dto); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@DeleteMapping |
||||
|
public Result delete(@RequestBody String[] ids){ |
||||
|
//效验数据
|
||||
|
AssertUtils.isArrayEmpty(ids, "id"); |
||||
|
specialUserService.delete(ids); |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@GetMapping("export") |
||||
|
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
||||
|
List<SpecialUserDTO> list = specialUserService.list(params); |
||||
|
ExcelUtils.exportExcelToTarget(response, null, list, SpecialUserExcel.class); |
||||
|
} |
||||
|
/** |
||||
|
* @Description 批量导入 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/8/31 |
||||
|
* @Param [file] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
**/ |
||||
|
@PostMapping("importExcel") |
||||
|
public Result importExcel(@RequestParam("file") MultipartFile file) { |
||||
|
return specialUserService.importSpecialUser(file); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 导出模板 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/8/27 |
||||
|
* @Param [params, response] |
||||
|
* @return void |
||||
|
**/ |
||||
|
@GetMapping("exportModule") |
||||
|
public void exportModule(HttpServletResponse res) throws Exception{ |
||||
|
//获取要下载的模板名称
|
||||
|
String fileName = "民政享受政策人员表 - 样表"; |
||||
|
//设置要下载的文件的名称
|
||||
|
res.setCharacterEncoding("UTF-8"); |
||||
|
res.setHeader("content-Type", "application/vnd.ms-excel"); |
||||
|
res.setHeader("Content-Disposition", |
||||
|
"attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xlsx"); |
||||
|
//获取文件的路径
|
||||
|
InputStream input = this.getClass().getResourceAsStream("/excel/民政享受政策人员表 - 样表.xlsx"); |
||||
|
OutputStream out = res.getOutputStream(); |
||||
|
byte[] b = new byte[2048]; |
||||
|
int len; |
||||
|
while ((len = input.read(b)) != -1) { |
||||
|
out.write(b, 0, len); |
||||
|
} |
||||
|
input.close(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,97 @@ |
|||||
|
/** |
||||
|
* 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.elink.esua.epdc.modules.specialuser.dao; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserDisabilityTypeFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserMonthlySubsidyFormDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserResultDTO; |
||||
|
import com.elink.esua.epdc.modules.specialuser.entity.SpecialUserEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 特殊人群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2020-11-03 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface SpecialUserDao extends BaseDao<SpecialUserEntity> { |
||||
|
/** |
||||
|
* @Description 特殊人群分析-人群分布接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [] |
||||
|
* @return com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO |
||||
|
**/ |
||||
|
SpecialPopulationDistributionResultDTO selectPopulationDistribution(); |
||||
|
/** |
||||
|
* @Description 特殊人群分析-查人接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [specialUserFormDTO] |
||||
|
* @return java.util.List<com.elink.esua.epdc.dto.result.SpecialUserResultDTO> |
||||
|
**/ |
||||
|
List<SpecialUserResultDTO> selectPageSpecialUser(SpecialUserFormDTO specialUserFormDTO); |
||||
|
/** |
||||
|
* @Description 特殊人群分析-查人接口count |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [specialUserFormDTO] |
||||
|
* @return long |
||||
|
**/ |
||||
|
long selectCountSpecialUser(SpecialUserFormDTO specialUserFormDTO); |
||||
|
/** |
||||
|
* @Description 特殊人群分析-残疾类别分布接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [specialUserDisabilityTypeFormDTO] |
||||
|
* @return java.util.List<com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO> |
||||
|
**/ |
||||
|
List<SpecialUserDisabilityTypeResultDTO> selectDisabilityType(SpecialUserDisabilityTypeFormDTO specialUserDisabilityTypeFormDTO); |
||||
|
/** |
||||
|
* @Description 特殊人群分析-残疾类别分布接口 count |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [specialUserDisabilityTypeFormDTO] |
||||
|
* @return java.util.List<com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO> |
||||
|
**/ |
||||
|
long selectCountDisabilityType(SpecialUserDisabilityTypeFormDTO specialUserDisabilityTypeFormDTO); |
||||
|
/** |
||||
|
* @Description 特殊人群分析-月度补贴情况接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [dto] |
||||
|
* @return java.util.List<com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO> |
||||
|
**/ |
||||
|
List<SpecialUserMonthlySubsidyResultDTO> selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto); |
||||
|
/** |
||||
|
* @Description 特殊人群分析-月度补贴情况接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [dto] |
||||
|
* @return java.util.List<com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO> |
||||
|
**/ |
||||
|
Long selectCountMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto); |
||||
|
} |
||||
@ -0,0 +1,116 @@ |
|||||
|
/** |
||||
|
* 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.elink.esua.epdc.modules.specialuser.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 特殊人群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2020-11-03 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("epdc_special_user") |
||||
|
public class SpecialUserEntity extends BaseEpdcEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 所属村庄 |
||||
|
*/ |
||||
|
private String suVillage; |
||||
|
|
||||
|
/** |
||||
|
* 姓名 |
||||
|
*/ |
||||
|
private String suName; |
||||
|
|
||||
|
/** |
||||
|
* 出生日期 |
||||
|
*/ |
||||
|
private Date suBirthday; |
||||
|
|
||||
|
/** |
||||
|
* 残疾证号 |
||||
|
*/ |
||||
|
private String suDisabilityNumber; |
||||
|
|
||||
|
/** |
||||
|
* 残疾类别及等级 |
||||
|
*/ |
||||
|
private String suDisabilityType; |
||||
|
|
||||
|
/** |
||||
|
* 是否低保 0:否1:是 |
||||
|
*/ |
||||
|
private String suIsLow; |
||||
|
|
||||
|
/** |
||||
|
* 保障人口 |
||||
|
*/ |
||||
|
private Integer suGuaranteedPopulation; |
||||
|
|
||||
|
/** |
||||
|
* 关系 |
||||
|
*/ |
||||
|
private String suRelationship; |
||||
|
|
||||
|
/** |
||||
|
* 低保金额 |
||||
|
*/ |
||||
|
private BigDecimal suLowMoney; |
||||
|
|
||||
|
/** |
||||
|
* 困难残疾人生活补贴 |
||||
|
*/ |
||||
|
private BigDecimal suLivingSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 重度残疾人护理补贴 |
||||
|
*/ |
||||
|
private BigDecimal suCareSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 经济困难老年人补贴 |
||||
|
*/ |
||||
|
private BigDecimal suElderlySubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 孤困儿童补贴 |
||||
|
*/ |
||||
|
private BigDecimal suChildSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 分散五保补贴 |
||||
|
*/ |
||||
|
private BigDecimal suFiveGuaranteesSubsidy; |
||||
|
|
||||
|
/** |
||||
|
* 是否贫困户 0:否1:是 |
||||
|
*/ |
||||
|
private String suIsPoor; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,78 @@ |
|||||
|
/** |
||||
|
* 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.elink.esua.epdc.modules.specialuser.excel; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.annotation.Excel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 特殊人群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2020-11-03 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SpecialUserExcel { |
||||
|
|
||||
|
@Excel(name = "所属村庄") |
||||
|
private String suVillage; |
||||
|
|
||||
|
@Excel(name = "姓名") |
||||
|
private String suName; |
||||
|
|
||||
|
@Excel(name = "出生日期") |
||||
|
private String suBirthday; |
||||
|
|
||||
|
@Excel(name = "残疾证号") |
||||
|
private String suDisabilityNumber; |
||||
|
|
||||
|
@Excel(name = "残疾类别及等级") |
||||
|
private String suDisabilityType; |
||||
|
|
||||
|
@Excel(name = "是否低保",replace = {"否_0","是_1"}) |
||||
|
private String suIsLow; |
||||
|
|
||||
|
@Excel(name = "保障人口") |
||||
|
private Integer suGuaranteedPopulation; |
||||
|
|
||||
|
@Excel(name = "关系") |
||||
|
private String suRelationship; |
||||
|
|
||||
|
@Excel(name = "低保金额") |
||||
|
private BigDecimal suLowMoney; |
||||
|
|
||||
|
@Excel(name = "困难残疾人生活补贴") |
||||
|
private BigDecimal suLivingSubsidy; |
||||
|
|
||||
|
@Excel(name = "重度残疾人护理补贴") |
||||
|
private BigDecimal suCareSubsidy; |
||||
|
|
||||
|
@Excel(name = "经济困难老年人补贴") |
||||
|
private BigDecimal suElderlySubsidy; |
||||
|
|
||||
|
@Excel(name = "孤困儿童补贴") |
||||
|
private BigDecimal suChildSubsidy; |
||||
|
|
||||
|
@Excel(name = "分散五保补贴") |
||||
|
private BigDecimal suFiveGuaranteesSubsidy; |
||||
|
|
||||
|
@Excel(name = "是否贫困户",replace = {"否_0","是_1"}) |
||||
|
private String suIsPoor; |
||||
|
} |
||||
@ -0,0 +1,152 @@ |
|||||
|
/** |
||||
|
* 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.elink.esua.epdc.modules.specialuser.service; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.SpecialUserDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserDisabilityTypeFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserMonthlySubsidyFormDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO; |
||||
|
import com.elink.esua.epdc.dto.result.SpecialUserResultDTO; |
||||
|
import com.elink.esua.epdc.modules.specialuser.entity.SpecialUserEntity; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 特殊人群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2020-11-03 |
||||
|
*/ |
||||
|
public interface SpecialUserService extends BaseService<SpecialUserEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<SpecialUserDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-11-03 |
||||
|
*/ |
||||
|
PageData<SpecialUserDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<SpecialUserDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-11-03 |
||||
|
*/ |
||||
|
List<SpecialUserDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return SpecialUserDTO |
||||
|
* @author generator |
||||
|
* @date 2020-11-03 |
||||
|
*/ |
||||
|
SpecialUserDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-11-03 |
||||
|
*/ |
||||
|
void save(SpecialUserDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-11-03 |
||||
|
*/ |
||||
|
void update(SpecialUserDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-11-03 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
/** |
||||
|
* @Description 批量导入 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/3 |
||||
|
* @Param [file] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
**/ |
||||
|
Result importSpecialUser(MultipartFile file); |
||||
|
/** |
||||
|
* @Description 特殊人群分析-人群分布接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO> |
||||
|
**/ |
||||
|
Result<SpecialPopulationDistributionResultDTO> selectPopulationDistribution(); |
||||
|
/** |
||||
|
* @Description 特殊人群分析-查人接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.result.SpecialUserResultDTO>> |
||||
|
* @param specialUserFormDTO*/ |
||||
|
Result<PageData<SpecialUserResultDTO>> selectPageSpecialUser(SpecialUserFormDTO specialUserFormDTO); |
||||
|
/** |
||||
|
* @Description 特殊人群分析-详情接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [suId] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.SpecialUserResultDTO> |
||||
|
**/ |
||||
|
Result<SpecialUserResultDTO> selectSpecialUserDetail(String suId); |
||||
|
/** |
||||
|
* @Description 特殊人群分析-残疾类别分布接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [specialUserDisabilityTypeFormDTO] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO> |
||||
|
**/ |
||||
|
Result<PageData<SpecialUserDisabilityTypeResultDTO>> selectDisabilityType(SpecialUserDisabilityTypeFormDTO specialUserDisabilityTypeFormDTO); |
||||
|
/** |
||||
|
* @Description 特殊人群分析-月度补贴情况接口 |
||||
|
* @Author songyunpeng |
||||
|
* @Date 2020/11/4 |
||||
|
* @Param [dto] |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.commons.tools.page.PageData<com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO>> |
||||
|
**/ |
||||
|
Result<PageData<SpecialUserMonthlySubsidyResultDTO>> selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto); |
||||
|
} |
||||
@ -0,0 +1,222 @@ |
|||||
|
/** |
||||
|
* 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.elink.esua.epdc.modules.specialuser.service.impl; |
||||
|
|
||||
|
import cn.afterturn.easypoi.excel.ExcelImportUtil; |
||||
|
import cn.afterturn.easypoi.excel.entity.ImportParams; |
||||
|
import cn.hutool.core.date.DateUtil; |
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
||||
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.config.StreamUtils; |
||||
|
import com.elink.esua.epdc.dto.SpecialUserDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserDisabilityTypeFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserFormDTO; |
||||
|
import com.elink.esua.epdc.dto.form.SpecialUserMonthlySubsidyFormDTO; |
||||
|
import com.elink.esua.epdc.dto.result.*; |
||||
|
import com.elink.esua.epdc.modules.specialuser.dao.SpecialUserDao; |
||||
|
import com.elink.esua.epdc.modules.specialuser.entity.SpecialUserEntity; |
||||
|
import com.elink.esua.epdc.modules.specialuser.excel.SpecialUserExcel; |
||||
|
import com.elink.esua.epdc.modules.specialuser.service.SpecialUserService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.web.multipart.MultipartFile; |
||||
|
|
||||
|
import java.io.File; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
import java.util.regex.Matcher; |
||||
|
import java.util.regex.Pattern; |
||||
|
|
||||
|
/** |
||||
|
* 特殊人群表 |
||||
|
* |
||||
|
* @author qu qu@elink-cn.com |
||||
|
* @since v1.0.0 2020-11-03 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class SpecialUserServiceImpl extends BaseServiceImpl<SpecialUserDao, SpecialUserEntity> implements SpecialUserService { |
||||
|
|
||||
|
@Override |
||||
|
public PageData<SpecialUserDTO> page(Map<String, Object> params) { |
||||
|
IPage<SpecialUserEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, SpecialUserDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<SpecialUserDTO> list(Map<String, Object> params) { |
||||
|
List<SpecialUserEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, SpecialUserDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<SpecialUserEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
String suVillage = (String)params.get("suVillage"); |
||||
|
String suName = (String)params.get("suName"); |
||||
|
|
||||
|
QueryWrapper<SpecialUserEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
wrapper.like(StringUtils.isNotBlank(suVillage), "SU_VILLAGE", suVillage); |
||||
|
wrapper.like(StringUtils.isNotBlank(suName), "SU_NAME", suName); |
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public SpecialUserDTO get(String id) { |
||||
|
SpecialUserEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, SpecialUserDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(SpecialUserDTO dto) { |
||||
|
SpecialUserEntity entity = ConvertUtils.sourceToTarget(dto, SpecialUserEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(SpecialUserDTO dto) { |
||||
|
SpecialUserEntity entity = ConvertUtils.sourceToTarget(dto, SpecialUserEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result importSpecialUser(MultipartFile file) { |
||||
|
File f = StreamUtils.conversionFile(file); |
||||
|
ImportParams importParams = new ImportParams(); |
||||
|
try { |
||||
|
List<SpecialUserExcel> archivesExcelList = ExcelImportUtil.importExcel(f, SpecialUserExcel.class, importParams); |
||||
|
// 校验数据
|
||||
|
List<EpdcSpecialUserErrorResultDTO> epdcArchivesErrorResultDTOS = this.checkExcel(archivesExcelList); |
||||
|
if (epdcArchivesErrorResultDTOS.size() > 0) { |
||||
|
return new Result().ok(epdcArchivesErrorResultDTOS); |
||||
|
} |
||||
|
saveList(archivesExcelList); |
||||
|
for (SpecialUserExcel archivesExcel : archivesExcelList) { |
||||
|
System.out.println("从Excel导入数据到数据库的详细为 :{}" + JSON.toJSONString(archivesExcel)); |
||||
|
} |
||||
|
System.out.println("从Excel导入数据一共 {} 行 " + archivesExcelList.size()); |
||||
|
} catch (Exception e1) { |
||||
|
throw new RuntimeException("导入失败:{}" + e1.getMessage()); |
||||
|
} |
||||
|
return new Result(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<SpecialPopulationDistributionResultDTO> selectPopulationDistribution() { |
||||
|
return new Result<SpecialPopulationDistributionResultDTO>().ok(baseDao.selectPopulationDistribution()); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<PageData<SpecialUserResultDTO>> selectPageSpecialUser(SpecialUserFormDTO specialUserFormDTO) { |
||||
|
int pageIndex = (specialUserFormDTO.getPageIndex() - NumConstant.ONE) * specialUserFormDTO.getPageSize(); |
||||
|
specialUserFormDTO.setPageIndex(pageIndex); |
||||
|
List<SpecialUserResultDTO> list = baseDao.selectPageSpecialUser(specialUserFormDTO); |
||||
|
PageData<SpecialUserResultDTO> pageData = new PageData<>(list, baseDao.selectCountSpecialUser(specialUserFormDTO)); |
||||
|
return new Result<PageData<SpecialUserResultDTO>>().ok(pageData); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<SpecialUserResultDTO> selectSpecialUserDetail(String suId) { |
||||
|
SpecialUserEntity specialUserEntity = selectById(suId); |
||||
|
return new Result<SpecialUserResultDTO>().ok(ConvertUtils.sourceToTarget(specialUserEntity,SpecialUserResultDTO.class)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<PageData<SpecialUserDisabilityTypeResultDTO>> selectDisabilityType(SpecialUserDisabilityTypeFormDTO specialUserDisabilityTypeFormDTO) { |
||||
|
int pageIndex = (specialUserDisabilityTypeFormDTO.getPageIndex() - NumConstant.ONE) * specialUserDisabilityTypeFormDTO.getPageSize(); |
||||
|
specialUserDisabilityTypeFormDTO.setPageIndex(pageIndex); |
||||
|
List<SpecialUserDisabilityTypeResultDTO> list = baseDao.selectDisabilityType(specialUserDisabilityTypeFormDTO); |
||||
|
PageData<SpecialUserDisabilityTypeResultDTO> pageData = new PageData<>(list, baseDao.selectCountDisabilityType(specialUserDisabilityTypeFormDTO)); |
||||
|
return new Result<PageData<SpecialUserDisabilityTypeResultDTO>>().ok(pageData); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result<PageData<SpecialUserMonthlySubsidyResultDTO>> selectMonthlySubsidy(SpecialUserMonthlySubsidyFormDTO dto) { |
||||
|
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); |
||||
|
dto.setPageIndex(pageIndex); |
||||
|
List<SpecialUserMonthlySubsidyResultDTO> list = baseDao.selectMonthlySubsidy(dto); |
||||
|
PageData<SpecialUserMonthlySubsidyResultDTO> pageData = new PageData<>(list, baseDao.selectCountMonthlySubsidy(dto)); |
||||
|
return new Result<PageData<SpecialUserMonthlySubsidyResultDTO>>().ok(pageData); |
||||
|
} |
||||
|
|
||||
|
/*** |
||||
|
* 校验excel表格数据 |
||||
|
* @return java.lang.String |
||||
|
* @author songyunpeng |
||||
|
* @date 2020/7/6 10:25 |
||||
|
*/ |
||||
|
private List<EpdcSpecialUserErrorResultDTO> checkExcel(List<SpecialUserExcel> specialUserExcels) { |
||||
|
List<EpdcSpecialUserErrorResultDTO> errorLineinfoList = new ArrayList<>(); |
||||
|
EpdcSpecialUserErrorResultDTO errorLineinfoDto; |
||||
|
for (int i = 0; i < specialUserExcels.size(); i++) { |
||||
|
SpecialUserExcel specialUserExcel = specialUserExcels.get(i); |
||||
|
//档号
|
||||
|
String suBirthday = specialUserExcel.getSuBirthday(); |
||||
|
if (StringUtils.isNotBlank(suBirthday)) { |
||||
|
String eL = "(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})(((0[13578]|1[02])(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)(0[1-9]|[12][0-9]|30))|(02(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))0229)"; |
||||
|
Pattern pat = Pattern.compile(eL); |
||||
|
Matcher matcher = pat.matcher(suBirthday); |
||||
|
boolean boo = matcher.matches(); |
||||
|
if(!boo){ |
||||
|
errorLineinfoDto = new EpdcSpecialUserErrorResultDTO(); |
||||
|
errorLineinfoDto.setErroLine((i + 2) + ""); |
||||
|
errorLineinfoDto.setErrorInfo("请检查出生日期格式,例:2021228"); |
||||
|
errorLineinfoList.add(errorLineinfoDto); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return errorLineinfoList; |
||||
|
} |
||||
|
/*** |
||||
|
* 批量添加 |
||||
|
* @return java.lang.String |
||||
|
* @author songyunpeng |
||||
|
* @date 2020/7/6 10:25 |
||||
|
*/ |
||||
|
private void saveList(List<SpecialUserExcel> partyList) { |
||||
|
List<SpecialUserEntity> specialUserExcels = new ArrayList<>(); |
||||
|
for (SpecialUserExcel archivesExcel : partyList) { |
||||
|
SpecialUserEntity archivesEntity = ConvertUtils.sourceToTarget(archivesExcel, SpecialUserEntity.class); |
||||
|
archivesEntity.setSuBirthday(DateUtil.parse(archivesExcel.getSuBirthday())); |
||||
|
specialUserExcels.add(archivesEntity); |
||||
|
} |
||||
|
insertBatch(specialUserExcels); |
||||
|
} |
||||
|
} |
||||
Binary file not shown.
@ -0,0 +1,166 @@ |
|||||
|
<?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.elink.esua.epdc.modules.specialuser.dao.SpecialUserDao"> |
||||
|
|
||||
|
<resultMap type="com.elink.esua.epdc.modules.specialuser.entity.SpecialUserEntity" id="specialUserMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="suVillage" column="SU_VILLAGE"/> |
||||
|
<result property="suName" column="SU_NAME"/> |
||||
|
<result property="suBirthday" column="SU_BIRTHDAY"/> |
||||
|
<result property="suDisabilityNumber" column="SU_DISABILITY_NUMBER"/> |
||||
|
<result property="suDisabilityType" column="SU_DISABILITY_TYPE"/> |
||||
|
<result property="suIsLow" column="SU_IS_LOW"/> |
||||
|
<result property="suGuaranteedPopulation" column="SU_GUARANTEED_POPULATION"/> |
||||
|
<result property="suRelationship" column="SU_RELATIONSHIP"/> |
||||
|
<result property="suLowMoney" column="SU_LOW_MONEY"/> |
||||
|
<result property="suLivingSubsidy" column="SU_LIVING_SUBSIDY"/> |
||||
|
<result property="suCareSubsidy" column="SU_CARE_SUBSIDY"/> |
||||
|
<result property="suElderlySubsidy" column="SU_ELDERLY_SUBSIDY"/> |
||||
|
<result property="suChildSubsidy" column="SU_CHILD_SUBSIDY"/> |
||||
|
<result property="suFiveGuaranteesSubsidy" column="SU_FIVE_GUARANTEES_SUBSIDY"/> |
||||
|
<result property="suIsPoor" column="SU_IS_POOR"/> |
||||
|
<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="selectPopulationDistribution" |
||||
|
resultType="com.elink.esua.epdc.dto.result.SpecialPopulationDistributionResultDTO"> |
||||
|
select count(ID), |
||||
|
count(if(TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())<=20,1,null)) as ageLevel1, |
||||
|
count(if(TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())>=20 and TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())<30,1,null)) as ageLevel2, |
||||
|
count(if(TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())>=30 and TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())<40,1,null)) as ageLevel3, |
||||
|
count(if(TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())>=40 and TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())<50,1,null)) as ageLevel4, |
||||
|
count(if(TIMESTAMPDIFF(YEAR ,SU_BIRTHDAY,curdate())>=50,1,null)) as ageLevel5 |
||||
|
from epdc_special_user |
||||
|
where DEL_FLAG = '0' |
||||
|
</select> |
||||
|
<select id="selectPageSpecialUser" resultType="com.elink.esua.epdc.dto.result.SpecialUserResultDTO"> |
||||
|
select ID as suId, |
||||
|
SU_VILLAGE, |
||||
|
SU_NAME, |
||||
|
SU_BIRTHDAY, |
||||
|
SU_DISABILITY_NUMBER, |
||||
|
SU_DISABILITY_TYPE, |
||||
|
SU_IS_LOW, |
||||
|
SU_GUARANTEED_POPULATION, |
||||
|
SU_RELATIONSHIP, |
||||
|
SU_LOW_MONEY, |
||||
|
SU_LIVING_SUBSIDY, |
||||
|
SU_CARE_SUBSIDY, |
||||
|
SU_ELDERLY_SUBSIDY, |
||||
|
SU_CHILD_SUBSIDY, |
||||
|
SU_FIVE_GUARANTEES_SUBSIDY, |
||||
|
SU_IS_POOR |
||||
|
from epdc_special_user |
||||
|
where DEL_FLAG = '0' |
||||
|
<if test="suName!=null and suName!=''"> |
||||
|
and SU_NAME like concat('%', #{suName}, '%') |
||||
|
</if> |
||||
|
<if test="suDisabilityType!=null and suDisabilityType!=''"> |
||||
|
and SU_DISABILITY_TYPE = #{suName} |
||||
|
</if> |
||||
|
<if test="suVillage!=null and suVillage!=''"> |
||||
|
and SU_VILLAGE = #{suVillage} |
||||
|
</if> |
||||
|
and SU_IS_LOW = #{suIsLow} |
||||
|
and SU_IS_POOR #{suIsPoor} |
||||
|
<if test="suLivingSubsidy!=null and suLivingSubsidy == '1'"> |
||||
|
and SU_LIVING_SUBSIDY > 0 |
||||
|
</if> |
||||
|
<if test="suCareSubsidy!=null and suCareSubsidy == '1'"> |
||||
|
and SU_CARE_SUBSIDY > 0 |
||||
|
</if> |
||||
|
<if test="suElderlySubsidy!=null and suElderlySubsidy == '1'"> |
||||
|
and SU_ELDERLY_SUBSIDY > 0 |
||||
|
</if> |
||||
|
<if test="suChildSubsidy!=null and suChildSubsidy == '1'"> |
||||
|
and SU_CHILD_SUBSIDY > 0 |
||||
|
</if> |
||||
|
<if test="suFiveGuaranteesSubsidy!=null and suFiveGuaranteesSubsidy == '1'"> |
||||
|
and SU_FIVE_GUARANTEES_SUBSIDY > 0 |
||||
|
</if> |
||||
|
order by CREATED_TIME desc |
||||
|
LIMIT #{pageIndex},#{pageSize} |
||||
|
</select> |
||||
|
<select id="selectCountSpecialUser" resultType="java.lang.Long"> |
||||
|
select count(1) |
||||
|
from epdc_special_user |
||||
|
where DEL_FLAG = '0' |
||||
|
<if test="suName!=null and suName!=''"> |
||||
|
and SU_NAME like concat('%', #{suName}, '%') |
||||
|
</if> |
||||
|
<if test="suDisabilityType!=null and suDisabilityType!=''"> |
||||
|
and SU_DISABILITY_TYPE = #{suName} |
||||
|
</if> |
||||
|
<if test="suVillage!=null and suVillage!=''"> |
||||
|
and SU_VILLAGE = #{suVillage} |
||||
|
</if> |
||||
|
and SU_IS_LOW = #{suIsLow} |
||||
|
and SU_IS_POOR #{suIsPoor} |
||||
|
<if test="suLivingSubsidy!=null and suLivingSubsidy == '1'"> |
||||
|
and SU_LIVING_SUBSIDY > 0 |
||||
|
</if> |
||||
|
<if test="suCareSubsidy!=null and suCareSubsidy == '1'"> |
||||
|
and SU_CARE_SUBSIDY > 0 |
||||
|
</if> |
||||
|
<if test="suElderlySubsidy!=null and suElderlySubsidy == '1'"> |
||||
|
and SU_ELDERLY_SUBSIDY > 0 |
||||
|
</if> |
||||
|
<if test="suChildSubsidy!=null and suChildSubsidy == '1'"> |
||||
|
and SU_CHILD_SUBSIDY > 0 |
||||
|
</if> |
||||
|
<if test="suFiveGuaranteesSubsidy!=null and suFiveGuaranteesSubsidy == '1'"> |
||||
|
and SU_FIVE_GUARANTEES_SUBSIDY > 0 |
||||
|
</if> |
||||
|
order by CREATED_TIME desc |
||||
|
</select> |
||||
|
<select id="selectDisabilityType" |
||||
|
resultType="com.elink.esua.epdc.dto.result.SpecialUserDisabilityTypeResultDTO"> |
||||
|
select count(ID) as userTotal,SU_DISABILITY_TYPE as suDisabilityType from epdc_special_user |
||||
|
where DEL_FLAG = '0' and SU_DISABILITY_TYPE is not null and SU_DISABILITY_TYPE != '' |
||||
|
group by SU_DISABILITY_TYPE |
||||
|
order by userTotal desc |
||||
|
LIMIT #{pageIndex},#{pageSize} |
||||
|
</select> |
||||
|
<select id="selectCountDisabilityType" resultType="java.lang.Long"> |
||||
|
select count(1) from ( |
||||
|
select count(ID) as userTotal,SU_DISABILITY_TYPE as suDisabilityType from epdc_special_user |
||||
|
where DEL_FLAG = '0' and SU_DISABILITY_TYPE is not null and SU_DISABILITY_TYPE != '' |
||||
|
group by SU_DISABILITY_TYPE |
||||
|
order by userTotal desc )a |
||||
|
</select> |
||||
|
<select id="selectMonthlySubsidy" |
||||
|
resultType="com.elink.esua.epdc.dto.result.SpecialUserMonthlySubsidyResultDTO"> |
||||
|
select SU_VILLAGE,count(ID) as userTotal, |
||||
|
sum(if(SU_LOW_MONEY is null,0,SU_LOW_MONEY) + |
||||
|
if(SU_LIVING_SUBSIDY is null,0,SU_LIVING_SUBSIDY) + |
||||
|
if(SU_CARE_SUBSIDY is null,0,SU_CARE_SUBSIDY) + |
||||
|
if(SU_ELDERLY_SUBSIDY is null,0,SU_ELDERLY_SUBSIDY) + |
||||
|
if(SU_CHILD_SUBSIDY is null,0,SU_CHILD_SUBSIDY)+ |
||||
|
if(SU_FIVE_GUARANTEES_SUBSIDY is null,0,SU_FIVE_GUARANTEES_SUBSIDY)) as subsidyMoney |
||||
|
from epdc_special_user |
||||
|
where DEL_FLAG = '0' and SU_DISABILITY_TYPE is not null and SU_DISABILITY_TYPE != '' |
||||
|
group by SU_VILLAGE |
||||
|
order by userTotal desc |
||||
|
LIMIT #{pageIndex},#{pageSize} |
||||
|
</select> |
||||
|
<select id="selectCountMonthlySubsidy" resultType="java.lang.Long"> |
||||
|
select count(1) from (select SU_VILLAGE,count(ID) as userTotal, |
||||
|
sum(if(SU_LOW_MONEY is null,0,SU_LOW_MONEY) + |
||||
|
if(SU_LIVING_SUBSIDY is null,0,SU_LIVING_SUBSIDY) + |
||||
|
if(SU_CARE_SUBSIDY is null,0,SU_CARE_SUBSIDY) + |
||||
|
if(SU_ELDERLY_SUBSIDY is null,0,SU_ELDERLY_SUBSIDY) + |
||||
|
if(SU_CHILD_SUBSIDY is null,0,SU_CHILD_SUBSIDY)+ |
||||
|
if(SU_FIVE_GUARANTEES_SUBSIDY is null,0,SU_FIVE_GUARANTEES_SUBSIDY)) as subsidyMoney |
||||
|
from epdc_special_user |
||||
|
where DEL_FLAG = '0' and SU_DISABILITY_TYPE is not null and SU_DISABILITY_TYPE != '' |
||||
|
group by SU_VILLAGE |
||||
|
order by userTotal desc)a |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
||||
Loading…
Reference in new issue