29 changed files with 1679 additions and 38 deletions
@ -0,0 +1,17 @@ |
|||||
|
package com.epmet.dto.project; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2021/5/21 10:53 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ProjectPointDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -592430619162380664L; |
||||
|
private String projectId; |
||||
|
private Integer point; |
||||
|
} |
@ -0,0 +1,132 @@ |
|||||
|
/** |
||||
|
* 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.dto.screen; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* 基层治理-治理能力排行数据(按月统计) |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-24 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ScreenGovernRankDataDailyDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* ID 主键 |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 年Id |
||||
|
*/ |
||||
|
private String yearId; |
||||
|
|
||||
|
/** |
||||
|
* 月份Id |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 数据更新至:yyyyMMdd |
||||
|
*/ |
||||
|
private String dateId; |
||||
|
|
||||
|
/** |
||||
|
* 组织类别 agency:组织;部门:department;网格:grid |
||||
|
*/ |
||||
|
private String orgType; |
||||
|
|
||||
|
/** |
||||
|
* 组织Id 可以为网格,机关id |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* 上级组织Id |
||||
|
*/ |
||||
|
private String parentId; |
||||
|
|
||||
|
/** |
||||
|
* 组织名称 |
||||
|
*/ |
||||
|
private String orgName; |
||||
|
|
||||
|
/** |
||||
|
* 响应率 |
||||
|
*/ |
||||
|
private BigDecimal responseRatio; |
||||
|
|
||||
|
/** |
||||
|
* 解决率 |
||||
|
*/ |
||||
|
private BigDecimal resolvedRatio; |
||||
|
|
||||
|
/** |
||||
|
* 自治率 |
||||
|
*/ |
||||
|
private BigDecimal governRatio; |
||||
|
|
||||
|
/** |
||||
|
* 满意率 |
||||
|
*/ |
||||
|
private BigDecimal satisfactionRatio; |
||||
|
|
||||
|
/** |
||||
|
* 删除标识 0未删除;1已删除 |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* 乐观锁 |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* 创建人 |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* 创建时间 |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* 更新人 |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
/** |
||||
|
* 更新时间 |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao.evaluationindex.screen; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 基层治理-治理能力排行数据(按月统计) |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-24 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface ScreenGovernRankDataDailyDao extends BaseDao<ScreenGovernRankDataDailyEntity> { |
||||
|
/** |
||||
|
* 组织级别初始化数据 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/24 14:52 |
||||
|
* @param customerId |
||||
|
* @param level |
||||
|
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity> |
||||
|
*/ |
||||
|
List<ScreenGovernRankDataDailyEntity> initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level); |
||||
|
|
||||
|
/** |
||||
|
* 网格级别初始化数据 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/24 14:52 |
||||
|
* @param customerId |
||||
|
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity> |
||||
|
*/ |
||||
|
List<ScreenGovernRankDataDailyEntity> initGridDataList(@Param("customerId") String customerId); |
||||
|
|
||||
|
/** |
||||
|
* 删除旧数据 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/25 10:38 |
||||
|
* @param customerId |
||||
|
* @param orgType |
||||
|
* @param dateId |
||||
|
* @param deleteSize |
||||
|
* @param orgIds |
||||
|
* @return java.lang.Integer |
||||
|
*/ |
||||
|
Integer deleteRankData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("dateId") String dateId, |
||||
|
@Param("deleteSize") Integer deleteSize, |
||||
|
@Param("orgIds")List<String> orgIds); |
||||
|
} |
@ -0,0 +1,102 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity.evaluationindex.screen; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 基层治理-治理能力排行数据(按月统计) |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-24 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("screen_govern_rank_data_daily") |
||||
|
public class ScreenGovernRankDataDailyEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 年Id |
||||
|
*/ |
||||
|
private String yearId; |
||||
|
|
||||
|
/** |
||||
|
* 月份Id |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 数据更新至:yyyyMMdd |
||||
|
*/ |
||||
|
private String dateId; |
||||
|
|
||||
|
/** |
||||
|
* 组织类别 agency:组织;部门:department;网格:grid |
||||
|
*/ |
||||
|
private String orgType; |
||||
|
|
||||
|
/** |
||||
|
* 组织Id 可以为网格,机关id |
||||
|
*/ |
||||
|
private String orgId; |
||||
|
|
||||
|
/** |
||||
|
* 上级组织Id |
||||
|
*/ |
||||
|
private String parentId; |
||||
|
|
||||
|
/** |
||||
|
* 组织名称 |
||||
|
*/ |
||||
|
private String orgName; |
||||
|
|
||||
|
/** |
||||
|
* 响应率 |
||||
|
*/ |
||||
|
private BigDecimal responseRatio; |
||||
|
|
||||
|
/** |
||||
|
* 解决率 |
||||
|
*/ |
||||
|
private BigDecimal resolvedRatio; |
||||
|
|
||||
|
/** |
||||
|
* 自治率 |
||||
|
*/ |
||||
|
private BigDecimal governRatio; |
||||
|
|
||||
|
/** |
||||
|
* 满意率 |
||||
|
*/ |
||||
|
private BigDecimal satisfactionRatio; |
||||
|
|
||||
|
} |
@ -0,0 +1,121 @@ |
|||||
|
/** |
||||
|
* 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.service.evaluationindex.screen; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO; |
||||
|
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 基层治理-治理能力排行数据(按月统计) |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-24 |
||||
|
*/ |
||||
|
public interface ScreenGovernRankDataDailyService extends BaseService<ScreenGovernRankDataDailyEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<ScreenGovernRankDataDailyDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-05-24 |
||||
|
*/ |
||||
|
PageData<ScreenGovernRankDataDailyDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<ScreenGovernRankDataDailyDTO> |
||||
|
* @author generator |
||||
|
* @date 2021-05-24 |
||||
|
*/ |
||||
|
List<ScreenGovernRankDataDailyDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return ScreenGovernRankDataDailyDTO |
||||
|
* @author generator |
||||
|
* @date 2021-05-24 |
||||
|
*/ |
||||
|
ScreenGovernRankDataDailyDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-05-24 |
||||
|
*/ |
||||
|
void save(ScreenGovernRankDataDailyDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-05-24 |
||||
|
*/ |
||||
|
void update(ScreenGovernRankDataDailyDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2021-05-24 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 构造screen_govern_rank_data 初始数据,先赋值为0 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param orgType |
||||
|
* @param agencyLevel |
||||
|
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/24 14:41 |
||||
|
*/ |
||||
|
List<ScreenGovernRankDataDailyEntity> initList(String customerId, String orgType, String agencyLevel); |
||||
|
|
||||
|
/** |
||||
|
* 保存抽取结果 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param orgType |
||||
|
* @param dateId |
||||
|
* @param deleteSize |
||||
|
* @param entityList |
||||
|
* @return void |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/25 10:32 |
||||
|
*/ |
||||
|
void delAndSaveRankData(String customerId, String orgType, String dateId, Integer deleteSize, List<ScreenGovernRankDataDailyEntity> entityList); |
||||
|
} |
@ -0,0 +1,169 @@ |
|||||
|
/** |
||||
|
* 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.service.evaluationindex.screen.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.constant.DataSourceConstant; |
||||
|
import com.epmet.constant.OrgTypeConstant; |
||||
|
import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDailyDao; |
||||
|
import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO; |
||||
|
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; |
||||
|
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; |
||||
|
import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataDailyService; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* 基层治理-治理能力排行数据(按月统计) |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2021-05-24 |
||||
|
*/ |
||||
|
@Service |
||||
|
@Slf4j |
||||
|
@DataSource(DataSourceConstant.EVALUATION_INDEX) |
||||
|
public class ScreenGovernRankDataDailyServiceImpl extends BaseServiceImpl<ScreenGovernRankDataDailyDao, ScreenGovernRankDataDailyEntity> implements ScreenGovernRankDataDailyService { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public PageData<ScreenGovernRankDataDailyDTO> page(Map<String, Object> params) { |
||||
|
IPage<ScreenGovernRankDataDailyEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, ScreenGovernRankDataDailyDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<ScreenGovernRankDataDailyDTO> list(Map<String, Object> params) { |
||||
|
List<ScreenGovernRankDataDailyEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, ScreenGovernRankDataDailyDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<ScreenGovernRankDataDailyEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<ScreenGovernRankDataDailyEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ScreenGovernRankDataDailyDTO get(String id) { |
||||
|
ScreenGovernRankDataDailyEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, ScreenGovernRankDataDailyDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(ScreenGovernRankDataDailyDTO dto) { |
||||
|
ScreenGovernRankDataDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenGovernRankDataDailyEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(ScreenGovernRankDataDailyDTO dto) { |
||||
|
ScreenGovernRankDataDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenGovernRankDataDailyEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 构造screen_govern_rank_data 初始数据,先赋值为0 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param orgType |
||||
|
* @param agencyLevel |
||||
|
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/24 14:41 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<ScreenGovernRankDataDailyEntity> initList(String customerId, String orgType, String agencyLevel) { |
||||
|
List<ScreenGovernRankDataDailyEntity> list = new ArrayList<>(); |
||||
|
switch (orgType) { |
||||
|
case OrgTypeConstant.AGENCY: |
||||
|
log.info("组织级别统计"); |
||||
|
list = baseDao.initAgencyDataList(customerId, agencyLevel); |
||||
|
break; |
||||
|
case OrgTypeConstant.GRID: |
||||
|
log.info("网格级别统计"); |
||||
|
list = baseDao.initGridDataList(customerId); |
||||
|
break; |
||||
|
default: |
||||
|
log.info("部门级别统计"); |
||||
|
break; |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 保存抽取结果 |
||||
|
* |
||||
|
* @param customerId |
||||
|
* @param orgType |
||||
|
* @param dateId |
||||
|
* @param deleteSize |
||||
|
* @param entityList |
||||
|
* @return void |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/9/25 10:32 |
||||
|
*/ |
||||
|
@Override |
||||
|
public void delAndSaveRankData(String customerId, String orgType, String dateId, Integer deleteSize, |
||||
|
List<ScreenGovernRankDataDailyEntity> entityList) { |
||||
|
if (CollectionUtils.isEmpty(entityList)) { |
||||
|
return; |
||||
|
} |
||||
|
List<String> orgIds = new ArrayList<>(); |
||||
|
for (ScreenGovernRankDataDailyEntity entity : entityList) { |
||||
|
orgIds.add(entity.getOrgId()); |
||||
|
} |
||||
|
int deleteNum; |
||||
|
do { |
||||
|
deleteNum = baseDao.deleteRankData(customerId, orgType, dateId, deleteSize, orgIds); |
||||
|
} while (deleteNum != NumConstant.ZERO); |
||||
|
|
||||
|
insertBatch(entityList); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,80 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDailyDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity" id="screenGovernRankDataDailyMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="customerId" column="CUSTOMER_ID"/> |
||||
|
<result property="yearId" column="YEAR_ID"/> |
||||
|
<result property="monthId" column="MONTH_ID"/> |
||||
|
<result property="dateId" column="DATE_ID"/> |
||||
|
<result property="orgType" column="ORG_TYPE"/> |
||||
|
<result property="orgId" column="ORG_ID"/> |
||||
|
<result property="parentId" column="PARENT_ID"/> |
||||
|
<result property="orgName" column="ORG_NAME"/> |
||||
|
<result property="responseRatio" column="RESPONSE_RATIO"/> |
||||
|
<result property="resolvedRatio" column="RESOLVED_RATIO"/> |
||||
|
<result property="governRatio" column="GOVERN_RATIO"/> |
||||
|
<result property="satisfactionRatio" column="SATISFACTION_RATIO"/> |
||||
|
<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> |
||||
|
<delete id="deleteRankData"> |
||||
|
delete from screen_govern_rank_data |
||||
|
where CUSTOMER_ID = #{customerId} |
||||
|
AND DATE_ID <= #{dateId} |
||||
|
<if test='null != orgType and "" != orgType'> |
||||
|
and ORG_TYPE=#{orgType} |
||||
|
</if> |
||||
|
<if test='null!=orgIds and orgIds.size()>0'> |
||||
|
and |
||||
|
( |
||||
|
<foreach collection="orgIds" item="orgId" separator=" OR "> |
||||
|
ORG_ID = #{orgId} |
||||
|
</foreach> |
||||
|
) |
||||
|
</if> |
||||
|
limit #{deleteSize} |
||||
|
</delete> |
||||
|
|
||||
|
<select id="initAgencyDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity"> |
||||
|
SELECT DISTINCT |
||||
|
CUSTOMER_ID, |
||||
|
'agency' AS ORG_TYPE, |
||||
|
AGENCY_ID AS ORG_ID, |
||||
|
PID AS PARENT_ID, |
||||
|
AGENCY_NAME AS ORG_NAME, |
||||
|
0 AS RESPONSE_RATIO, |
||||
|
0 AS RESOLVED_RATIO, |
||||
|
0 AS GOVERN_RATIO, |
||||
|
0 AS SATISFACTION_RATIO |
||||
|
FROM |
||||
|
screen_customer_agency |
||||
|
WHERE |
||||
|
CUSTOMER_ID = #{customerId} |
||||
|
AND `LEVEL` = #{level} |
||||
|
</select> |
||||
|
<select id="initGridDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity"> |
||||
|
SELECT DISTINCT |
||||
|
CUSTOMER_ID, |
||||
|
'grid' AS ORG_TYPE, |
||||
|
GRID_ID AS ORG_ID, |
||||
|
PARENT_AGENCY_ID AS PARENT_ID, |
||||
|
GRID_NAME AS ORG_NAME, |
||||
|
0 AS RESPONSE_RATIO, |
||||
|
0 AS RESOLVED_RATIO, |
||||
|
0 AS GOVERN_RATIO, |
||||
|
0 AS SATISFACTION_RATIO |
||||
|
FROM |
||||
|
screen_customer_grid |
||||
|
WHERE |
||||
|
CUSTOMER_ID = #{customerId} |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue