17 changed files with 330 additions and 21 deletions
@ -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.dao.evaluationindex.indexcal; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.evaluationindex.indexcal.DeptSelfSubScoreEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 社区相关 自身/下级分数表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-09-21 |
|||
*/ |
|||
@Mapper |
|||
public interface DeptSelfSubScoreDao extends BaseDao<DeptSelfSubScoreEntity> { |
|||
|
|||
int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("parentIndexCode") String parentIndexCode); |
|||
|
|||
int insertBatch(@Param("list") List<DeptSelfSubScoreEntity> deptSelfSubScoreEntities); |
|||
} |
@ -0,0 +1,100 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity.evaluationindex.indexcal; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 区直部门相关 自身/下级分数表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-09-23 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = false) |
|||
@TableName("fact_index_dept_self_sub_score") |
|||
public class DeptSelfSubScoreEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 部门id |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 组织id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 年度ID: yyyy |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 月维度Id: yyyyMM |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 自身指标得分 |
|||
*/ |
|||
private BigDecimal selfScore; |
|||
|
|||
/** |
|||
* 下级指标得分 |
|||
*/ |
|||
private BigDecimal subScore; |
|||
|
|||
/** |
|||
* 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; |
|||
*/ |
|||
private String parentIndexCode; |
|||
|
|||
/** |
|||
* 所有指标code拼接的字符串 冒号隔开 |
|||
*/ |
|||
private String allParentIndexCode; |
|||
|
|||
/** |
|||
* 自身指标权重 |
|||
*/ |
|||
private BigDecimal selfWeight; |
|||
|
|||
/** |
|||
* 下级指标权重 |
|||
*/ |
|||
private BigDecimal subWeight; |
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.evaluationindex.indexcal.DeptSelfSubScoreDao"> |
|||
|
|||
<delete id="deleteByMonthId"> |
|||
delete from fact_index_dept_self_sub_score |
|||
where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} |
|||
AND MONTH_ID = #{monthId,jdbcType=VARCHAR} |
|||
AND PARENT_INDEX_CODE = #{parentIndexCode,jdbcType=VARCHAR} |
|||
limit 1000 |
|||
</delete> |
|||
|
|||
<insert id="insertBatch"> |
|||
INSERT INTO `fact_index_dept_self_sub_score` ( |
|||
`ID`, |
|||
`CUSTOMER_ID`, |
|||
`AGENCY_ID`, |
|||
`DEPT_ID`, |
|||
`QUARTER_ID`, |
|||
`YEAR_ID`, |
|||
`MONTH_ID`, |
|||
`SELF_SCORE`, |
|||
`SUB_SCORE`, |
|||
`PARENT_INDEX_CODE`, |
|||
`ALL_PARENT_INDEX_CODE`, |
|||
`SELF_WEIGHT`, |
|||
`SUB_WEIGHT`, |
|||
`DEL_FLAG`, |
|||
`REVISION`, |
|||
`CREATED_BY`, |
|||
`CREATED_TIME`, |
|||
`UPDATED_BY`, |
|||
`UPDATED_TIME` |
|||
) |
|||
VALUES |
|||
<foreach collection="list" item="item" index="index" separator=","> |
|||
( |
|||
(SELECT REPLACE(UUID(), '-', '') AS id), |
|||
#{item.customerId}, |
|||
#{item.agencyId}, |
|||
#{item.deptId}, |
|||
#{item.quarterId}, |
|||
#{item.yearId}, |
|||
#{item.monthId}, |
|||
#{item.selfScore}, |
|||
#{item.subScore}, |
|||
#{item.parentIndexCode}, |
|||
#{item.allParentIndexCode}, |
|||
#{item.selfWeight}, |
|||
#{item.subWeight}, |
|||
0, |
|||
0, |
|||
'APP_USER', |
|||
now(), |
|||
'APP_USER', |
|||
now() |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
</mapper> |
Loading…
Reference in new issue