临时用电迁移

pull/3/head
zhaoyu 2023-12-13 10:58:39 +08:00
parent 515476f56a
commit dfa04334c3
12 changed files with 969 additions and 53 deletions

View File

@ -2,13 +2,11 @@ package com.zcloud.controller.gf;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.clinet.MqClient;
import com.zcloud.dto.Response;
import com.zcloud.dto.TenCorpConst;
import com.zcloud.dto.TenCorpDto;
import com.zcloud.controller.base.BaseController;
import com.zcloud.dto.mq.TenCorpDto;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mq.util.TenCorpConst;
import com.zcloud.service.gf.*;
import com.zcloud.util.*;
import org.apache.commons.lang.StringUtils;
@ -18,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartRequest;
import com.zcloud.mq.service.SendMessageService;
import javax.annotation.Resource;
import java.text.DecimalFormat;
@ -53,7 +52,7 @@ public class AppGFConfinedSpaceController extends BaseController {
private Smb smb;
@Resource
private MqClient mqClient;
private SendMessageService mqClient;
/**
* @param
* @throws Exception
@ -174,11 +173,7 @@ public class AppGFConfinedSpaceController extends BaseController {
tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000");
tenCorpDto.setData(pd);
tenCorpDto.setMark_name("CONFINEDSPACE_ID");
Response response = mqClient.sendDelayQueue(tenCorpDto);
if (!"succeed".equals(response.getResult()) || !"0".equals(response.getCode())){
throw new RuntimeException("系统异常");
}
System.out.println("amazing:!!!!!"+JSONObject.toJSONString(response));
mqClient.SendDelayQueue(tenCorpDto);
map.put("result", errInfo);
return map;
}
@ -391,11 +386,7 @@ public class AppGFConfinedSpaceController extends BaseController {
tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000");
tenCorpDto.setData(pd);
tenCorpDto.setMark_name("CONFINEDSPACE_ID");
Response response = mqClient.sendDelayQueue(tenCorpDto);
if (!"succeed".equals(response.getResult()) || !"0".equals(response.getCode())){
throw new RuntimeException("系统异常");
}
System.out.println("amazing:!!!!!"+JSONObject.toJSONString(response));
mqClient.SendDelayQueue(tenCorpDto);
map.put("result", errInfo);
return map;
}
@ -846,11 +837,7 @@ public class AppGFConfinedSpaceController extends BaseController {
tenCorpDto.setTime_stamp(pd.getString("WORK_START_DATE") + ":00:000");
tenCorpDto.setData(pd);
tenCorpDto.setMark_name("CONFINEDSPACE_ID");
Response response = mqClient.sendDelayQueue(tenCorpDto);
if (!"succeed".equals(response.getResult()) || !"0".equals(response.getCode())){
throw new RuntimeException("系统异常");
}
System.out.println("amazing:!!!!!"+JSONObject.toJSONString(response));
mqClient.SendDelayQueue(tenCorpDto);
}
break;

View File

@ -7,6 +7,7 @@ import com.zcloud.dto.mq.Response;
import com.zcloud.dto.mq.TenCorpDto;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mq.util.TenCorpConst;
import com.zcloud.service.gf.*;
import com.zcloud.util.*;
import org.apache.commons.lang.StringUtils;
@ -16,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartRequest;
import com.zcloud.mq.service.SendMessageService;
import javax.annotation.Resource;
import java.text.DecimalFormat;
@ -49,7 +51,7 @@ public class AppGFElectricityController extends BaseController {
private Smb smb;
@Resource
private MqClient mqClient;
private SendMessageService mqClient;
/**
* @param
@ -154,11 +156,7 @@ public class AppGFElectricityController extends BaseController {
tenCorpDto.setData(pd);
tenCorpDto.setMessage(TenCorpConst.electricity);
Response response = mqClient.sendDelayQueue(tenCorpDto);
if (!"succeed".equals(response.getResult()) || !"0".equals(response.getCode())){
throw new RuntimeException("系统异常");
}
System.out.println("amazing:!!!!!"+JSONObject.toJSONString(response));
mqClient.SendDelayQueue(tenCorpDto);
// 发短信
PageData mes1 = new PageData();
mes1.put("RECEIVER_ID", pd.get("ANALYZE_USER_ID"));// 收信人userid
@ -260,11 +258,7 @@ public class AppGFElectricityController extends BaseController {
tenCorpDto.setData(pd);
tenCorpDto.setMessage(TenCorpConst.electricity);
Response response = mqClient.sendDelayQueue(tenCorpDto);
if (!"succeed".equals(response.getResult()) || !"0".equals(response.getCode())){
throw new RuntimeException("系统异常");
}
System.out.println("amazing:!!!!!"+JSONObject.toJSONString(response));
mqClient.SendDelayQueue(tenCorpDto);
}
map.put("result", errInfo);
return map;
@ -636,11 +630,7 @@ public class AppGFElectricityController extends BaseController {
tenCorpDto.setData(pd);
tenCorpDto.setMessage(TenCorpConst.electricity);
Response response = mqClient.sendDelayQueue(tenCorpDto);
if (!"succeed".equals(response.getResult()) || !"0".equals(response.getCode())){
throw new RuntimeException("系统异常");
}
System.out.println("amazing:!!!!!"+JSONObject.toJSONString(response));
mqClient.SendDelayQueue(tenCorpDto);
}
}
@ -989,7 +979,7 @@ public class AppGFElectricityController extends BaseController {
}
/**
* @param out
* @paramout
* @throws Exception
*/
@PostMapping(value="/cancel")

View File

@ -3,6 +3,7 @@ package com.zcloud.controller.gf;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.service.gf.GFElectricityAcceptUserService;
import com.zcloud.service.gf.GFElectricityGasService;
import com.zcloud.service.gf.GFElectricityService;
import com.zcloud.util.Jurisdiction;
@ -34,6 +35,8 @@ public class GFElectricityController extends BaseController {
private GFElectricityService GFelectricityService;
@Autowired
private GFElectricityGasService GFelectricityGasService;
@Autowired
private GFElectricityAcceptUserService electricityacceptuserService;
/**
* @param
* @throws Exception
@ -53,7 +56,7 @@ public class GFElectricityController extends BaseController {
}
/**
* @param out
* @param
* @throws Exception
*/
@RequestMapping(value="/delete")
@ -131,6 +134,8 @@ public class GFElectricityController extends BaseController {
pd = GFelectricityService.findById(pd); //根据ID读取
map.put("pd", pd);
map.put("measuresList", GFelectricityService.listAllMeasures(pd));
map.put("imgList",electricityacceptuserService.findByIds(pd));
map.put("imgList1",electricityacceptuserService.findById(pd));
map.put("gasList", GFelectricityGasService.listAll(pd));
map.put("result", errInfo);
return map;

View File

@ -0,0 +1,67 @@
package com.zcloud.mapper.datasource.gf;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2020-12-24
* www.zcloudchina.com
*/
public interface GFElectricityAcceptUserMapper {
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void deleteList(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**
* @param page
* @throws Exception
*/
List<PageData> datalistPage(Page page);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**id
* @param pd
* @throws Exception
*/
List<PageData> findById(PageData pd);
List<PageData> findByIds(PageData pd);
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
void deleteAll(String[] ArrayDATA_IDS);
List<PageData> listAllByIds(PageData pd);
}

View File

@ -30,6 +30,7 @@ public interface GFElectricityMapper{
* @throws Exception
*/
void edit(PageData pd);
void edittime(PageData pd);
/**
* @param page
@ -52,6 +53,22 @@ public interface GFElectricityMapper{
*/
PageData findById(PageData pd);
void cancel(PageData pd);
PageData checkno(PageData pd);
void editSpecialwork(PageData pd);
void editSpecialwork1(PageData pd);
void editSpecialwork2(PageData pd);
void editSpecialwork3(PageData pd);
void editSpecialwork4(PageData pd);
void editSpecialwork5(PageData pd);
void editSpecialwork6(PageData pd);
void editSpecialwork7(PageData pd);
/**
* @param ArrayDATA_IDS
* @throws Exception

View File

@ -0,0 +1,67 @@
package com.zcloud.service.gf;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2020-12-24
* www.zcloudchina.com
*/
public interface GFElectricityAcceptUserService {
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void deleteList(PageData pd)throws Exception;
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception;
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception;
/**id
* @param pd
* @throws Exception
*/
public List<PageData> findById(PageData pd)throws Exception;
public List<PageData> findByIds(PageData pd)throws Exception;
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
public List<PageData> listAllByIds(PageData pd)throws Exception;
}

View File

@ -30,7 +30,7 @@ public interface GFElectricityService{
* @throws Exception
*/
public void edit(PageData pd)throws Exception;
public void edittime(PageData pd)throws Exception;
/**
* @param page
* @throws Exception
@ -52,6 +52,20 @@ public interface GFElectricityService{
*/
public PageData findById(PageData pd)throws Exception;
public void cancel(PageData pd)throws Exception;
public PageData checkno(PageData pd)throws Exception;
public void editSpecialwork(PageData pd)throws Exception;
public void editSpecialwork1(PageData pd)throws Exception;
public void editSpecialwork2(PageData pd)throws Exception;
public void editSpecialwork3(PageData pd)throws Exception;
public void editSpecialwork4(PageData pd)throws Exception;
public void editSpecialwork5(PageData pd)throws Exception;
public void editSpecialwork6(PageData pd)throws Exception;
public void editSpecialwork7(PageData pd)throws Exception;
/**
* @param ArrayDATA_IDS
* @throws Exception

View File

@ -0,0 +1,102 @@
package com.zcloud.service.gf.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.gf.GFElectricityAcceptUserMapper;
import com.zcloud.service.gf.GFElectricityAcceptUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2020-12-24
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class GFElectricityAcceptUserServiceImpl implements GFElectricityAcceptUserService {
@Autowired
private GFElectricityAcceptUserMapper electricityacceptuserMapper;
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception{
electricityacceptuserMapper.save(pd);
}
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception{
electricityacceptuserMapper.delete(pd);
}
/**
* @param pd
* @throws Exception
*/
public void deleteList(PageData pd)throws Exception{
electricityacceptuserMapper.deleteList(pd);
}
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception{
electricityacceptuserMapper.edit(pd);
}
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return electricityacceptuserMapper.datalistPage(page);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return electricityacceptuserMapper.listAll(pd);
}
/**id
* @param pd
* @throws Exception
*/
public List<PageData> findById(PageData pd)throws Exception{
return electricityacceptuserMapper.findById(pd);
}
public List<PageData> findByIds(PageData pd)throws Exception{
return electricityacceptuserMapper.findByIds(pd);
}
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
electricityacceptuserMapper.deleteAll(ArrayDATA_IDS);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAllByIds(PageData pd)throws Exception{
return electricityacceptuserMapper.listAllByIds(pd);
}
}

View File

@ -80,7 +80,42 @@ public class GFElectricityServiceImpl implements GFElectricityService {
public PageData findById(PageData pd)throws Exception{
return GFelectricityMapper.findById(pd);
}
public void cancel(PageData pd)throws Exception{
GFelectricityMapper.cancel(pd);
}
public PageData checkno(PageData pd)throws Exception{
return GFelectricityMapper.checkno(pd);
}
public void editSpecialwork(PageData pd)throws Exception{
GFelectricityMapper.editSpecialwork(pd);
}
public void editSpecialwork1(PageData pd)throws Exception{
GFelectricityMapper.editSpecialwork1(pd);
}
public void editSpecialwork2(PageData pd)throws Exception{
GFelectricityMapper.editSpecialwork2(pd);
}
public void editSpecialwork3(PageData pd)throws Exception{
GFelectricityMapper.editSpecialwork3(pd);
}
public void editSpecialwork4(PageData pd)throws Exception{
GFelectricityMapper.editSpecialwork4(pd);
}
public void editSpecialwork5(PageData pd)throws Exception{
GFelectricityMapper.editSpecialwork5(pd);
}
public void editSpecialwork6(PageData pd)throws Exception{
GFelectricityMapper.editSpecialwork6(pd);
}
public void editSpecialwork7(PageData pd)throws Exception{
GFelectricityMapper.editSpecialwork7(pd);
}
public void edittime(PageData pd)throws Exception{
GFelectricityMapper.edittime(pd);
}
/**
* @param ArrayDATA_IDS
* @throws Exception

View File

@ -0,0 +1,216 @@
<?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.zcloud.mapper.datasource.gf.GFElectricityAcceptUserMapper">
<!--表名 -->
<sql id="tableName">
GF_ELECTRICITY_ACCEPTUSER
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<sql id="Field">
f.ACCEPT_CONFESS_ID,
f.ELECTRICITY_ID,
f.CORPINFO_ID,
f.ISDELETE,
f.OPERATTIME,
f.OPERATOR,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.ACCEPT_CONFESS_USER_SIGNER_PATH,
f.ACCEPT_CONFESS_USER_SIGNER_TIME,
f.ISSELF,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
f.ACCEPT_DEPARTMENT_ID
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
ACCEPT_CONFESS_ID,
ELECTRICITY_ID,
CORPINFO_ID,
ISDELETE,
OPERATTIME,
OPERATOR,
ACCEPT_CONFESS_DEPARTMENT_ID,
ACCEPT_CONFESS_USER_ID,
ACCEPT_CONFESS_USER_SIGNER_PATH,
ACCEPT_CONFESS_USER_SIGNER_TIME,
ISSELF,
ACCEPT_USER_ID,
ACCEPT_USER_SIGNER_PATH,
ACCEPT_USER_SIGNER_TIME,
ACCEPT_DEPARTMENT_ID
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{ACCEPT_CONFESS_ID},
#{ELECTRICITY_ID},
#{CORPINFO_ID},
#{ISDELETE},
#{OPERATTIME},
#{OPERATOR},
#{ACCEPT_CONFESS_DEPARTMENT_ID},
#{ACCEPT_CONFESS_USER_ID},
#{ACCEPT_CONFESS_USER_SIGNER_PATH},
#{ACCEPT_CONFESS_USER_SIGNER_TIME},
#{ISSELF},
#{ACCEPT_USER_ID},
#{ACCEPT_USER_SIGNER_PATH},
#{ACCEPT_USER_SIGNER_TIME},
#{ACCEPT_DEPARTMENT_ID}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
delete from
<include refid="tableName"></include>
where
ACCEPT_CONFESS_ID = #{ACCEPT_CONFESS_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
ACCEPT_CONFESS_ID = #{ACCEPT_CONFESS_ID},
ELECTRICITY_ID = #{ELECTRICITY_ID},
CORPINFO_ID = #{CORPINFO_ID},
OPERATTIME = #{OPERATTIME},
OPERATOR = #{OPERATOR},
ACCEPT_CONFESS_DEPARTMENT_ID = #{ACCEPT_CONFESS_DEPARTMENT_ID},
ACCEPT_CONFESS_USER_ID = #{ACCEPT_CONFESS_USER_ID},
ACCEPT_CONFESS_USER_SIGNER_PATH = #{ACCEPT_CONFESS_USER_SIGNER_PATH},
ACCEPT_CONFESS_USER_SIGNER_TIME = #{ACCEPT_CONFESS_USER_SIGNER_TIME},
ISSELF = #{ISSELF}
where
ACCEPT_CONFESS_ID = #{ACCEPT_CONFESS_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
f.ACCEPT_CONFESS_ID,
f.ELECTRICITY_ID,
f.CORPINFO_ID,
f.ISDELETE,
f.OPERATTIME,
f.OPERATOR,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
f.ACCEPT_DEPARTMENT_ID
from
<include refid="tableName"></include> f
where
f.ELECTRICITY_ID = #{ELECTRICITY_ID} and f.CORPINFO_ID = #{CORPINFO_ID} and f.ACCEPT_USER_ID = #{ACCEPT_USER_ID}
order by f.ACCEPT_USER_SIGNER_TIME asc
</select>
<select id="findByIds" parameterType="pd" resultType="pd">
select
f.ACCEPT_CONFESS_ID,
f.ELECTRICITY_ID,
f.CORPINFO_ID,
f.ISDELETE,
f.OPERATTIME,
f.OPERATOR,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.ACCEPT_CONFESS_USER_SIGNER_PATH,
f.ACCEPT_CONFESS_USER_SIGNER_TIME
from
<include refid="tableName"></include> f
where
f.ELECTRICITY_ID = #{ELECTRICITY_ID} and f.CORPINFO_ID = #{CORPINFO_ID} and f.ACCEPT_CONFESS_USER_ID = #{ACCEPT_CONFESS_USER_ID}
order by f.ACCEPT_CONFESS_USER_SIGNER_TIME asc
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
<!-- 根据需求自己加检索条件
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
-->
)
</if>
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where 1=1
<if test="ISSELF != null and ISSELF != ''"><!-- 关键词检索 -->
and
f.ISSELF=#{ISSELF}
</if>
<if test="ELECTRICITY_ID != null and ELECTRICITY_ID != ''"><!-- 关键词检索 -->
and
f.ELECTRICITY_ID=#{ELECTRICITY_ID}
</if>
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
ACCEPT_CONFESS_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表 -->
<select id="listAllByIds" parameterType="String" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where 1=1
<if test="ArrayDATA_IDS != null and ArrayDATA_IDS != ''"><!-- 关键词检索 -->
and f.ACCEPT_CONFESS_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>

View File

@ -88,7 +88,7 @@
from
<include refid="tableName"></include> f
where
f.ELECTRICITYGAS_ID = #{ELECTRICITYGAS_ID}
f.ELECTRICITY_ID = #{ELECTRICITY_ID}
</select>
<!-- 列表 -->

View File

@ -78,6 +78,8 @@
f.ACCEPT_CONFESS_USER_ID,
f.ACCEPT_CONFESS_USER_SIGNER_PATH,
f.ACCEPT_CONFESS_USER_SIGNER_TIME,
f.ANALYZE_TIME,
f.ISANALYZE,
f.WORK_LONGITUDE,
f.WORK_LATITUDE
</sql>
@ -148,6 +150,8 @@
ACCEPT_CONFESS_USER_ID,
ACCEPT_CONFESS_USER_SIGNER_PATH,
ACCEPT_CONFESS_USER_SIGNER_TIME,
ANALYZE_TIME,
ISANALYZE,
WORK_LONGITUDE,
WORK_LATITUDE
</sql>
@ -218,6 +222,8 @@
#{ACCEPT_CONFESS_USER_ID},
#{ACCEPT_CONFESS_USER_SIGNER_PATH},
#{ACCEPT_CONFESS_USER_SIGNER_TIME},
#{ANALYZE_TIME},
#{ISANALYZE},
#{WORK_LONGITUDE},
#{WORK_LATITUDE}
</sql>
@ -242,7 +248,14 @@
where
ELECTRICITY_ID = #{ELECTRICITY_ID}
</delete>
<update id="edittime" parameterType="pd">
update
<include refid="tableName"></include>
set
ANALYZE_TIME = #{ANALYZE_TIME}
where
ELECTRICITY_ID = #{ELECTRICITY_ID}
</update>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
@ -312,8 +325,9 @@
ACCEPT_CONFESS_USER_SIGNER_PATH = #{ACCEPT_CONFESS_USER_SIGNER_PATH},
ACCEPT_CONFESS_USER_SIGNER_TIME = #{ACCEPT_CONFESS_USER_SIGNER_TIME},
ELECTRICITY_ID = ELECTRICITY_ID,
WORK_LONGITUDE = #{WORK_LONGITUDE},
WORK_LATITUDE = #{WORK_LATITUDE}
ISANALYZE = #{ISANALYZE},
WORK_LONGITUDE = #{WORK_LONGITUDE},
WORK_LATITUDE = #{WORK_LATITUDE}
where
ELECTRICITY_ID = #{ELECTRICITY_ID}
</update>
@ -329,8 +343,8 @@
f.OPERATOR,
f.CHECK_NO,
f.WORK_CONTENT,
f.WORK_START_DATE,
f.WORK_END_DATE,
replace(f.WORK_START_DATE,'-','/') as WORK_START_DATE,
replace(f.WORK_END_DATE,'-','/') as WORK_END_DATE,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.CONFIRM_USER_SIGNER_PATH,
@ -362,7 +376,7 @@
f.WORK_USER,
f.CARD_NO,
f.GUARDIAN,
f.SPECIAL_WORK,
IFNULL(f.SPECIAL_WORK,'无') as SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.CONFESS_USER,
f.ACCEPT_CONFESS_USER,
@ -385,6 +399,11 @@
f.ACCEPT_CONFESS_USER_ID,
f.ACCEPT_CONFESS_USER_SIGNER_PATH,
f.ACCEPT_CONFESS_USER_SIGNER_TIME,
(SELECT a.ANALYZE_TIME from GF_ELECTRICITYGAS a where a.ISDELETE = '0'
AND a.ELECTRICITY_ID = #{ELECTRICITY_ID}
ORDER BY
a.ANALYZE_TIME DESC LIMIT 1) as ANALYZE_TIME,
f.ISANALYZE,
f.WORK_LATITUDE,
f.WORK_LONGITUDE,
@ -446,10 +465,183 @@
f.ELECTRICITY_ID = #{ELECTRICITY_ID}
</select>
<update id="cancel" parameterType="pd">
update
<include refid="tableName"></include>
set
APPLY_STATUS = '-99'
where
ELECTRICITY_ID = #{ELECTRICITY_ID}
</update>
<select id="checkno" parameterType="pd" resultType="pd">
SELECT
CONCAT_WS( " ", "临时用电作业", f.CHECK_NO ) AS CHECK_NO
FROM
GF_electricity f
WHERE
f.ELECTRICITY_ID = #{ELECTRICITY_ID}
AND f.ISDELETE = '0'
</select>
<update id="editSpecialwork" parameterType = "pd">
update
GF_confinedspace f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork1" parameterType = "pd">
update
GF_blindboard f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork2" parameterType = "pd">
update
GF_electricity f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork3" parameterType = "pd">
update
GF_hoisting f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork4" parameterType = "pd">
update
GF_breakground f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork5" parameterType = "pd">
update
GF_cutroad f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork6" parameterType = "pd">
update
GF_highwork f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<update id="editSpecialwork7" parameterType = "pd">
update
GF_hotwork f
set f.SPECIAL_WORK = REPLACE(f.SPECIAL_WORK,#{CHECK_NO},CONCAT(#{CHECK_NO},'(已作废)'))
WHERE
f.ISDELETE = '0'
AND f.APPLY_STATUS > 0
AND f.CORPINFO_ID = #{CORPINFO_ID}
and ( FIND_IN_SET( #{CHECK_NO}, f.SPECIAL_WORK ) )
</update>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
f.CORPINFO_ID,
f.ISDELETE,
f.CREATTIME,
f.CREATOR,
f.OPERATTIME,
f.OPERATOR,
f.CHECK_NO,
f.WORK_CONTENT,
f.WORK_START_DATE,
f.WORK_END_DATE,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.CONFIRM_USER_SIGNER_PATH,
f.CONFIRM_USER_SIGNER_TIME,
f.AUDIT_DEPARTMENT_ID,
f.AUDIT_USER_ID,
f.AUDIT_USER_SIGNER_PATH,
f.AUDIT_USER_SIGNER_TIME,
f.APPROVE_DEPARTMENT_ID,
f.APPROVE_USER_ID,
f.APPROVE_USER_SIGNER_PATH,
f.APPROVE_USER_SIGNER_TIME,
f.APPLY_STATUS,
IFNULL(f.CONFIRM_CONTENT,'无') as CONFIRM_CONTENT,
IFNULL(f.AUDIT_CONTENT,'无') as AUDIT_CONTENT,
IFNULL(f.APPROVE_CONTENT,'无') as APPROVE_CONTENT,
f.OTHER_PROTECTIVE_MEASURES,
f.ACCEPT_DEPARTMENT_ID,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
IFNULL(f.ACCEPT_CONTENT,'无') as ACCEPT_CONTENT,
f.APPLY_DEPARTMENT_ID,
f.APPLY_USER_ID,
f.WORK_PLACE,
f.ALLOW_POWER,
f.WORK_VOLTAGE,
f.RATED_POWER,
f.WORK_USER,
f.CARD_NO,
f.GUARDIAN,
IFNULL(f.SPECIAL_WORK,'无') as SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.CONFESS_USER,
f.ACCEPT_CONFESS_USER,
f.EDUCATE_USER,
f.ACCEPT_EDUCATE_USER,
f.ANALYZE_DEPARTMENT_ID,
f.ANALYZE_USER_ID,
f.ELECTRICITY_USER,
f.LEADER_CARD_NO,
f.ELECTRICITY_ID,
f.GUARDIAN_DEPARTMENT_ID,
f.GUARDIAN_USER_ID,
f.GUARDIAN_USER_SIGNER_PATH,
f.GUARDIAN_USER_SIGNER_TIME,
f.CONFESS_DEPARTMENT_ID,
f.CONFESS_USER_ID,
f.CONFESS_USER_SIGNER_PATH,
f.CONFESS_USER_SIGNER_TIME,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.WORK_LONGITUDE,
f.WORK_LATITUDE,
(SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from GF_ELECTRICITY_ACCEPTUSER a where a.ISDELETE = '0'
AND a.ELECTRICITY_ID = f.ELECTRICITY_ID
ORDER BY
a.ACCEPT_CONFESS_USER_SIGNER_TIME DESC LIMIT 1) as ACCEPT_CONFESS_USER_SIGNER_TIME,
IFNULL((SELECT a.ANALYZE_TIME from GF_ELECTRICITYGAS a where a.ISDELETE = '0'
AND a.ELECTRICITY_ID = f.ELECTRICITY_ID
ORDER BY
a.ANALYZE_TIME DESC LIMIT 1),'无') as ANALYZE_TIME,
f.ISANALYZE,
ad.NAME as APPLY_DEPARTMENT_NAME,
getFullName(ad.DEPARTMENT_ID) APPLY_DEPARTMENT_ALL,
au.NAME as APPLY_USER_NAME,
@ -602,7 +794,80 @@
</select>
<select id="aqdatalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
f.CORPINFO_ID,
f.ISDELETE,
f.CREATTIME,
f.CREATOR,
f.OPERATTIME,
f.OPERATOR,
f.CHECK_NO,
f.WORK_CONTENT,
f.WORK_START_DATE,
f.WORK_END_DATE,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.CONFIRM_USER_SIGNER_PATH,
f.CONFIRM_USER_SIGNER_TIME,
f.AUDIT_DEPARTMENT_ID,
f.AUDIT_USER_ID,
f.AUDIT_USER_SIGNER_PATH,
f.AUDIT_USER_SIGNER_TIME,
f.APPROVE_DEPARTMENT_ID,
f.APPROVE_USER_ID,
f.APPROVE_USER_SIGNER_PATH,
f.APPROVE_USER_SIGNER_TIME,
f.APPLY_STATUS,
IFNULL(f.CONFIRM_CONTENT,'无') as CONFIRM_CONTENT,
IFNULL(f.AUDIT_CONTENT,'无') as AUDIT_CONTENT,
IFNULL(f.APPROVE_CONTENT,'无') as APPROVE_CONTENT,
f.OTHER_PROTECTIVE_MEASURES,
f.ACCEPT_DEPARTMENT_ID,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
IFNULL(f.ACCEPT_CONTENT,'无') as ACCEPT_CONTENT,
f.APPLY_DEPARTMENT_ID,
f.APPLY_USER_ID,
f.WORK_PLACE,
f.ALLOW_POWER,
f.WORK_VOLTAGE,
f.RATED_POWER,
f.WORK_USER,
f.CARD_NO,
f.GUARDIAN,
IFNULL(f.SPECIAL_WORK,'无') as SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.CONFESS_USER,
f.ACCEPT_CONFESS_USER,
f.EDUCATE_USER,
f.ACCEPT_EDUCATE_USER,
f.ANALYZE_DEPARTMENT_ID,
f.ANALYZE_USER_ID,
f.ELECTRICITY_USER,
f.LEADER_CARD_NO,
f.ELECTRICITY_ID,
f.GUARDIAN_DEPARTMENT_ID,
f.GUARDIAN_USER_ID,
f.GUARDIAN_USER_SIGNER_PATH,
f.GUARDIAN_USER_SIGNER_TIME,
f.CONFESS_DEPARTMENT_ID,
f.CONFESS_USER_ID,
f.CONFESS_USER_SIGNER_PATH,
f.CONFESS_USER_SIGNER_TIME,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.WORK_LONGITUDE,
f.WORK_LATITUDE,
(SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from GF_ELECTRICITY_ACCEPTUSER a where a.ISDELETE = '0'
AND a.ELECTRICITY_ID = f.ELECTRICITY_ID
ORDER BY
a.ACCEPT_CONFESS_USER_SIGNER_TIME DESC LIMIT 1) as ACCEPT_CONFESS_USER_SIGNER_TIME,
(SELECT a.ANALYZE_TIME from GF_ELECTRICITYGAS a where a.ISDELETE = '0'
AND a.ELECTRICITY_ID = f.ELECTRICITY_ID
ORDER BY
a.ANALYZE_TIME DESC LIMIT 1) as ANALYZE_TIME,
f.ISANALYZE,
ad.NAME as APPLY_DEPARTMENT_NAME,
getFullName(ad.DEPARTMENT_ID) APPLY_DEPARTMENT_ALL,
au.NAME as APPLY_USER_NAME,
@ -753,7 +1018,80 @@
</select>
<select id="jhdatalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
f.CORPINFO_ID,
f.ISDELETE,
f.CREATTIME,
f.CREATOR,
f.OPERATTIME,
f.OPERATOR,
f.CHECK_NO,
f.WORK_CONTENT,
f.WORK_START_DATE,
f.WORK_END_DATE,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.CONFIRM_USER_SIGNER_PATH,
f.CONFIRM_USER_SIGNER_TIME,
f.AUDIT_DEPARTMENT_ID,
f.AUDIT_USER_ID,
f.AUDIT_USER_SIGNER_PATH,
f.AUDIT_USER_SIGNER_TIME,
f.APPROVE_DEPARTMENT_ID,
f.APPROVE_USER_ID,
f.APPROVE_USER_SIGNER_PATH,
f.APPROVE_USER_SIGNER_TIME,
f.APPLY_STATUS,
IFNULL(f.CONFIRM_CONTENT,'无') as CONFIRM_CONTENT,
IFNULL(f.AUDIT_CONTENT,'无') as AUDIT_CONTENT,
IFNULL(f.APPROVE_CONTENT,'无') as APPROVE_CONTENT,
f.OTHER_PROTECTIVE_MEASURES,
f.ACCEPT_DEPARTMENT_ID,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
IFNULL(f.ACCEPT_CONTENT,'无') as ACCEPT_CONTENT,
f.APPLY_DEPARTMENT_ID,
f.APPLY_USER_ID,
f.WORK_PLACE,
f.ALLOW_POWER,
f.WORK_VOLTAGE,
f.RATED_POWER,
f.WORK_USER,
f.CARD_NO,
f.GUARDIAN,
IFNULL(f.SPECIAL_WORK,'无') as SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.CONFESS_USER,
f.ACCEPT_CONFESS_USER,
f.EDUCATE_USER,
f.ACCEPT_EDUCATE_USER,
f.ANALYZE_DEPARTMENT_ID,
f.ANALYZE_USER_ID,
f.ELECTRICITY_USER,
f.LEADER_CARD_NO,
f.ELECTRICITY_ID,
f.GUARDIAN_DEPARTMENT_ID,
f.GUARDIAN_USER_ID,
f.GUARDIAN_USER_SIGNER_PATH,
f.GUARDIAN_USER_SIGNER_TIME,
f.CONFESS_DEPARTMENT_ID,
f.CONFESS_USER_ID,
f.CONFESS_USER_SIGNER_PATH,
f.CONFESS_USER_SIGNER_TIME,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.WORK_LONGITUDE,
f.WORK_LATITUDE,
(SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from GF_ELECTRICITY_ACCEPTUSER a where a.ISDELETE = '0'
AND a.ELECTRICITY_ID = f.ELECTRICITY_ID
ORDER BY
a.ACCEPT_CONFESS_USER_SIGNER_TIME DESC LIMIT 1) as ACCEPT_CONFESS_USER_SIGNER_TIME,
(SELECT a.ANALYZE_TIME from GF_ELECTRICITYGAS a where a.ISDELETE = '0'
AND a.ELECTRICITY_ID = f.ELECTRICITY_ID
ORDER BY
a.ANALYZE_TIME DESC LIMIT 1) as ANALYZE_TIME,
f.ISANALYZE,
ad.NAME as APPLY_DEPARTMENT_NAME,
getFullName(ad.DEPARTMENT_ID) APPLY_DEPARTMENT_ALL,
au.NAME as APPLY_USER_NAME,
@ -904,7 +1242,80 @@
</select>
<select id="jsdatalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
f.CORPINFO_ID,
f.ISDELETE,
f.CREATTIME,
f.CREATOR,
f.OPERATTIME,
f.OPERATOR,
f.CHECK_NO,
f.WORK_CONTENT,
f.WORK_START_DATE,
f.WORK_END_DATE,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.CONFIRM_USER_SIGNER_PATH,
f.CONFIRM_USER_SIGNER_TIME,
f.AUDIT_DEPARTMENT_ID,
f.AUDIT_USER_ID,
f.AUDIT_USER_SIGNER_PATH,
f.AUDIT_USER_SIGNER_TIME,
f.APPROVE_DEPARTMENT_ID,
f.APPROVE_USER_ID,
f.APPROVE_USER_SIGNER_PATH,
f.APPROVE_USER_SIGNER_TIME,
f.APPLY_STATUS,
IFNULL(f.CONFIRM_CONTENT,'无') as CONFIRM_CONTENT,
IFNULL(f.AUDIT_CONTENT,'无') as AUDIT_CONTENT,
IFNULL(f.APPROVE_CONTENT,'无') as APPROVE_CONTENT,
f.OTHER_PROTECTIVE_MEASURES,
f.ACCEPT_DEPARTMENT_ID,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
IFNULL(f.ACCEPT_CONTENT,'无') as ACCEPT_CONTENT,
f.APPLY_DEPARTMENT_ID,
f.APPLY_USER_ID,
f.WORK_PLACE,
f.ALLOW_POWER,
f.WORK_VOLTAGE,
f.RATED_POWER,
f.WORK_USER,
f.CARD_NO,
f.GUARDIAN,
IFNULL(f.SPECIAL_WORK,'无') as SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.CONFESS_USER,
f.ACCEPT_CONFESS_USER,
f.EDUCATE_USER,
f.ACCEPT_EDUCATE_USER,
f.ANALYZE_DEPARTMENT_ID,
f.ANALYZE_USER_ID,
f.ELECTRICITY_USER,
f.LEADER_CARD_NO,
f.ELECTRICITY_ID,
f.GUARDIAN_DEPARTMENT_ID,
f.GUARDIAN_USER_ID,
f.GUARDIAN_USER_SIGNER_PATH,
f.GUARDIAN_USER_SIGNER_TIME,
f.CONFESS_DEPARTMENT_ID,
f.CONFESS_USER_ID,
f.CONFESS_USER_SIGNER_PATH,
f.CONFESS_USER_SIGNER_TIME,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.WORK_LONGITUDE,
f.WORK_LATITUDE,
(SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from GF_ELECTRICITY_ACCEPTUSER a where a.ISDELETE = '0'
AND a.ELECTRICITY_ID = f.ELECTRICITY_ID
ORDER BY
a.ACCEPT_CONFESS_USER_SIGNER_TIME DESC LIMIT 1) as ACCEPT_CONFESS_USER_SIGNER_TIME,
(SELECT a.ANALYZE_TIME from GF_ELECTRICITYGAS a where a.ISDELETE = '0'
AND a.ELECTRICITY_ID = f.ELECTRICITY_ID
ORDER BY
a.ANALYZE_TIME DESC LIMIT 1) as ANALYZE_TIME,
f.ISANALYZE,
ad.NAME as APPLY_DEPARTMENT_NAME,
getFullName(ad.DEPARTMENT_ID) APPLY_DEPARTMENT_ALL,
au.NAME as APPLY_USER_NAME,
@ -961,7 +1372,10 @@
left join OA_DEPARTMENT anad on anad.DEPARTMENT_ID = f.ANALYZE_DEPARTMENT_ID
left join SYS_USER anau on anau.USER_ID = f.ANALYZE_USER_ID
where f.ISDELETE = '0'
and f.APPLY_STATUS &lt; 5 and f.ACCEPT_CONFESS_USER_SIGNER_TIME is null and f.APPLY_STATUS &gt; 0
and f.APPLY_STATUS &lt; 5
and not exists(select 1 from GF_ELECTRICITY_ACCEPTUSER m where m.ELECTRICITY_ID = f.ELECTRICITY_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID)
and f.APPLY_STATUS &gt; 0
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''">
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
@ -1102,10 +1516,12 @@
COUNT(CASE WHEN f.APPLY_STATUS = '2' AND f.AUDIT_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) COUNTAUDIT,
COUNT(CASE WHEN f.APPLY_STATUS = '3' AND f.APPROVE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) COUNTAPPROVE,
COUNT(CASE WHEN f.APPLY_STATUS = '4' AND f.ACCEPT_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) COUNTACCEPT,
COUNT(CASE WHEN f.APPLY_STATUS = '4' AND f.ANALYZE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) COUNTANALYZE,
COUNT(CASE WHEN f.APPLY_STATUS = '1' AND f.ANALYZE_USER_ID = #{USER_ID} THEN f.ELECTRICITY_ID END) COUNTANALYZE,
COUNT(CASE WHEN f.APPLY_STATUS &lt; '5' AND f.APPLY_STATUS &gt; 0 AND f.GUARDIAN_USER_ID = #{USER_ID} and f.GUARDIAN_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) COUNTGUARDIAN,
COUNT(CASE WHEN f.APPLY_STATUS &lt; '5' AND f.APPLY_STATUS &gt; 0 AND f.CONFESS_USER_ID = #{USER_ID} and f.CONFESS_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) COUNTCONFESS,
COUNT(CASE WHEN f.APPLY_STATUS &lt; '5' AND f.APPLY_STATUS &gt; 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and f.ACCEPT_CONFESS_USER_SIGNER_TIME is null THEN f.ELECTRICITY_ID END) COUNTACCEPTCONFESS
COUNT(CASE WHEN f.APPLY_STATUS &lt; '5' AND f.APPLY_STATUS &gt; 0 AND f.ACCEPT_CONFESS_USER_ID = #{USER_ID} and
not exists(select 1 from GF_ELECTRICITY_ACCEPTUSER m where m.ELECTRICITY_ID = f.ELECTRICITY_ID and m.CORPINFO_ID = f.CORPINFO_ID and f.ACCEPT_CONFESS_USER_ID = m.ACCEPT_CONFESS_USER_ID)
THEN f.ELECTRICITY_ID END) COUNTACCEPTCONFESS
FROM <include refid="tableName"></include> f
WHERE f.ISDELETE = '0' AND f.CORPINFO_ID = #{CORPINFO_ID}