临时用电

pull/4/head
chenxinying 2024-02-22 11:35:14 +08:00
parent c5c765bee3
commit cbad06c6dc
19 changed files with 2135 additions and 4 deletions

View File

@ -0,0 +1,282 @@
package com.zcloud.controller.eightwork;
import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.logs.LogAnno;
import com.zcloud.service.eightwork.ElectricityGasService;
import com.zcloud.service.eightwork.ElectricityService;
import com.zcloud.util.Tools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* www.zcloudchina.com
*/
@Controller
@RequestMapping("/app/electricity")
public class AppElertricityController extends BaseController {
@Autowired
private ElectricityService electricityService;
@Autowired
private ElectricityGasService electricityGasService;
/**
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/add")
@ResponseBody
@LogAnno(menuType = "手机", menuServer = "受限作业", instructionsOperate = "受限作业", instructionsType = "新增")
public Object add() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
electricityService.save(pd);
map.put("result", errInfo);
return map;
}
/**
*
* @param
* @throws Exception
*/
@RequestMapping(value = "/edit")
@ResponseBody
@LogAnno(menuType = "手机", menuServer = "受限作业", instructionsOperate = "受限作业", instructionsType = "新增")
public Object edit() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
electricityService.edit(pd);
map.put("result", errInfo);
return map;
}
/**
*
* @throws Exception
*/
@RequestMapping(value = "/delete")
@ResponseBody
@LogAnno(menuType = "手机", menuServer = "受限作业", instructionsOperate = "受限作业", instructionsType = "删除")
public Object delete() throws Exception {
Map<String, String> map = new HashMap<String, String>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
electricityService.delete(pd);
map.put("result", errInfo); //返回结果
return map;
}
/**
* @param page
* @throws Exception
*/
@RequestMapping(value="/list")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "受限作业",instructionsOperate = "受限作业",instructionsType = "列表")
public Object list(Page page) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
page.setPd(pd);
List<PageData> varList = electricityService.list(page); //列出electricity列表
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
return map;
}
@RequestMapping("/findById")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "受限作业",instructionsOperate = "受限作业",instructionsType = "获取详情")
public Object findById() throws Exception {
Map<String,Object> map = new HashMap<>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd = electricityService.findById(pd);
map.put("result",errInfo);
map.put("pd",pd);
return map;
}
@RequestMapping("/listSignFinished")
@ResponseBody
public Object listSignFinished() throws Exception {
Map<String,Object> map = new HashMap<>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
PageData signs = electricityService.listSignFinished(pd);
map.put("result",errInfo);
map.put("signs",signs);
return map;
}
@RequestMapping("/nextStep")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "受限作业",instructionsOperate = "受限作业",instructionsType = "通过")
public Object nextStep(MultipartRequest request) throws Exception {
Map<String,Object> map = new HashMap<>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String SIGNTIME[] = pd.getString("SIGNTIME").split(",");
for (int i = 0; i < SIGNTIME.length; i++) {
fileList.add(request.getFile("file" + i));
}
electricityService.nextStep(pd, fileList.toArray(new MultipartFile[fileList.size()]));
map.put("result",errInfo);
return map;
}
@RequestMapping("/checkWorkCount")
@ResponseBody
public Object checkWorkCount() throws Exception{
Map<String,Object> map = new HashMap<>();
String errorInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
map.put("count",electricityService.checkWorkCount(pd));
map.put("result",errorInfo);
return map;
}
@RequestMapping("/listAllMeasures")
@ResponseBody
public Object listAllMeasures() throws Exception {
Map<String,Object> map = new HashMap<>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> measuresList = electricityService.listAllMeasures();
map.put("result",errInfo);
map.put("measuresList",measuresList);
return map;
}
@RequestMapping("/listAllMeasuresForSign")
@ResponseBody
public Object listAllMeasuresForSign() throws Exception {
Map<String,Object> map = new HashMap<>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> measuresForSignList = electricityService.listAllMeasuresForSign(pd);
map.put("result",errInfo);
map.put("measuresForSignList",measuresForSignList);
return map;
}
@RequestMapping("/listSignFinishMeasures")
@ResponseBody
public Object listSignFinishMeasures() throws Exception {
Map<String,Object> map = new HashMap<>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> finishMeasuresList = electricityService.listSignFinishMeasures(pd);
map.put("result",errInfo);
map.put("finishMeasuresList",finishMeasuresList);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/gas/save")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "受限作业",instructionsOperate = "受限作业",instructionsType = "保存气体检测")
public Object gasSave(MultipartRequest request) throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String SIGNTIME[] = pd.getString("SIGNTIME").split(",");
for (int i = 0; i < SIGNTIME.length; i++) {
fileList.add(request.getFile("file" + i));
}
electricityService.saveGas(pd,fileList.toArray(new MultipartFile[fileList.size()]));
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/gas/list")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "受限作业",instructionsOperate = "受限作业",instructionsType = "去修改页面获取数据")
public Object gasList() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> varList = electricityGasService.listAll(pd); //列出electricity列表
map.put("varList", varList);
map.put("result", errInfo);
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/gas/delete")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "受限作业",instructionsOperate = "受限作业",instructionsType = "去修改页面获取数据")
public Object gasDel() throws Exception{
Map<String,String> map = new HashMap<String,String>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
electricityGasService.delete(pd);
map.put("result", errInfo); //返回结果
return map;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/getFlowList")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "受限作业",instructionsOperate = "受限作业",instructionsType = "获取受限作业流程")
public Object getFlowList() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> flowList = electricityService.getFlowList(pd);
map.put("flowList", flowList);
map.put("result", errInfo); //返回结果
return map;
}
}

View File

@ -0,0 +1,59 @@
package com.zcloud.mapper.datasource.eightwork;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-09-08
* www.zcloudchina.com
*/
public interface ElectricityGasMapper {
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
/**
* @param pd
* @throws Exception
*/
void delete(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
*/
PageData findById(PageData pd);
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
void deleteAll(String[] ArrayDATA_IDS);
}

View File

@ -0,0 +1,34 @@
package com.zcloud.mapper.datasource.eightwork;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-09-08
* www.zcloudchina.com
*/
public interface ElectricityMapper {
PageData getCode(PageData pd);
PageData findById(PageData pd);
void save(PageData pd);
void delete(PageData pd);
void edit(PageData pd);
void editGasTime(PageData pd);
void editStep(PageData pd);
void setPosition(PageData pd);
List<PageData> datalistPage(Page page);
List<PageData> listAllMeasures();
List<PageData> checkWorkCount(PageData pd);
List<PageData> getFlowList(PageData pd);
List<PageData> getMapList(PageData pd);
}

View File

@ -0,0 +1,37 @@
package com.zcloud.mapper.datasource.eightwork;
import com.zcloud.entity.PageData;
import java.util.List;
/**
* @author fangjiakai
* @date 2024/01/17 11:31
*/
public interface ElectricitySignMapper {
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
void saveBatch(List<PageData> signers);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**ID
* @throws Exception
*/
List<PageData> listById(PageData pd);
List<PageData> listAll(PageData sign);
/**ID
* @throws Exception
*/
List<PageData> checkUnsigned(PageData sign);
}

View File

@ -0,0 +1,57 @@
package com.zcloud.mapper.datasource.eightwork;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-09-18
* www.zcloudchina.com
*/
public interface ElectricityToMeasuresMapper {
/**
* @param pd
* @throws Exception
*/
void save(PageData pd);
void saveBatch(List<PageData> signers);
/**
* @param pd
* @throws Exception
*/
void delete(PageData pd);
/**
* @param pd
* @throws Exception
*/
void edit(PageData pd);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
void deleteAll(String[] ArrayDATA_IDS);
List<PageData> listAllMeasuresForSign(PageData pd);
List<PageData> listSignFinishMeasures(PageData pd);
}

View File

@ -0,0 +1,59 @@
package com.zcloud.service.eightwork;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import java.util.List;
/**
*
* luoxiaobao
* 2021-09-08
* www.zcloudchina.com
*/
public interface ElectricityGasService {
/**
* @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 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 PageData findById(PageData pd)throws Exception;
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
}

View File

@ -0,0 +1,45 @@
package com.zcloud.service.eightwork;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.util.ReturnMap;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* @author fangjiakai
* @date 2024/01/17 11:29
*/
public interface ElectricityService {
void save(PageData pd)throws Exception;
void edit(PageData pd)throws Exception;
void delete(PageData pd)throws Exception;
List<PageData> list(Page page) throws Exception;
void nextStep(PageData pd, MultipartFile[] files) throws Exception;
PageData findById(PageData pd) throws Exception;
PageData listSignFinished(PageData pd) throws Exception;
PageData checkWorkCount(PageData pd);
//获取所有措施(bus_Electricity_measures)
List<PageData> listAllMeasures() throws Exception;
//
// //获取需要签字的措施(bus_Electricitytomeasures)
List<PageData> listAllMeasuresForSign(PageData pd) throws Exception;
//
// //获取所有签字完成的措施(bus_Electricitytomeasures)
List<PageData> listSignFinishMeasures(PageData pd) throws Exception;
void saveGas(PageData pd,MultipartFile[] files) throws Exception;
List<PageData> getFlowList(PageData pd)throws Exception;
ReturnMap getMapList()throws Exception;
}

View File

@ -233,6 +233,7 @@ public class ConfinedspaceServiceImpl implements ConfinedspaceService {
@Transactional @Transactional
public void saveGas(PageData pd, MultipartFile[] files) throws Exception { public void saveGas(PageData pd, MultipartFile[] files) throws Exception {
PageData work = confinedspaceMapper.findById(pd); PageData work = confinedspaceMapper.findById(pd);
work.putAll(pd);
List<String> filePaths = new ArrayList<>(); List<String> filePaths = new ArrayList<>();
for (int i = 0; i < files.length; i++) { for (int i = 0; i < files.length; i++) {
//保存签名文件 //保存签名文件

View File

@ -0,0 +1,83 @@
package com.zcloud.service.eightwork.impl;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.eightwork.ElectricityGasMapper;
import com.zcloud.service.eightwork.ElectricityGasService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
*
* luoxiaobao
* 2021-09-08
* www.zcloudchina.com
*/
@Service
@Transactional //开启事物
public class ElectricityGasServiceImpl implements ElectricityGasService {
@Autowired
private ElectricityGasMapper electricitygasMapper;
/**
* @param pd
* @throws Exception
*/
public void save(PageData pd)throws Exception{
electricitygasMapper.save(pd);
}
/**
* @param pd
* @throws Exception
*/
public void delete(PageData pd)throws Exception{
electricitygasMapper.delete(pd);
}
/**
* @param pd
* @throws Exception
*/
public void edit(PageData pd)throws Exception{
electricitygasMapper.edit(pd);
}
/**
* @param page
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return electricitygasMapper.datalistPage(page);
}
/**()
* @param pd
* @throws Exception
*/
public List<PageData> listAll(PageData pd)throws Exception{
return electricitygasMapper.listAll(pd);
}
/**id
* @param pd
* @throws Exception
*/
public PageData findById(PageData pd)throws Exception{
return electricitygasMapper.findById(pd);
}
/**
* @param ArrayDATA_IDS
* @throws Exception
*/
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
electricitygasMapper.deleteAll(ArrayDATA_IDS);
}
}

View File

@ -0,0 +1,428 @@
package com.zcloud.service.eightwork.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.mapper.datasource.eightwork.*;
import com.zcloud.service.eightwork.ElectricityService;
import com.zcloud.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author fangjiakai
* @date 2024/01/17 11:30
*/
@Service
@Transactional //开启事物
public class ElectricityServiceImpl implements ElectricityService {
@Autowired
private ElectricityMapper electricityMapper;
@Autowired
private EightWorkTaskFlowMapper eightWorkTaskFlowMapper;
@Autowired
private EightWorkFlowLogMapper eightWorkFlowLogMapper;
@Autowired
private ElectricitySignMapper electricitySignMapper;
@Autowired
private ElectricityToMeasuresMapper electricityToMeasuresMapper;
@Autowired
private ElectricityGasMapper electricitygasMapper;
@Autowired
private com.zcloud.mapper.datasource.eightWork.EightWorkVideoManagerMapper eightworkvideomanagerMapper;
@Autowired
private Smb smb;
private final String primary_key = "ELECTRICITY_ID";
private final String work_type = "ELECTRICITY";
@Override
@Transactional
public void save(PageData pd) throws Exception {
PageData pd2 = new PageData();
Calendar calendar = Calendar.getInstance();
DecimalFormat dft=new DecimalFormat("00");
int year = calendar.get(Calendar.YEAR);
String month = dft.format(calendar.get(Calendar.MONTH) + 1);
String day = dft.format(calendar.get(Calendar.DAY_OF_MONTH));
pd2.put("CREATDATE",year + "-" + month + "-" + day);
pd2.put("CORPINFO_ID",pd.get("CORPINFO_ID"));
pd2 = electricityMapper.getCode(pd2); //根据ID读取
String code = "LS" + year + month + day + dft.format((Integer.parseInt(pd2.get("code").toString()) + 1));
pd.put("CHECK_NO", code);
pd.put(primary_key, UuidUtil.get32UUID()); //主键
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
electricityMapper.save(pd);
if (pd.get("APPLY_STATUS").equals("1")) {
// PageData flow = getStep(pd.get("TASK_ID"),"1");
saveLog(pd,pd.getString("CREATOR"),"1");
PageData flow = getCurrentFlow(pd);
pd.put("STEP_ID", flow.get("STEP_ID"));
electricityMapper.editStep(pd);
saveNextSigner(pd,flow);
setPosition(pd);
}
}
@Override
@Transactional
public void edit(PageData pd) throws Exception {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
electricityMapper.edit(pd);
if (pd.get("APPLY_STATUS").equals("1")) {
pd.put("STEP_ID", 1);
electricityMapper.editStep(pd);
PageData flow = getStep(pd.get("TASK_ID"),"1");
saveLog(pd,pd.getString("CREATOR"),"1");
saveNextSigner(pd,flow);
setPosition(pd);
}
}
@Override
public void delete(PageData pd) throws Exception {
electricityMapper.delete(pd);
}
@Override
public List<PageData> list(Page page) throws Exception {
return electricityMapper.datalistPage(page);
}
/*
*
*/
@Override
@Transactional
public void nextStep(PageData pd, MultipartFile[] files) throws Exception {
PageData work = this.findById(pd);
work.putAll(pd);
List<String> filePaths = new ArrayList<>();
for (int i = 0; i < files.length; i++) {
//保存签名文件
String ffile = DateUtil.getDays();
String fileName = UuidUtil.get32UUID() + files[i].getOriginalFilename().substring(files[i].getOriginalFilename().lastIndexOf("."));
smb.sshSftp(files[i], fileName, Const.FILEPATHFILE + work.getString("CORPINFO_ID") + "/" + ffile);
filePaths.add(Const.FILEPATHFILE + work.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
}
PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID"));
work.put("STEP_ID", flow.get("NEXT_STEP_ID"));
//保存签名信息
PageData sign = new PageData();
if(work.getString("IMG_PATH") != ""){
sign.put("IMG_PATH", work.get("IMG_PATH"));
}
sign.put(primary_key, work.get(primary_key));
sign.put("STEP_ID", work.get("STEP_ID"));
sign.put("SIGN_USER_ID", work.get("USER_ID"));
sign.put("SIGN_TIME", work.getString("SIGNTIME"));
sign.put("SIGN_PATH", String.join(",",filePaths));
sign.put("DESCR", work.get("DESCR"));
electricitySignMapper.edit(sign);
if (work.get("MEASURES") != null && !work.get("MEASURES").equals("")) { //安全措施确认步骤
saveMeasures(work);
}
List<PageData> unsignedList = electricitySignMapper.checkUnsigned(sign);//当前步骤未签名人列表
if((unsignedList == null || unsignedList.size() == 0) && pd.getString("APPLY_STATUS").equals("1")){//如果没有未签人 则跳转下一步
electricityMapper.editStep(work);
PageData currentflow = getStep(work.get("TASK_ID"), work.get("STEP_ID"));
//保存日志
saveLog(work,work.getString("USER_ID"),"1");
if("99".equals(currentflow.getString("NEXT_STEP_ID"))){
eightworkvideomanagerMapper.editStatus(work);
return;
}
if (work.get("PREPARERS") != null && !work.get("PREPARERS").equals("")) { //如果是设置安全措施确认人步骤
savePreparers(work,currentflow);
}
saveNextSigner(work,currentflow);
}else if(pd.getString("APPLY_STATUS").equals("-1")){
//保存日志
saveLog(work,work.getString("USER_ID"),"-1");
eightworkvideomanagerMapper.editStatus(work);
work.put("STEP_ID",-1);
electricityMapper.editStep(work);
}
}
@Override
public PageData findById(PageData pd) throws Exception {
PageData pageData = electricityMapper.findById(pd);
return pageData;
}
@Override
public PageData listSignFinished(PageData pd) throws Exception {
Map<String,List<PageData>> rmap = new HashMap<>();
List<PageData> varList = electricitySignMapper.listAll(pd);
if (varList != null && !varList.isEmpty()) {
varList.stream().forEach(item -> {
PageData sign = new PageData();
sign.put("SIGN_PATH", item.getString("SIGN_PATH").split(","));
sign.put("SIGN_TIME", item.getString("SIGN_TIME").split(","));
if(item.getString("IMG_PATH") != null || "".equals(item.getString("IMG_PATH"))){
sign.put("IMG_PATH", item.getString("IMG_PATH").split(","));
}
sign.put("DESCR", item.getString("DESCR") != null ? item.getString("DESCR") : "无");
if(rmap.containsKey(item.getString("CODE"))){
rmap.get(item.getString("CODE")).add(sign);
}else{
List<PageData> signs = new ArrayList<>();
signs.add(sign);
rmap.put(item.getString("CODE"),signs);
}
});
}
PageData rpd = new PageData();
if (rmap != null && !rmap.isEmpty()) {
rpd.putAll(rmap);
}
return rpd;
}
@Override
public PageData checkWorkCount(PageData pd) {
PageData rpd = new PageData();
List<PageData> varList = electricityMapper.checkWorkCount(pd);
if (varList != null && !varList.isEmpty()) {
Map<String, String> newMap = varList.stream()
.collect(Collectors.toMap(map -> map.getString("CODE"), map -> map.getString("COUNT")));
rpd.putAll(newMap);
}
return rpd;
}
@Override
public List<PageData> listAllMeasures() throws Exception {
return electricityMapper.listAllMeasures();
}
@Override
public List<PageData> listAllMeasuresForSign(PageData pd) throws Exception {
return electricityToMeasuresMapper.listAllMeasuresForSign(pd);
}
@Override
public List<PageData> listSignFinishMeasures(PageData pd) throws Exception {
return electricityToMeasuresMapper.listSignFinishMeasures(pd);
}
@Override
@Transactional
public void saveGas(PageData pd, MultipartFile[] files) throws Exception {
PageData work = electricityMapper.findById(pd);
work.putAll(pd);
List<String> filePaths = new ArrayList<>();
for (int i = 0; i < files.length; i++) {
//保存签名文件
String ffile = DateUtil.getDays();
String fileName = UuidUtil.get32UUID() + files[i].getOriginalFilename().substring(files[i].getOriginalFilename().lastIndexOf("."));
smb.sshSftp(files[i], fileName, Const.FILEPATHFILE + work.getString("CORPINFO_ID") + "/" + ffile);
filePaths.add(Const.FILEPATHFILE + work.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
}
pd.put("ELECTRICITYGAS_ID", UuidUtil.get32UUID()); //主键
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
pd.put("SIGN_PATH", String.join(",",filePaths));
electricitygasMapper.save(pd);
electricityMapper.editGasTime(pd);//修改最后一次气体检测时间
PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID"));
if (pd.get("APPLY_STATUS").equals("1")) { //如果通过
if(flow.get("NEXT_STEP_ID") != null && flow.getString("NEXT_STEP_ID").equals("2")) {//如果为气体检测步骤,则保存日志并跳转下一步
PageData sign = new PageData();
sign.put(primary_key, work.get(primary_key));
sign.put("STEP_ID", 2);
sign.put("SIGN_USER_ID", pd.get("USER_ID"));
sign.put("SIGN_TIME", DateUtil.date2Str(new Date()));
sign.put("SIGN_PATH", String.join(",", filePaths));
sign.put("DESCR", pd.get("DESCR"));
electricitySignMapper.edit(sign);
work.put("STEP_ID", flow.get("NEXT_STEP_ID"));
electricityMapper.editStep(work);
//保存日志
saveLog(work, work.getString("USER_ID"), "1");
//预存下一步
PageData currentflow = getStep(work.get("TASK_ID"), work.get("STEP_ID"));
saveNextSigner(work, currentflow);
}
}else if(pd.getString("APPLY_STATUS").equals("-1")){
PageData sign = new PageData();
sign.put(primary_key, work.get(primary_key));
sign.put("STEP_ID", 2);
sign.put("SIGN_USER_ID", pd.get("USER_ID"));
sign.put("SIGN_TIME", DateUtil.date2Str(new Date()));
sign.put("SIGN_PATH", String.join(",", filePaths));
sign.put("DESCR", pd.get("DESCR"));
electricitySignMapper.edit(sign);
//保存日志
eightworkvideomanagerMapper.editStatus(work);
work.put("STEP_ID", flow.get("NEXT_STEP_ID"));
saveLog(work,pd.getString("USER_ID"),"-2");
work.put("STEP_ID",-1);
electricityMapper.editStep(work);
}
}
@Override
public List<PageData> getFlowList(PageData pd) throws Exception {
pd=findById(pd);
return electricityMapper.getFlowList(pd);
}
@Override
public ReturnMap getMapList() throws Exception {
ReturnMap returnMap = new ReturnMap();
PageData pd = new PageData();
pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
returnMap.put("varList",electricityMapper.getMapList(pd));
return returnMap;
}
private void saveNextSigner(PageData pd,PageData flow) throws Exception {
pd.put("STEP_ID",flow.get("NEXT_STEP_ID"));
if(pd.get(flow.get("NEXT_ACTOR_FIELD")) == null || pd.get(flow.get("NEXT_ACTOR_FIELD")).equals("")){
return;
}
//提前保存下一步签字人
List<PageData> signers = new ArrayList<>();
PageData signer = new PageData();
signer.put("ELECTRICITY_SIGN_ID", UuidUtil.get32UUID()); // 主键
signer.put(primary_key, pd.get(primary_key));
signer.put("CORPINFO_ID", pd.get("CORPINFO_ID"));
signer.put("SIGN_USER_ID", pd.get(flow.get("NEXT_ACTOR_FIELD")));
signer.put("STEP_ID", flow.get("NEXT_STEP_ID"));
signers.add(signer);
electricitySignMapper.saveBatch(signers);
}
private void saveMeasures(PageData pd) {
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("MEASURES").toString());
for (JSONObject json : list) {
PageData measure = new PageData();
measure.put("ELECTRICITYTOMEASURES_ID",json.get("ELECTRICITYTOMEASURES_ID"));
measure.put("STATUS", json.get("STATUS"));
measure.put("ANSWER1", json.get("ANSWER1"));
measure.put("ANSWER2", json.get("ANSWER2"));
measure.put("ANSWER3", json.get("ANSWER3"));
measure.put("SIGN_PATH", json.get("SIGN_PATH"));
measure.put("SIGN_TIME", json.get("SIGN_TIME"));
measure.put("IMG_PATH", json.get("IMG_PATH"));
electricityToMeasuresMapper.edit(measure);
}
}
private void savePreparers(PageData pd,PageData flow) {
List<PageData> signers = new ArrayList<>();
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("PREPARERS").toString());
for (JSONObject json : list) {
PageData preparer = new PageData();
preparer.put("ELECTRICITYTOMEASURES_ID", UuidUtil.get32UUID()); // 主键
preparer.put("ELECTRICITY_ID", pd.get("ELECTRICITY_ID"));
preparer.put("BUS_ELECTRICITY_MEASURES_ID", json.get("BUS_ELECTRICITY_MEASURES_ID"));
preparer.put("CONFIRM_ID", json.get("USER_ID"));
signers.add(preparer);
}
if(signers.size() > 0){
electricityToMeasuresMapper.saveBatch(signers);
//获取所有需要签名人
List<String> fieldList = signers.stream()
.map(map -> map.getString("CONFIRM_ID"))
.collect(Collectors.toList());
Set<String > fieldSet = new HashSet<>(fieldList); //去重
List<String> uniqueList = new ArrayList<>(fieldSet);
List<PageData> nextSigners = new ArrayList<>();
uniqueList.forEach(item -> { // 保存下一步需要签名的人
PageData signer = new PageData();
signer.put("ELECTRICITY_SIGN_ID", UuidUtil.get32UUID()); // 主键
signer.put(primary_key, pd.get(primary_key));
signer.put("CORPINFO_ID", pd.get("CORPINFO_ID"));
signer.put("SIGN_USER_ID", item);
signer.put("STEP_ID", flow.get("NEXT_STEP_ID"));
nextSigners.add(signer);
});
electricitySignMapper.saveBatch(nextSigners);
}
}
private PageData getStep(Object TASK_ID, Object STEP_ID) throws Exception {
PageData flow = new PageData();
flow.put("TASK_ID", TASK_ID);
flow.put("STEP_ID", STEP_ID);
flow = eightWorkTaskFlowMapper.getStep(flow);
return flow;
}
private void saveLog(PageData pd,String act_user,String status) throws Exception {
PageData log = new PageData();
log.put("LOG_ID", UuidUtil.get32UUID());
log.put("WORK_ID", pd.get(primary_key));
log.put("TASK_ID", pd.get("TASK_ID"));
log.put("STEP_ID", pd.get("STEP_ID"));
log.put("CORPINFO_ID", pd.get("CORPINFO_ID"));
log.put("CHECK_NO", pd.get("CHECK_NO"));
log.put("ACT_USER", act_user);
log.put("ACT_TIME", DateUtil.date2Str(new Date()));
log.put("STATUS", status);
log.put("WORK_TYPE",work_type);
eightWorkFlowLogMapper.save(log);
}
private PageData getCurrentFlow(PageData pd) throws Exception {
PageData flow = new PageData();
flow.put("TASK_ID", pd.get("TASK_ID"));
flow.put("STEP_ID", pd.get("STEP_ID"));
flow = eightWorkTaskFlowMapper.getStep(flow);
if("1".equals(flow.getString("CAN_SKIP")) && (pd.get(flow.get("NEXT_ACTOR_FIELD")) == null || pd.get(flow.get("NEXT_ACTOR_FIELD")).equals(""))){
pd.put("STEP_ID", flow.get("NEXT_STEP_ID"));
return getCurrentFlow(pd);
}else{
return flow;
}
}
private void setPosition(PageData pd) throws Exception {
JSONObject body = PLSUtil.getRyRegionInfo(pd.getString("CORPINFO_ID"),Integer.parseInt(pd.getString("PLS_ID")));
List pointList = (List)((Map) body.get("data")).get("list");
List<String> positions = PLSUtil.getRandomPointInPolygon(pointList);
pd.put("WORK_POSITION", String.join(",",positions));
electricityMapper.setPosition(pd);
}
}

View File

@ -328,8 +328,9 @@ public class HighworkServiceImpl implements HighworkService {
eightWorkFlowLogMapper.save(log); eightWorkFlowLogMapper.save(log);
} }
private void setPosition(PageData pd) throws Exception { private void setPosition(PageData pd) throws Exception {
JSONObject body = PLSUtil.getRyRegionInfo(Jurisdiction.getCORPINFO_ID(),Integer.parseInt(pd.getString("PLS_ID"))); JSONObject body = PLSUtil.getRyRegionInfo(pd.getString("CORPINFO_ID"),Integer.parseInt(pd.getString("PLS_ID")));
List pointList = (List)((Map) body.get("data")).get("list"); List pointList = (List)((Map) body.get("data")).get("list");
List<String> positions = PLSUtil.getRandomPointInPolygon(pointList); List<String> positions = PLSUtil.getRandomPointInPolygon(pointList);
pd.put("WORK_POSITION", String.join(",",positions)); pd.put("WORK_POSITION", String.join(",",positions));

View File

@ -280,7 +280,7 @@
left join BUS_LIMITSPACE sp on sp.LIMITSPACE_ID=f.LIMITSPACE_ID left join BUS_LIMITSPACE sp on sp.LIMITSPACE_ID=f.LIMITSPACE_ID
left join oa_department as woro on f.WORK_DEPARTMENT_ID = woro.DEPARTMENT_ID left join oa_department as woro on f.WORK_USER_DEPARTMENT_ID = woro.DEPARTMENT_ID
left join sys_user as woru on f.WORK_USER_ID = woru.USER_ID left join sys_user as woru on f.WORK_USER_ID = woru.USER_ID
left join oa_department as appo on f.APPLY_DEPARTMENT_ID = appo.DEPARTMENT_ID left join oa_department as appo on f.APPLY_DEPARTMENT_ID = appo.DEPARTMENT_ID
@ -436,6 +436,7 @@
<if test="pd.GASCHECK != null and pd.GASCHECK != ''"><!-- 关键词检索 --> <if test="pd.GASCHECK != null and pd.GASCHECK != ''"><!-- 关键词检索 -->
and f.STEP_ID &gt; 0 and f.STEP_ID != 15 and f.ANALYZE_USER_ID = #{pd.GASCHECK} and f.STEP_ID &gt; 0 and f.STEP_ID != 15 and f.ANALYZE_USER_ID = #{pd.GASCHECK}
</if> </if>
order by f.STEP_ID,f.CREATTIME
</select> </select>
<select id="checkWorkCount" parameterType="pd" resultType="pd" > <select id="checkWorkCount" parameterType="pd" resultType="pd" >

View File

@ -50,7 +50,10 @@
where sign.SIGN_TIME is null and sign.SIGN_USER_ID = #{USER_ID} and work.STEP_ID != '-1') CONFINEDSPACE_COUNT, where sign.SIGN_TIME is null and sign.SIGN_USER_ID = #{USER_ID} and work.STEP_ID != '-1') CONFINEDSPACE_COUNT,
(select count(1) COUNT from bus_highwork_sign sign (select count(1) COUNT from bus_highwork_sign sign
left join bus_highwork work on work.HIGHWORK_ID = sign.HIGHWORK_ID left join bus_highwork work on work.HIGHWORK_ID = sign.HIGHWORK_ID
where sign.SIGN_TIME is null and sign.SIGN_USER_ID = #{USER_ID} and work.STEP_ID != '-1') HIGHWORK_COUNT where sign.SIGN_TIME is null and sign.SIGN_USER_ID = #{USER_ID} and work.STEP_ID != '-1') HIGHWORK_COUNT,
(select count(1) COUNT from bus_electricity_sign sign
left join bus_electricity work on work.ELECTRICITY_ID = sign.ELECTRICITY_ID
where sign.SIGN_TIME is null and sign.SIGN_USER_ID = #{USER_ID} and work.STEP_ID != '-1') ELECTRICITY_COUNT
</select> </select>
</mapper> </mapper>

View File

@ -0,0 +1,141 @@
<?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.eightwork.ElectricityGasMapper">
<!--表名 -->
<sql id="tableName">
BUS_ELECTRICITYGAS
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.ELECTRICITY_ID,
f.ANALYZE_TIME,
f.ANALYZE_PLACE,
f.ANALYZE_RESULT,
f.ANALYZE_USER,
f.ISDELETE,
f.ELECTRICITYGAS_ID,
f.SIGN_PATH
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
ELECTRICITY_ID,
ANALYZE_TIME,
ANALYZE_PLACE,
ANALYZE_RESULT,
ANALYZE_USER,
ISDELETE,
ELECTRICITYGAS_ID,
SIGN_PATH
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{ELECTRICITY_ID},
#{ANALYZE_TIME},
#{ANALYZE_PLACE},
#{ANALYZE_RESULT},
#{ANALYZE_USER},
#{ISDELETE},
#{ELECTRICITYGAS_ID},
#{SIGN_PATH}
</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">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
ELECTRICITYGAS_ID = #{ELECTRICITYGAS_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
ELECTRICITY_ID = #{ELECTRICITY_ID},
ANALYZE_TIME = #{ANALYZE_TIME},
ANALYZE_PLACE = #{ANALYZE_PLACE},
ANALYZE_RESULT = #{ANALYZE_RESULT},
ANALYZE_USER = #{ANALYZE_USER},
ELECTRICITYGAS_ID = ELECTRICITYGAS_ID,
SIGN_PATH = #{SIGN_PATH}
where
ELECTRICITYGAS_ID = #{ELECTRICITYGAS_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.ELECTRICITY_ID = #{ELECTRICITY_ID}
</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-->
<!-- (-->
<!-- &lt;!&ndash; 根据需求自己加检索条件-->
<!-- 字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')-->
<!-- or-->
<!-- 字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')-->
<!-- &ndash;&gt;-->
<!-- )-->
</if>
ORDER BY f.ANALYZE_TIME desc
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where f.ISDELETE = '0' and f.ELECTRICITY_ID = #{ELECTRICITY_ID}
ORDER BY f.ANALYZE_TIME desc
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
ELECTRICITYGAS_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,602 @@
<?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.eightwork.ElectricityMapper">
<!--表名 -->
<sql id="tableName">
BUS_ELECTRICITY
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.ELECTRICITY_ID,
f.CORPINFO_ID,
f.TASK_ID,
f.STEP_ID,
f.ISDELETE,
f.CREATTIME,
f.CREATOR,
f.OPERATTIME,
f.OPERATOR,
f.CHECK_NO,
f.APPLY_DEPARTMENT_ID,
f.APPLY_USER_ID,
f.WORK_START_DATE,
f.WORK_END_DATE,
f.WORK_PLACE,
f.WORK_CONTENT,
f.SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.CARD_NO,
f.ALLOW_POWER,
f.WORK_VOLTAGE,
f.RATED_POWER,
f.ELECTRICITY_USER_ID,
f.ELECTRICITY_DEPARTMENT_ID,
f.WORK_USER_ID,
f.WORK_DEPARTMENT_ID,
f.ANALYZE_TIME,
f.ISANALYZE,
f.ANALYZE_DEPARTMENT_ID,
f.ANALYZE_USER_ID,
f.CONFESS_DEPARTMENT_ID,
f.CONFESS_USER_ID,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.GUARDIAN_DEPARTMENT_ID,
f.GUARDIAN_USER_ID,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.LEADER_CARD_NO,
f.AUDIT_DEPARTMENT_ID,
f.AUDIT_USER_ID,
f.APPROVE_DEPARTMENT_ID,
f.APPROVE_USER_ID,
f.ACCEPT_DEPARTMENT_ID,
f.ACCEPT_USER_ID,
f.WORK_START_DEPARTMENT_ID,
f.WORK_START_USER_ID,
f.WORK_END_DEPARTMENT_ID,
f.WORK_END_USER_ID,
f.ACCEPT_TIME,
f.PLS_ID,
f.PLS_NAME,
f.WORK_POSITION,
f.VIDEO_PATH
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
ELECTRICITY_ID,
CORPINFO_ID,
TASK_ID,
STEP_ID,
ISDELETE,
CREATTIME,
CREATOR,
OPERATTIME,
OPERATOR,
CHECK_NO,
APPLY_DEPARTMENT_ID,
APPLY_USER_ID,
WORK_START_DATE,
WORK_END_DATE,
WORK_PLACE,
WORK_CONTENT,
SPECIAL_WORK,
RISK_IDENTIFICATION,
CARD_NO,
ALLOW_POWER,
WORK_VOLTAGE,
RATED_POWER,
ELECTRICITY_USER_ID,
ELECTRICITY_DEPARTMENT_ID,
WORK_USER_ID,
WORK_DEPARTMENT_ID,
ANALYZE_TIME,
ISANALYZE,
ANALYZE_DEPARTMENT_ID,
ANALYZE_USER_ID,
CONFESS_DEPARTMENT_ID,
CONFESS_USER_ID,
ACCEPT_CONFESS_DEPARTMENT_ID,
ACCEPT_CONFESS_USER_ID,
GUARDIAN_DEPARTMENT_ID,
GUARDIAN_USER_ID,
CONFIRM_DEPARTMENT_ID,
CONFIRM_USER_ID,
LEADER_CARD_NO,
AUDIT_DEPARTMENT_ID,
AUDIT_USER_ID,
APPROVE_DEPARTMENT_ID,
APPROVE_USER_ID,
ACCEPT_DEPARTMENT_ID,
ACCEPT_USER_ID,
WORK_START_DEPARTMENT_ID,
WORK_START_USER_ID,
WORK_END_DEPARTMENT_ID,
WORK_END_USER_ID,
ACCEPT_TIME,
PLS_ID,
PLS_NAME,
WORK_POSITION,
VIDEO_PATH
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{ELECTRICITY_ID},
#{CORPINFO_ID},
#{TASK_ID},
#{STEP_ID},
#{ISDELETE},
#{CREATTIME},
#{CREATOR},
#{OPERATTIME},
#{OPERATOR},
#{CHECK_NO},
#{APPLY_DEPARTMENT_ID},
#{APPLY_USER_ID},
#{WORK_START_DATE},
#{WORK_END_DATE},
#{WORK_PLACE},
#{WORK_CONTENT},
#{SPECIAL_WORK},
#{RISK_IDENTIFICATION},
#{CARD_NO},
#{ALLOW_POWER},
#{WORK_VOLTAGE},
#{RATED_POWER},
#{ELECTRICITY_USER_ID},
#{ELECTRICITY_DEPARTMENT_ID},
#{WORK_USER_ID},
#{WORK_DEPARTMENT_ID},
#{ANALYZE_TIME},
#{ISANALYZE},
#{ANALYZE_DEPARTMENT_ID},
#{ANALYZE_USER_ID},
#{CONFESS_DEPARTMENT_ID},
#{CONFESS_USER_ID},
#{ACCEPT_CONFESS_DEPARTMENT_ID},
#{ACCEPT_CONFESS_USER_ID},
#{GUARDIAN_DEPARTMENT_ID},
#{GUARDIAN_USER_ID},
#{CONFIRM_DEPARTMENT_ID},
#{CONFIRM_USER_ID},
#{LEADER_CARD_NO},
#{AUDIT_DEPARTMENT_ID},
#{AUDIT_USER_ID},
#{APPROVE_DEPARTMENT_ID},
#{APPROVE_USER_ID},
#{ACCEPT_DEPARTMENT_ID},
#{ACCEPT_USER_ID},
#{WORK_START_DEPARTMENT_ID},
#{WORK_START_USER_ID},
#{WORK_END_DEPARTMENT_ID},
#{WORK_END_USER_ID},
#{ACCEPT_TIME},
#{PLS_ID},
#{PLS_NAME},
#{WORK_POSITION},
#{VIDEO_PATH}
</sql>
<!-- 获取编码 -->
<select id="getCode" parameterType="pd" resultType="pd">
SELECT
COUNT(1) as code
FROM <include refid="tableName"></include> f
WHERE f.CORPINFO_ID = #{CORPINFO_ID}
and f.CREATTIME LIKE CONCAT(#{CREATDATE},'%')
</select>
<!-- 新增-->
<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">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
ELECTRICITY_ID = #{ELECTRICITY_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
ELECTRICITY_ID = #{ELECTRICITY_ID},
CORPINFO_ID = #{CORPINFO_ID},
TASK_ID = #{TASK_ID},
STEP_ID = #{STEP_ID},
ISDELETE = #{ISDELETE},
CREATTIME = #{CREATTIME},
CREATOR = #{CREATOR},
OPERATTIME = #{OPERATTIME},
OPERATOR = #{OPERATOR},
CHECK_NO = #{CHECK_NO},
APPLY_DEPARTMENT_ID = #{APPLY_DEPARTMENT_ID},
APPLY_USER_ID = #{APPLY_USER_ID},
WORK_START_DATE = #{WORK_START_DATE},
WORK_END_DATE = #{WORK_END_DATE},
WORK_PLACE = #{WORK_PLACE},
WORK_CONTENT = #{WORK_CONTENT},
SPECIAL_WORK = #{SPECIAL_WORK},
RISK_IDENTIFICATION = #{RISK_IDENTIFICATION},
CARD_NO = #{CARD_NO},
ALLOW_POWER = #{ALLOW_POWER},
WORK_VOLTAGE = #{WORK_VOLTAGE},
RATED_POWER = #{RATED_POWER},
ELECTRICITY_USER_ID = #{ELECTRICITY_USER_ID},
ELECTRICITY_DEPARTMENT_ID = #{ELECTRICITY_DEPARTMENT_ID},
WORK_USER_ID = #{WORK_USER_ID},
WORK_DEPARTMENT_ID = #{WORK_DEPARTMENT_ID},
ANALYZE_TIME = #{ANALYZE_TIME},
ISANALYZE = #{ISANALYZE},
ANALYZE_DEPARTMENT_ID = #{ANALYZE_DEPARTMENT_ID},
ANALYZE_USER_ID = #{ANALYZE_USER_ID},
CONFESS_DEPARTMENT_ID = #{CONFESS_DEPARTMENT_ID},
CONFESS_USER_ID = #{CONFESS_USER_ID},
ACCEPT_CONFESS_DEPARTMENT_ID = #{ACCEPT_CONFESS_DEPARTMENT_ID},
ACCEPT_CONFESS_USER_ID = #{ACCEPT_CONFESS_USER_ID},
GUARDIAN_DEPARTMENT_ID = #{GUARDIAN_DEPARTMENT_ID},
GUARDIAN_USER_ID = #{GUARDIAN_USER_ID},
CONFIRM_DEPARTMENT_ID = #{CONFIRM_DEPARTMENT_ID},
CONFIRM_USER_ID = #{CONFIRM_USER_ID},
LEADER_CARD_NO = #{LEADER_CARD_NO},
AUDIT_DEPARTMENT_ID = #{AUDIT_DEPARTMENT_ID},
AUDIT_USER_ID = #{AUDIT_USER_ID},
APPROVE_DEPARTMENT_ID = #{APPROVE_DEPARTMENT_ID},
APPROVE_USER_ID = #{APPROVE_USER_ID},
ACCEPT_DEPARTMENT_ID = #{ACCEPT_DEPARTMENT_ID},
ACCEPT_USER_ID = #{ACCEPT_USER_ID},
WORK_START_DEPARTMENT_ID = #{WORK_START_DEPARTMENT_ID},
WORK_START_USER_ID = #{WORK_START_USER_ID},
WORK_END_DEPARTMENT_ID = #{WORK_END_DEPARTMENT_ID},
WORK_END_USER_ID = #{WORK_END_USER_ID},
ACCEPT_TIME = #{ACCEPT_TIME},
PLS_ID = #{PLS_ID},
PLS_NAME = #{PLS_NAME},
WORK_POSITION = #{WORK_POSITION},
VIDEO_PATH = #{VIDEO_PATH}
where
ELECTRICITY_ID = #{ELECTRICITY_ID}
</update>
<update id="editGasTime" parameterType="pd">
update
<include refid="tableName"></include>
set
ANALYZE_TIME = #{ANALYZE_TIME}
where
ELECTRICITY_ID = #{ELECTRICITY_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>,
ad.NAME as APPLY_DEPARTMENT_NAME,
au.NAME as APPLY_USER_NAME,
cd.NAME as CONFIRM_DEPARTMENT_NAME,
cu.NAME as CONFIRM_USER_NAME,
aud.NAME as AUDIT_DEPARTMENT_NAME,
auu.NAME as AUDIT_USER_NAME,
apd.NAME as APPROVE_DEPARTMENT_NAME,
apu.NAME as APPROVE_USER_NAME,
acd.NAME as ACCEPT_DEPARTMENT_NAME,
acu.NAME as ACCEPT_USER_NAME,
anad.NAME as ANALYZE_DEPARTMENT_NAME,
anau.NAME as ANALYZE_USER_NAME,
ac.NAME as CONFESS_DEPARTMENT_NAME,
accu.NAME as CONFESS_USER_NAME,
aac.NAME as ACCEPT_CONFESS_DEPARTMENT_NAME,
aacu.NAME as ACCEPT_CONFESS_USER_NAME,
bc.NAME as GUARDIAN_DEPARTMENT_NAME,
bcu.NAME as GUARDIAN_USER_NAME,
woro.`NAME` as WORK_USER_DEPARTMENT_NAME,
woru.`NAME` as WORK_USER_NAME,
stao.`NAME` as WORK_START_DEPARTMENT_NAME,
stau.`NAME` as WORK_START_USER_NAME,
endo.`NAME` as WORK_END_DEPARTMENT_NAME,
endu.`NAME` as WORK_END_USER_NAME,
eleo.`NAME` as ELECTRICITY_DEPARTMENT_NAME,
eleu.`NAME` as ELECTRICITY_USER_NAME
from
<include refid="tableName"></include> f
left join OA_DEPARTMENT bc on bc.DEPARTMENT_ID = f.GUARDIAN_DEPARTMENT_ID
left join SYS_USER bcu on bcu.USER_ID = f.GUARDIAN_USER_ID
left join oa_department as woro on f.WORK_DEPARTMENT_ID = woro.DEPARTMENT_ID
left join sys_user as woru on f.WORK_USER_ID = woru.USER_ID
left join OA_DEPARTMENT aac on aac.DEPARTMENT_ID = f.ACCEPT_CONFESS_DEPARTMENT_ID
left join SYS_USER aacu on aacu.USER_ID = f.ACCEPT_CONFESS_USER_ID
left join OA_DEPARTMENT ac on ac.DEPARTMENT_ID = f.CONFESS_DEPARTMENT_ID
left join SYS_USER accu on accu.USER_ID = f.CONFESS_USER_ID
left join OA_DEPARTMENT ad on ad.DEPARTMENT_ID = f.APPLY_DEPARTMENT_ID
left join SYS_USER au on au.USER_ID = f.APPLY_USER_ID
left join OA_DEPARTMENT cd on cd.DEPARTMENT_ID = f.CONFIRM_DEPARTMENT_ID
left join SYS_USER cu on cu.USER_ID = f.CONFIRM_USER_ID
left join OA_DEPARTMENT aud on aud.DEPARTMENT_ID = f.AUDIT_DEPARTMENT_ID
left join SYS_USER auu on auu.USER_ID = f.AUDIT_USER_ID
left join OA_DEPARTMENT apd on apd.DEPARTMENT_ID = f.APPROVE_DEPARTMENT_ID
left join SYS_USER apu on apu.USER_ID = f.APPROVE_USER_ID
left join OA_DEPARTMENT acd on acd.DEPARTMENT_ID = f.ACCEPT_DEPARTMENT_ID
left join SYS_USER acu on acu.USER_ID = f.ACCEPT_USER_ID
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
left join oa_department as stao on f.WORK_START_DEPARTMENT_ID = stao.DEPARTMENT_ID
left join sys_user as stau on f.WORK_START_USER_ID = stau.USER_ID
left join oa_department as endo on f.WORK_END_DEPARTMENT_ID = endo.DEPARTMENT_ID
left join sys_user as endu on f.WORK_END_USER_ID = endu.USER_ID
left join oa_department as eleo on f.ELECTRICITY_DEPARTMENT_ID = eleo.DEPARTMENT_ID
left join sys_user as eleu on f.ELECTRICITY_USER_ID = eleu.USER_ID
where
f.ELECTRICITY_ID = #{ELECTRICITY_ID}
</select>
<!-- 修改 -->
<update id="editStep" parameterType="pd">
update
<include refid="tableName"></include>
set
<if test="WORK_START_DATE != null and WORK_START_DATE != ''"><!-- 关键词检索 -->
WORK_START_DATE = #{WORK_START_DATE},
</if>
<if test="WORK_END_DATE != null and WORK_END_DATE != ''"><!-- 关键词检索 -->
WORK_END_DATE = #{WORK_END_DATE},
</if>
<if test="ACCEPT_TIME != null and ACCEPT_TIME != ''"><!-- 关键词检索 -->
ACCEPT_TIME = #{ACCEPT_TIME},
</if>
STEP_ID = #{STEP_ID}
where
ELECTRICITY_ID = #{ELECTRICITY_ID}
</update>
<!-- 修改位置 -->
<update id="setPosition" parameterType="pd">
update
<include refid="tableName"></include>
set
WORK_POSITION = #{WORK_POSITION}
where
ELECTRICITY_ID = #{ELECTRICITY_ID}
</update>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
<include refid="Field"></include>,
ad.NAME as APPLY_DEPARTMENT_NAME,
au.NAME as APPLY_USER_NAME,
cd.NAME as CONFIRM_DEPARTMENT_NAME,
cu.NAME as CONFIRM_USER_NAME,
aud.NAME as AUDIT_DEPARTMENT_NAME,
auu.NAME as AUDIT_USER_NAME,
apd.NAME as APPROVE_DEPARTMENT_NAME,
apu.NAME as APPROVE_USER_NAME,
acd.NAME as ACCEPT_DEPARTMENT_NAME,
acu.NAME as ACCEPT_USER_NAME,
anad.NAME as ANALYZE_DEPARTMENT_NAME,
anau.NAME as ANALYZE_USER_NAME,
ac.NAME as CONFESS_DEPARTMENT_NAME,
accu.NAME as CONFESS_USER_NAME,
aac.NAME as ACCEPT_CONFESS_DEPARTMENT_NAME,
aacu.NAME as ACCEPT_CONFESS_USER_NAME,
bc.NAME as GUARDIAN_DEPARTMENT_NAME,
bcu.NAME as GUARDIAN_USER_NAME,
woro.`NAME` as WORK_USER_DEPARTMENT_NAME,
woru.`NAME` as WORK_USER_NAME,
stao.`NAME` as WORK_START_DEPARTMENT_NAME,
stau.`NAME` as WORK_START_USER_NAME,
endo.`NAME` as WORK_END_DEPARTMENT_NAME,
endu.`NAME` as WORK_END_USER_NAME,
eleo.`NAME` as ELECTRICITY_DEPARTMENT_NAME,
eleu.`NAME` as ELECTRICITY_USER_NAME,
log.STEP_NAME,
flow.NEXT_STEP_ID,
n.STEP_NAME as NEXT_STEP_NAME,
log.STATUS
from
<include refid="tableName"></include> f
left join OA_DEPARTMENT bc on bc.DEPARTMENT_ID = f.GUARDIAN_DEPARTMENT_ID
left join SYS_USER bcu on bcu.USER_ID = f.GUARDIAN_USER_ID
left join oa_department as woro on f.WORK_DEPARTMENT_ID = woro.DEPARTMENT_ID
left join sys_user as woru on f.WORK_USER_ID = woru.USER_ID
left join OA_DEPARTMENT aac on aac.DEPARTMENT_ID = f.ACCEPT_CONFESS_DEPARTMENT_ID
left join SYS_USER aacu on aacu.USER_ID = f.ACCEPT_CONFESS_USER_ID
left join OA_DEPARTMENT ac on ac.DEPARTMENT_ID = f.CONFESS_DEPARTMENT_ID
left join SYS_USER accu on accu.USER_ID = f.CONFESS_USER_ID
left join OA_DEPARTMENT ad on ad.DEPARTMENT_ID = f.APPLY_DEPARTMENT_ID
left join SYS_USER au on au.USER_ID = f.APPLY_USER_ID
left join OA_DEPARTMENT cd on cd.DEPARTMENT_ID = f.CONFIRM_DEPARTMENT_ID
left join SYS_USER cu on cu.USER_ID = f.CONFIRM_USER_ID
left join OA_DEPARTMENT aud on aud.DEPARTMENT_ID = f.AUDIT_DEPARTMENT_ID
left join SYS_USER auu on auu.USER_ID = f.AUDIT_USER_ID
left join OA_DEPARTMENT apd on apd.DEPARTMENT_ID = f.APPROVE_DEPARTMENT_ID
left join SYS_USER apu on apu.USER_ID = f.APPROVE_USER_ID
left join OA_DEPARTMENT acd on acd.DEPARTMENT_ID = f.ACCEPT_DEPARTMENT_ID
left join SYS_USER acu on acu.USER_ID = f.ACCEPT_USER_ID
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
left join oa_department as stao on f.WORK_START_DEPARTMENT_ID = stao.DEPARTMENT_ID
left join sys_user as stau on f.WORK_START_USER_ID = stau.USER_ID
left join oa_department as endo on f.WORK_END_DEPARTMENT_ID = endo.DEPARTMENT_ID
left join sys_user as endu on f.WORK_END_USER_ID = endu.USER_ID
left join oa_department as eleo on f.ELECTRICITY_DEPARTMENT_ID = eleo.DEPARTMENT_ID
left join sys_user as eleu on f.ELECTRICITY_USER_ID = eleu.USER_ID
left join (select * from(select * from vi_eightwork_flow_log log having 1 order by log.ACT_TIME desc
) tmp group by tmp.WORK_ID) log on log.WORK_ID = f.ELECTRICITY_ID
left join bus_eightwork_task_flow flow on flow.STEP_ID = f.STEP_ID and flow.TASK_ID = log.TASK_ID
left join bus_eightwork_step n on n.STEP_ID = flow.NEXT_STEP_ID
where f.ISDELETE = '0'
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and f.CHECK_NO LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
</if>
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索 -->
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="pd.STEP_NAME != null and pd.STEP_NAME != ''"><!-- 关键词检索 -->
and exists (
select 1 from bus_electricity_sign sign
left join bus_eightwork_step step on step.STEP_ID = sign.STEP_ID
where sign.ELECTRICITY_ID = f.ELECTRICITY_ID
and sign.SIGN_TIME is null
and sign.SIGN_USER_ID = #{pd.USER_ID}
and step.STEP_NAME = #{pd.STEP_NAME}
and f.STEP_ID != -1
)
</if>
<if test="pd.STEP_ID != null and pd.STEP_ID != ''"><!-- 关键词检索 -->
and log.NEXT_STEP_ID = #{pd.STEP_ID} and f.STEP_ID != -1
</if>
<if test="pd.CREATOR != null and pd.CREATOR != ''"><!-- 关键词检索 -->
and f.CREATOR = #{pd.CREATOR}
</if>
<if test="pd.GASCHECK != null and pd.GASCHECK != ''"><!-- 关键词检索 -->
and f.STEP_ID &gt; 0 and f.STEP_ID != 15 and f.ANALYZE_USER_ID = #{pd.GASCHECK}
</if>
order by f.STEP_ID,f.CREATTIME desc
</select>
<select id="checkWorkCount" parameterType="pd" resultType="pd" >
select
step.CODE,count(1) COUNT
from
bus_electricity_sign sign
left join bus_eightwork_step step on step.STEP_ID = sign.STEP_ID
left join bus_electricity work on work.ELECTRICITY_ID = sign.ELECTRICITY_ID
where
sign.SIGN_TIME is null
and work.STEP_ID != '-1'
and
sign.SIGN_USER_ID = #{USER_ID}
group by step.CODE
</select>
<select id="listAllMeasures" resultType="pd">
select
*
from
BUS_ELECTRICITY_MEASURES
</select>
<select id="getFlowList" resultType="pd">
select
flow.CAN_SKIP,
flow.ACTOR_FIELD,
step.STEP_NAME,
user.NAME as ACT_USER_NAME,
log.ACT_TIME,
log.STATUS,
cu.SIGN_USER,
cu.FINISHED_SIGN_USER,
cu.STEP_ID as CURRENT_STEP
from
bus_eightwork_task_flow flow
left join bus_eightwork_step step on step.STEP_ID = flow.STEP_ID
left join bus_eightwork_flow_log log on log.STEP_ID = flow.STEP_ID and
log.WORK_ID = #{ELECTRICITY_ID}
left join sys_user user on user.USER_ID = log.ACT_USER
left join (select sign.STEP_ID,
GROUP_CONCAT( if(sign.SIGN_TIME IS NULL,signer.NAME,null) ) sign_user,
GROUP_CONCAT( if(sign.SIGN_TIME IS not NULL,signer.NAME,null) ) finished_sign_user
from bus_electricity_sign sign
left join sys_user signer on signer.USER_ID = sign.SIGN_USER_ID where sign.ELECTRICITY_ID = #{ELECTRICITY_ID}
GROUP BY sign.STEP_ID) cu on cu.STEP_ID = step.STEP_ID
where
flow.TASK_ID = #{TASK_ID}
and
flow.STEP_ID != 0
order by
flow.ORDER_BY
</select>
<select id="getMapList" resultType="pd">
select
f.ELECTRICITY_ID,
f.CHECK_NO,
f.WORK_POSITION
from
<include refid="tableName"></include> f
left join (select * from(select * from vi_eightwork_flow_log log having 1 order by log.ACT_TIME desc
) tmp group by tmp.WORK_ID) log on log.WORK_ID = f.ELECTRICITY_ID
where f.ISDELETE = '0' and f.WORK_POSITION is not null
and f.CORPINFO_ID = #{CORPINFO_ID}
and f.STEP_ID &gt; 0 and log.NEXT_STEP_ID != 99
</select>
</mapper>

View File

@ -0,0 +1,140 @@
<?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.eightwork.ElectricitySignMapper">
<!--表名 -->
<sql id="tableName">
BUS_ELECTRICITY_SIGN
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.ELECTRICITY_SIGN_ID,
f.ELECTRICITY_ID,
f.CORPINFO_ID,
f.SIGN_USER_ID,
f.SIGN_PATH,
f.SIGN_TIME,
f.DESCR,
f.STEP_ID,
f.IMG_PATH
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
ELECTRICITY_SIGN_ID,
ELECTRICITY_ID,
CORPINFO_ID,
SIGN_USER_ID,
SIGN_PATH,
SIGN_TIME,
DESCR,
STEP_ID,
IMG_PATH
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{ELECTRICITY_SIGN_ID},
#{ELECTRICITY_ID},
#{CORPINFO_ID},
#{SIGN_USER_ID},
#{SIGN_PATH},
#{SIGN_TIME},
#{DESCR},
#{STEP_ID},
#{IMG_PATH}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<insert id="saveBatch" parameterType="pd">
insert into
<include refid="tableName"></include>
(
ELECTRICITY_SIGN_ID,
ELECTRICITY_ID,
CORPINFO_ID,
SIGN_USER_ID,
STEP_ID
) values
<foreach collection="list" item="item" index="index" separator="," >
(#{item.ELECTRICITY_SIGN_ID},
#{item.ELECTRICITY_ID},
#{item.CORPINFO_ID},
#{item.SIGN_USER_ID},
#{item.STEP_ID})
</foreach>
</insert>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
DESCR = #{DESCR},
SIGN_PATH = #{SIGN_PATH},
SIGN_TIME= #{SIGN_TIME},
IMG_PATH = #{IMG_PATH}
where
ELECTRICITY_ID = #{ELECTRICITY_ID} and SIGN_USER_ID = #{SIGN_USER_ID} and STEP_ID = #{STEP_ID}
</update>
<select id="listById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.ELECTRICITY_ID = #{pd.ELECTRICITY_ID}
order by f.SIGN_TIME desc
</select>
<select id="listAll" parameterType="pd" resultType="pd">
select
f.ELECTRICITY_SIGN_ID,
f.ELECTRICITY_ID,
f.CORPINFO_ID,
f.SIGN_USER_ID,
f.SIGN_PATH,
f.SIGN_TIME,
f.STEP_ID,
f.IMG_PATH,
IFNULL(f.DESCR,'无') as DESCR,
step.CODE
from
<include refid="tableName"></include> f
left join bus_eightwork_step step on step.STEP_ID = f.STEP_ID
where
f.ELECTRICITY_ID = #{ELECTRICITY_ID}
and
f.SIGN_TIME is not null
</select>
<select id="checkUnsigned" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.ELECTRICITY_ID = #{ELECTRICITY_ID}
and
f.SIGN_TIME is null
</select>
</mapper>

View File

@ -0,0 +1,156 @@
<?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.eightwork.ElectricityToMeasuresMapper">
<!--表名 -->
<sql id="tableName">
BUS_ELECTRICITYTOMEASURES
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.ELECTRICITY_ID,
f.BUS_ELECTRICITY_MEASURES_ID,
f.STATUS,
f.ELECTRICITYTOMEASURES_ID,
f.CONFIRM_ID,
f.SIGN_PATH,
f.SIGN_TIME,
f.IMG_PATH
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
ELECTRICITY_ID,
BUS_ELECTRICITY_MEASURES_ID,
STATUS,
ELECTRICITYTOMEASURES_ID,
CONFIRM_ID,
SIGN_PATH,
SIGN_TIME,
IMG_PATH
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{ELECTRICITY_ID},
#{BUS_ELECTRICITY_MEASURES_ID},
#{STATUS},
#{ELECTRICITYTOMEASURES_ID},
#{CONFIRM_ID},
#{SIGN_PATH},
#{SIGN_TIME},
#{IMG_PATH}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<insert id="saveBatch" parameterType="pd">
insert into
<include refid="tableName"></include>
(
ELECTRICITY_ID,
BUS_ELECTRICITY_MEASURES_ID,
ELECTRICITYTOMEASURES_ID,
CONFIRM_ID
) values
<foreach collection="list" item="item" index="index" separator="," >
(
#{item.ELECTRICITY_ID},
#{item.BUS_ELECTRICITY_MEASURES_ID},
#{item.ELECTRICITYTOMEASURES_ID},
#{item.CONFIRM_ID}
)
</foreach>
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
delete from
<include refid="tableName"></include>
where
ELECTRICITY_ID = #{ELECTRICITY_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
STATUS = #{STATUS},
SIGN_PATH = #{SIGN_PATH},
IMG_PATH = #{IMG_PATH},
SIGN_TIME = #{SIGN_TIME}
where
ELECTRICITYTOMEASURES_ID = #{ELECTRICITYTOMEASURES_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.ELECTRICITYTOMEASURES_ID = #{ELECTRICITYTOMEASURES_ID}
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
ELECTRICITYTOMEASURES_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<select id="listAllMeasuresForSign" parameterType="pd" resultType="pd">
select
f.ELECTRICITYTOMEASURES_ID,
m.*
from
<include refid="tableName"></include> f
left join bus_electricity_measures m on f.BUS_ELECTRICITY_MEASURES_ID = m.BUS_ELECTRICITY_MEASURES_ID
where
f.ELECTRICITY_ID = #{ELECTRICITY_ID} and f.CONFIRM_ID = #{CONFIRM_ID}
</select>
<select id="listSignFinishMeasures" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>,
m.*
from
<include refid="tableName"></include> f
left join bus_electricity_measures m on f.BUS_ELECTRICITY_MEASURES_ID = m.BUS_ELECTRICITY_MEASURES_ID
where
f.ELECTRICITY_ID = #{ELECTRICITY_ID}
</select>
</mapper>

View File

@ -418,6 +418,7 @@
<if test="pd.CREATOR != null and pd.CREATOR != ''"><!-- 关键词检索 --> <if test="pd.CREATOR != null and pd.CREATOR != ''"><!-- 关键词检索 -->
and f.CREATOR = #{pd.CREATOR} and f.CREATOR = #{pd.CREATOR}
</if> </if>
order by f.STEP_ID,f.CREATTIME
</select> </select>

View File

@ -493,6 +493,7 @@
<if test="pd.GASCHECK != null and pd.GASCHECK != ''"><!-- 关键词检索 --> <if test="pd.GASCHECK != null and pd.GASCHECK != ''"><!-- 关键词检索 -->
and f.STEP_ID &gt; 0 and f.STEP_ID != 15 and f.ANALYZE_USER_ID = #{pd.GASCHECK} and f.STEP_ID &gt; 0 and f.STEP_ID != 15 and f.ANALYZE_USER_ID = #{pd.GASCHECK}
</if> </if>
order by f.STEP_ID,f.CREATTIME desc
</select> </select>
@ -500,7 +501,7 @@
select select
concat("姓名:",f.NAME,'',"编号:",f.CERTIFICATE_NUM) NAME concat("姓名:",f.NAME,'',"编号:",f.CERTIFICATE_NUM) NAME
from from
BUS_PERSONNELMANAGEMENT f bus_specialoperations f
left join sys_dictionaries a on a.DICTIONARIES_ID = f.JOB_TYPE left join sys_dictionaries a on a.DICTIONARIES_ID = f.JOB_TYPE
left join bus_corp_info b on b.CORPINFO_ID = f.CORPINFO_ID left join bus_corp_info b on b.CORPINFO_ID = f.CORPINFO_ID
left join bus_units r on r.UNITS_ID = f.UNITS_ID left join bus_units r on r.UNITS_ID = f.UNITS_ID