Commit 37cda7f5 authored by fangxinjiang's avatar fangxinjiang

社保支出数据初始化代码备用-fxj

parent 2a1a9f0c
......@@ -78,9 +78,9 @@ public class EkpAlertTableController {
* @Param
* @return
**/
@PostMapping("/tesxWxExcelApi")
/*@PostMapping("/tesxWxExcelApi")
public void tesxWxExcelApi() {
//ekpAlertTableService.tesxWxExcelApi();
ekpAlertTableService.test();
}
}*/
}
......@@ -46,4 +46,8 @@ public interface EkpAlertTableMapper extends BaseMapper<EkpAlertTable> {
List<BudgetWarningVo> getBudgetWarningVos(@Param("km") String km);
List<EkpAlertTable> getEkpAlertTableList(int type);
void insertTest(@Param("str")String str);
List<String> getNos(@Param("no")String no);
}
......@@ -30,6 +30,9 @@ public interface EkpAlertTableService extends IService<EkpAlertTable> {
void pushBudgetAlertInfoTomanager(int type);
//void tesxWxExcelApi();
void test();
//void tesxWxExcelApi();
}
......@@ -255,6 +255,8 @@ public class EkpAlertTableServiceImpl extends ServiceImpl<EkpAlertTableMapper, E
}
}
/**
* @param config 预警配置
* @return 是否超额
......@@ -331,4 +333,28 @@ public class EkpAlertTableServiceImpl extends ServiceImpl<EkpAlertTableMapper, E
//debugService.debugInsertIssue(wxConfig);
}
@Override
public void test() {
// 把这些字符串加入到list
/*String moths = "SBZC202508,SBZC202507,SBZC202506,SBZC202505,SBZC202504,SBZC202503,SBZC202502,SBZC202501," +
"SBZC202401,SBZC202402,SBZC202403,SBZC202404,SBZC202405,SBZC202406,SBZC202407,SBZC202408,SBZC202409,SBZC202410,SBZC202411,SBZC202412," +
"SBZC202301,SBZC202302,SBZC202303,SBZC202304,SBZC202305,SBZC202306,SBZC202307,SBZC202308,SBZC202309,SBZC202310,SBZC202311,SBZC202312," +
"SBZC202201,SBZC202202,SBZC202203,SBZC202204,SBZC202205,SBZC202206,SBZC202207,SBZC202208,SBZC202209,SBZC202210,SBZC202211,SBZC202212,";
List<String> nos = Arrays.asList(moths.split(","));
if (Common.isNotKong(nos)){
List<String> list;
for (String no : nos){
list = baseMapper.getNos(no);
if (Common.isNotKong(list)){
for (String str :list){
baseMapper.insertTest(str);
}
}
}
}
log.info("批量插入成功");*/
}
}
......@@ -152,4 +152,55 @@
</if>
</where>
</select>
<select id="insertTest" resultMap="ekpAlertTableMap">
SET @row_number = 0;
INSERT INTO ekp_social_settle_detail (fd_id,fd_customer_name,fd_payment_unit,fd_project_no,fd_project_name,fd_person_count,fd_unit_persion,fd_unit_medical
,fd_unit_unemployment,fd_unit_injury,fd_unit_birth,fd_unit_accrual,fd_unit_bigailment,fd_unit_sum,fd_personal_persion
,fd_personal_medical,fd_personal_unemployment,fd_personal_accrual,fd_personal_bigailment,fd_personal_sum,fd_sum
,fd_remark,fd_sort,fd_order_no)
SELECT
UUID() fd_id,
fd_3adfe8c81a0e42 'fd_customer_name' ,
fd_3b1480c04814fc_text 'fd_payment_unit' ,
fd_3adfe8c70d3fd4 'fd_project_no' ,
fd_3adfe8c8468e54 'fd_project_name' ,
sum(1) 'fd_person_count' ,
CAST(COALESCE (sum(fd_3af9f2d8df88c0), 0) AS DECIMAL (12, 2)) 'fd_unit_persion' ,
CAST(COALESCE (sum(fd_3af9f2db1e5e16), 0) AS DECIMAL (12, 2)) 'fd_unit_medical' ,
CAST(COALESCE (sum(fd_3af9f2dd5d8fb8), 0) AS DECIMAL (12, 2)) 'fd_unit_unemployment' ,
CAST(COALESCE (sum(fd_3af9f2e03295dc), 0) AS DECIMAL (12, 2)) 'fd_unit_injury' ,
CAST(COALESCE (sum(fd_3af9f2e237f794), 0) AS DECIMAL (12, 2)) 'fd_unit_birth' ,
CAST(COALESCE (sum(fd_3af9f2e45a5d78), 0) AS DECIMAL (12, 2)) 'fd_unit_accrual' ,
CAST(COALESCE (sum(fd_3af9f2e6dfb3f4), 0) AS DECIMAL (12, 2)) 'fd_unit_bigailment' ,
CAST(COALESCE (sum(fd_3af9f2e9208e4e), 0) AS DECIMAL (12, 2)) 'fd_unit_sum' ,
CAST(COALESCE (sum(fd_3af9f2ec516c30), 0) AS DECIMAL (12, 2)) 'fd_personal_persion' ,
CAST(COALESCE (sum(fd_3af9f2f8290f24), 0) AS DECIMAL (12, 2)) 'fd_personal_medical' ,
CAST(COALESCE (sum(fd_3af9f2fa79ee72), 0) AS DECIMAL (12, 2)) 'fd_personal_unemployment' ,
CAST(COALESCE (sum(fd_3af9f2fcde9158), 0) AS DECIMAL (12, 2)) 'fd_personal_accrual' ,
CAST(COALESCE (sum(fd_3af9f2ff2c9f42), 0) AS DECIMAL (12, 2)) 'fd_personal_bigailment' ,
CAST(COALESCE (sum(fd_3af9f303037214), 0) AS DECIMAL (12, 2)) 'fd_personal_sum' ,
CAST(COALESCE (sum(fd_3af9f3059e5b9c), 0) AS DECIMAL (12, 2)) 'fd_sum' ,
'' as 'fd_remark',
(@row_number := @row_number + 1) as 'fd_sort',
fd_3adfeb83a704c8 as 'fd_order_no'
FROM
ekp_social_info
LEFT JOIN ekp_24a8e6a7fc143bb8c48a project ON fd_3adfe8c70d3fd4 = fd_3a37fe508071fe
WHERE
fd_3adfeb83a704c8 = #{str}
GROUP BY
fd_3adfe8c81a0e42,
fd_3adfe8c8468e54,
fd_3adfe8c70d3fd4,
fd_3b1480c04814fc_text
</select>
<select id="getNos" resultType="java.lang.String">
select a.fd_3adfeb83a704c8 from ekp_social_info a where a.fd_3adfeb83a704c8 like concat(#{no}, '%') and a.fd_3adfeb83a704c8 is not NULL GROUP BY a.fd_3adfeb83a704c8
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment