Merge remote-tracking branch 'origin/master'

master
杨万里 2 years ago
commit 1aec767ea7

@ -460,6 +460,9 @@ public class AbnormalBillController {
try{
abnormalBill.setHandle(HandleEnum.ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo()));
abnormalBill.setItemBo(null);
//保存操作日志
StringUtil.saveOperLog("BPM质量系统方案确认回调接口单号" + abnormalBill.getAbnormalNo(),"bpmPlanConfirm",
abnormalBill.toString() + abnormalBillDispose.toString(),null,null);
abnormalBillService.programConfirm(abnormalBill,abnormalBillDispose);
return new ResultVo(ResultCode.SUCCESS,"BPM方案确认回传成功");
}catch(Exception e){
@ -484,6 +487,9 @@ public class AbnormalBillController {
com.foreverwin.modular.core.util.CommonMethods.setUser(abnormalBill.getResponseUser());
try{
AbnormalBill abnormalBillOld = abnormalBillService.getById(HandleEnum.ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo()));
//保存操作日志
StringUtil.saveOperLog("BPM质量系统响应处理回调接口单号" + abnormalBill.getAbnormalNo(),"bpmResProcessing",
abnormalBill.toString(),null,null);
if ("N".equals(abnormalBillOld.getStatus())){
abnormalBillService.resProcessing(abnormalBillOld);
}else {
@ -512,6 +518,9 @@ public class AbnormalBillController {
}
try{
AbnormalBill abnormalBillOld = abnormalBillService.getById(HandleEnum.ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo()));
//保存操作日志
StringUtil.saveOperLog("BPM质量系统判责提交回调接口单号" + abnormalBill.getAbnormalNo(),"bpmDutyConfirm",
abnormalBill.toString() + abnormalBillDispose.toString(),null,null);
abnormalBillService.dutyConfirm(abnormalBillOld,abnormalBillDispose,ncCodesVO.getDutyCauseType(),ncCodesVO.getDutyType());
return new ResultVo(ResultCode.SUCCESS,"BPM判责提交成功");
}catch(Exception e){
@ -542,6 +551,9 @@ public class AbnormalBillController {
abnormalBills.get(0).setCancelSendUserGroup("BPM_CancelUserGroup");
abnormalBills.get(0).setCancelUser(abnormalBill.getCancelUser());
abnormalBills.get(0).setCancelDateTime(now);
//保存操作日志
StringUtil.saveOperLog("BPM质量系统异常取消回调接口单号" + abnormalBill.getAbnormalNo(),"bpmCancelBrowse",
abnormalBill.toString(),null,null);
abnormalBillService.saveOrUpdate(abnormalBills.get(0));
return new ResultVo(ResultCode.SUCCESS,"BPM异常取消成功");
}catch(Exception e){
@ -565,6 +577,9 @@ public class AbnormalBillController {
return new ResultVo(ResultCode.FAILED,"BPM异常修改:异常单号为空");
}
try{
//保存操作日志
StringUtil.saveOperLog("BPM质量系统异常修改回调接口单号" + abnormalBill.getAbnormalNo(),"bpmAbnormalModify",
abnormalBill.toString(),null,null);
LocalDateTime now = LocalDateTime.now();
AbnormalBill bill = new AbnormalBill();
bill.setAbnormalNo(abnormalBill.getAbnormalNo());
@ -613,6 +628,9 @@ public class AbnormalBillController {
}else if (StringUtils.isBlank(abnormalBill.getAbnormalNo())){
return new ResultVo(ResultCode.FAILED,"异常单号为空");
}
//保存操作日志
StringUtil.saveOperLog("BPM质量系统闭环关闭回调接口单号" + abnormalBill.getAbnormalNo(),"bpmCorrectivePreventive",
isClose + abnormalBill.toString() + abnormalBillDispose.toString(),null,null);
try{
AbnormalBill aBill = new AbnormalBill();
aBill.setAbnormalNo(abnormalBill.getAbnormalNo());

@ -303,39 +303,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
ncCodes.append(split[1]).append(",");
}
/**
* mesbpm
*/
if (!StringUtil.isBlank(abnormalBill.getBpmSubmit()) && abnormalBill.getBpmSubmit().equals("false")
&& !abnormalBill.getPbGrade().equals("C")) {
//产品类别
/*String productCategory = abnormalBill.getProductCategory();
DataField dataField = new DataField();
dataField.setDataField("REASON_CATEGORY");
List<DataField> productCategoryList = dataFieldListService.findDataFieldListById(dataField);
for (int i = 0; i < productCategoryList.size(); i++) {
String dataValue = JSONArray.toJSONString(productCategoryList.get(i));
HashMap<String,String> fieldMap = JSON.parseObject(dataValue, HashMap.class);
if (fieldMap.get("dataValue").equals(abnormalBill.getProductCategory())){
// abnormalBill.setProductCategory(fieldMap.get("description"));
}
}*/
List<String> NcCodeGroupList = (List)abnormalBill.getNcCodeDesc().stream().map((e) -> {
return e.split("/")[0];
}).collect(Collectors.toList());
abnormalBill.setPbUser(CommonMethods.getUser());
YunBpmApiRes bpmApiRes = yunBpmService.saveQualitySystem(abnormalBill, abnormalBillDispose,
String.join(";", NcCodeGroupList), String.join(";", abnormalBill.getNcCodeDesc()));
if (!bpmApiRes.getErrCode().equals(0)) {
throw new BaseException("MES提报给质量BPM系统失败");
}
String workflowInstanceId = JSON.parseObject(String.valueOf(bpmApiRes.getData())).getString("workflowInstanceId");
abnormalBill.setBpmFlowId(workflowInstanceId);
//abnormalBill.setProductCategory(productCategory);
//abnormalBill.setStatus(Constants.RESPONSE);
//abnormalBill.setResponseUser(CommonMethods.getUser());
//abnormalBill.setResponseDateTime(now);
}
ArrayList<AbnormalNcCode> abnormalNcCodes = new ArrayList<>();
@ -374,10 +341,28 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
selfReportService.updateState(abnormalBill.getObjectBo(), Constants.STATE_CONFIRM);
}
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
//保存操作日志
StringUtil.saveOperLog("质量异常提报MES数据单号" + abnormalBill.getAbnormalNo(),"anomalyReport",
abnormalBill.toString() + abnormalBillDispose.toString(),null,null);
/**
* mesbpm
*/
if (!StringUtil.isBlank(abnormalBill.getBpmSubmit()) && abnormalBill.getBpmSubmit().equals("false")
&& !abnormalBill.getPbGrade().equals("C")) {
List<String> NcCodeGroupList = (List)abnormalBill.getNcCodeDesc().stream().map((e) -> {
return e.split("/")[0];
}).collect(Collectors.toList());
YunBpmApiRes bpmApiRes = yunBpmService.saveQualitySystem(abnormalBill, abnormalBillDispose,
String.join(";", NcCodeGroupList), String.join(";", abnormalBill.getNcCodeDesc()));
/*if (!bpmApiRes.getErrCode().equals(0)) {
throw new BaseException("MES提报给质量BPM系统失败");
}*/
}
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
//发送消息
if(Constants.NEW.equals(abnormalBill.getStatus()) && abnormalBill.getBpmSubmit().equals("提报用户组弃用")){

@ -1475,11 +1475,14 @@ public class ReportServiceImpl implements ReportService {
List<Map<String, String>> thisYearMapList = reportMapper.totalWorkingHoursCompletedThisYear(workCenter);
ArrayList<String> monthYearList = new ArrayList<>();
ArrayList<Float> workHorsList = new ArrayList<>();
ArrayList<Float> planHorsList = new ArrayList<>();
for (Map<String, String> map : thisYearMapList) {
monthYearList.add(map.get("MONTH_MONTH"));
planHorsList.add(Float.valueOf(String.valueOf(map.get("PLAN_QTY"))));
workHorsList.add(Float.valueOf(String.valueOf(map.get("QTY"))));
}
result.put("monthYearList",monthYearList);
result.put("planHorsList",planHorsList);
result.put("workHorsList",workHorsList);
//各车间总工时完成情况(单轴多折线图)

@ -12,6 +12,7 @@ import com.foreverwin.mesnac.anomaly.service.YunBpmService;
import com.foreverwin.mesnac.anomaly.utils.*;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.util.DateUtil;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.exception.BaseException;
import org.apache.http.Consts;
@ -110,6 +111,9 @@ public class YunBpmServiceImpl implements YunBpmService {
try {
result = saveForm(qualitySystem, auth.getUser_id(), yunBpmConfig.deptId,
yunBpmConfig.workCode, yunBpmConfig.workCode, (String)tokenRes.getData(), auth.getAccess_token());
//保存操作日志
StringUtil.saveOperLog("BPM质量系统暂存接口单号" + abnormalBill.getAbnormalNo(),"saveForm",
qualitySystem.toString(),result.toString(),null);
String workflowInstanceId = JSON.parseObject(String.valueOf(result.getData())).getString("workflowInstanceId");
abnormalBill.setBpmFlowId(workflowInstanceId);
//mes->bpm 提交
@ -120,9 +124,12 @@ public class YunBpmServiceImpl implements YunBpmService {
JSONObject jsonData = jsonObject.getJSONObject("data");
String workItemId = jsonData.getString("workItemId");
String workflowFormId = jsonData.getJSONObject("bizObject").getJSONObject("data").getString("id");
Thread.currentThread().sleep(2000);
result = defaultSubmitForm(yunBpmConfig.workCode, yunBpmConfig.workCode,workflowFormId, abnormalBill.getBpmFlowId(),
workItemId,(String)tokenRes.getData(), auth.getAccess_token());
//保存操作日志
StringUtil.saveOperLog("BPM质量系统提交接口单号" + abnormalBill.getAbnormalNo(),"defaultSubmitForm",
"workflowFormId:" + workflowFormId + ",bpmFlowId:" + abnormalBill.getBpmFlowId()
+ ",workItemId:" + workItemId,result.toString(),null);
} catch (Exception e) {
logger.error("bpm表单返回错误结果" + e.toString(),result);
}
@ -139,16 +146,21 @@ public class YunBpmServiceImpl implements YunBpmService {
result = updateForm(qualitySystem, yunBpmConfig.workCode, yunBpmConfig.workCode,
workflowFormId, abnormalBill.getBpmFlowId(), workItemId,
(String) tokenRes.getData(), auth.getAccess_token());
//保存操作日志
StringUtil.saveOperLog("BPM质量系统保存接口单号" + qualitySystem.toString(),"updateForm",
qualitySystem.toString(),result.toString(),null);
}else {
//闭关关闭
JSONObject jsonObj = new JSONObject();
jsonObj.put("abnormalbill_reason",abnormalBillDispose.getAbnormalReason());
jsonObj.put("preventive_measure",abnormalBillDispose.getBeforeMeasure());
jsonObj.put("mes_status",0);
System.out.println(jsonObj);
result = updateForm(jsonObj, yunBpmConfig.workCode, yunBpmConfig.workCode,
workflowFormId, abnormalBill.getBpmFlowId(), workItemId,
(String) tokenRes.getData(), auth.getAccess_token());
//保存操作日志
StringUtil.saveOperLog("BPM质量系统关闭接口单号" + qualitySystem.toString(),"updateFormDown",
qualitySystem.toString(),result.toString(),null);
}
}
logger.info("bpm表单返回结果" + result.toString());

@ -1498,14 +1498,14 @@
SELECT CF.VALUE "weekCapacity",WIP.*,
WIP.RESOURCE_TYPE_DESCRIPTION "DESCRIPTION",
WIP.WORK_CENTER_DESCRIPTION "workCenterDescription",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."unWorkHours1" / CF.VALUE) * 100, '99990.99') || '%' "weekRate1",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."unWorkHours2" / CF.VALUE) * 100, '99990.99') || '%' "weekRate2",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."unWorkHours3" / CF.VALUE) * 100, '99990.99') || '%' "weekRate3",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."unWorkHours4" / CF.VALUE) * 100, '99990.99') || '%' "weekRate4",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."unWorkHours5" / CF.VALUE) * 100, '99990.99') || '%' "weekRate5",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."unWorkHours6" / CF.VALUE) * 100, '99990.99') || '%' "weekRate6",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."unWorkHours7" / CF.VALUE) * 100, '99990.99') || '%' "weekRate7",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."unWorkHours8" / CF.VALUE) * 100, '99990.99') || '%' "weekRate8"
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."unWorkHours1" / CF.VALUE) * 100, '99990.99') || '%' "weekRate1",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."unWorkHours2" / CF.VALUE) * 100, '99990.99') || '%' "weekRate2",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."unWorkHours3" / CF.VALUE) * 100, '99990.99') || '%' "weekRate3",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."unWorkHours4" / CF.VALUE) * 100, '99990.99') || '%' "weekRate4",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."unWorkHours5" / CF.VALUE) * 100, '99990.99') || '%' "weekRate5",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."unWorkHours6" / CF.VALUE) * 100, '99990.99') || '%' "weekRate6",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."unWorkHours7" / CF.VALUE) * 100, '99990.99') || '%' "weekRate7",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."unWorkHours8" / CF.VALUE) * 100, '99990.99') || '%' "weekRate8"
FROM (WITH WEEK AS (
SELECT TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW') WEEK0,
TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM-dd'), 'yyyy-MM-dd'), 'IW') + 7 * 1 WEEK1,
@ -1583,23 +1583,23 @@
CF.VALUE "monthCapacity",
CFD.VALUE "dayCapacity",
ZWIP.currentCompletedWorkHours "currentCompletedWorkHours",
TO_CHAR(DECODE(CF.VALUE, NULL, '0.00', ZWIP.currentCompletedWorkHours / CF.VALUE) * 100, '99990.99') ||
TO_CHAR(DECODE(CF.VALUE,0,'0.00', NULL, '0.00', ZWIP.currentCompletedWorkHours / CF.VALUE) * 100, '99990.99') ||
'%' "currentCompletedRate",
ZWIP.currentPlanWorkHours "currentPlanWorkHours",
WIP.RESOURCE_TYPE_DESCRIPTION "DESCRIPTION",
WIP.WORK_CENTER_DESCRIPTION "workCenterDescription",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours1" / CF.VALUE) * 100, '99990.99') || '%' "monthRate1",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours2" / CF.VALUE) * 100, '99990.99') || '%' "monthRate2",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours3" / CF.VALUE) * 100, '99990.99') || '%' "monthRate3",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours4" / CF.VALUE) * 100, '99990.99') || '%' "monthRate4",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours5" / CF.VALUE) * 100, '99990.99') || '%' "monthRate5",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours6" / CF.VALUE) * 100, '99990.99') || '%' "monthRate6",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours7" / CF.VALUE) * 100, '99990.99') || '%' "monthRate7",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours8" / CF.VALUE) * 100, '99990.99') || '%' "monthRate8",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours9" / CF.VALUE) * 100, '99990.99') || '%' "monthRate9",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours10" / CF.VALUE) * 100, '99990.99') || '%' "monthRate10",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours11" / CF.VALUE) * 100, '99990.99') || '%' "monthRate11",
TO_CHAR(DECODE(CF.VALUE,NULL,0, WIP."workHours12" / CF.VALUE) * 100, '99990.99') || '%' "monthRate12"
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours1" / CF.VALUE) * 100, '99990.99') || '%' "monthRate1",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours2" / CF.VALUE) * 100, '99990.99') || '%' "monthRate2",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours3" / CF.VALUE) * 100, '99990.99') || '%' "monthRate3",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours4" / CF.VALUE) * 100, '99990.99') || '%' "monthRate4",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours5" / CF.VALUE) * 100, '99990.99') || '%' "monthRate5",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours6" / CF.VALUE) * 100, '99990.99') || '%' "monthRate6",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours7" / CF.VALUE) * 100, '99990.99') || '%' "monthRate7",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours8" / CF.VALUE) * 100, '99990.99') || '%' "monthRate8",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours9" / CF.VALUE) * 100, '99990.99') || '%' "monthRate9",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours10" / CF.VALUE) * 100, '99990.99') || '%' "monthRate10",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours11" / CF.VALUE) * 100, '99990.99') || '%' "monthRate11",
TO_CHAR(DECODE(CF.VALUE,0,0,NULL,0, WIP."workHours12" / CF.VALUE) * 100, '99990.99') || '%' "monthRate12"
FROM (
WITH MONTH AS (
SELECT ADD_MONTHS(TRUNC(TO_DATE(TO_CHAR(sysdate, 'yyyy-MM'), 'yyyy-MM'), 'yyyy'), 0 - #{month}) month0,
@ -3250,29 +3250,41 @@ SELECT zab.CREATED_DATE_TIME,
</select>
<select id="sixWorkCenterHoursQTY" resultType="java.util.LinkedHashMap">
SELECT ceil(SUM(CASE
WHEN ZSD.WORK_CENTER = 'JJ' AND (ZSD.DISPATCH_STATUS = 'COMPLETE' OR ZSD.DISPATCH_STATUS != 'CANCEL')
WHEN ZSD.WORK_CENTER = 'JJ' AND
(ZSD.DISPATCH_STATUS = 'COMPLETE' OR ZSD.DISPATCH_STATUS = 'CANCEL') AND
(ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= trunc(sysdate, 'yyyy') AND
(ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) &lt;= last_day(add_months(trunc(SYSDATE, 'y'), 11))
THEN ZSD.PROD_HOURS * ZSD.DISPATCH_QTY
ELSE 0 END)) JJ_DONE,
ceil(SUM(CASE
WHEN ZSD.WORK_CENTER = 'HJ' AND (ZSD.DISPATCH_STATUS = 'COMPLETE' OR ZSD.DISPATCH_STATUS != 'CANCEL')
WHEN ZSD.WORK_CENTER = 'HJ' AND
(ZSD.DISPATCH_STATUS = 'COMPLETE' OR ZSD.DISPATCH_STATUS = 'CANCEL') AND
(ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= trunc(sysdate, 'yyyy') AND
(ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) &lt;= last_day(add_months(trunc(SYSDATE, 'y'), 11))
THEN ZSD.PROD_HOURS * ZSD.DISPATCH_QTY
ELSE 0 END)) HJ_DONE,
ceil(SUM(CASE
WHEN ZSD.WORK_CENTER = 'RC' AND (ZSD.DISPATCH_STATUS = 'COMPLETE' OR ZSD.DISPATCH_STATUS != 'CANCEL')
WHEN ZSD.WORK_CENTER = 'RC' AND
(ZSD.DISPATCH_STATUS = 'COMPLETE' OR ZSD.DISPATCH_STATUS = 'CANCEL') AND
(ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) >= trunc(sysdate, 'yyyy') AND
(ZSD.ACTUAL_COMPLETE_DATE + 8 / 24) &lt;= last_day(add_months(trunc(SYSDATE, 'y'), 11))
THEN ZSD.PROD_HOURS * ZSD.DISPATCH_QTY
ELSE 0 END)) RC_DONE,
ceil(SUM(CASE
WHEN ZSD.WORK_CENTER = 'JJ' AND (ZSD.DISPATCH_STATUS != 'CANCEL' AND ZSD.DISPATCH_STATUS != 'PAUSE' AND
WHEN ZSD.WORK_CENTER = 'JJ' AND
(ZSD.DISPATCH_STATUS != 'CANCEL' AND ZSD.DISPATCH_STATUS != 'PAUSE' AND
ZSD.DISPATCH_STATUS != 'COMPLETE')
THEN ZSD.PROD_HOURS * ZSD.DISPATCH_QTY
ELSE 0 END)) JJ_UNFINISD,
ceil(SUM(CASE
WHEN ZSD.WORK_CENTER = 'HJ' AND (ZSD.DISPATCH_STATUS != 'CANCEL' AND ZSD.DISPATCH_STATUS != 'PAUSE' AND
WHEN ZSD.WORK_CENTER = 'HJ' AND
(ZSD.DISPATCH_STATUS != 'CANCEL' AND ZSD.DISPATCH_STATUS != 'PAUSE' AND
ZSD.DISPATCH_STATUS != 'COMPLETE')
THEN ZSD.PROD_HOURS * ZSD.DISPATCH_QTY
ELSE 0 END)) HJ_UNFINISD,
ceil(SUM(CASE
WHEN ZSD.WORK_CENTER = 'RC' AND (ZSD.DISPATCH_STATUS != 'CANCEL' AND ZSD.DISPATCH_STATUS != 'PAUSE' AND
WHEN ZSD.WORK_CENTER = 'RC' AND
(ZSD.DISPATCH_STATUS != 'CANCEL' AND ZSD.DISPATCH_STATUS != 'PAUSE' AND
ZSD.DISPATCH_STATUS != 'COMPLETE')
THEN ZSD.PROD_HOURS * ZSD.DISPATCH_QTY
ELSE 0 END)) RC_UNFINISD
@ -3280,14 +3292,18 @@ SELECT zab.CREATED_DATE_TIME,
</select>
<select id="totalWorkingHoursCompletedThisYear" resultType="java.util.Map">
WITH M_MONTH AS (
SELECT TO_CHAR(ADD_MONTHS(TRUNC(last_day(add_months(trunc(SYSDATE, 'y'), 11))), + ROWNUM - 12), 'yyyy-MM') MONTH
SELECT TO_CHAR(ADD_MONTHS(TRUNC(last_day(add_months(trunc(SYSDATE, 'y'), 11))), + ROWNUM - 24), 'yyyy-MM') MONTH
FROM DUAL
CONNECT BY 12 >= ROWNUM)
SELECT SUBSTR(M_MONTH.MONTH, 6) || '月' MONTH_MONTH,
SUM(ROUND(CASE
WHEN M_MONTH.MONTH = TO_CHAR(ZSD.ACTUAL_COMPLETE_DATE + 8 / 24, 'yyyy-mm') THEN
ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END, 2)) QTY
ELSE 0 END, 2)) QTY,
SUM(ROUND(CASE
WHEN M_MONTH.MONTH = TO_CHAR(ZSD.PLANNED_START_DATE + 8 / 24, 'yyyy-mm') THEN
ZSD.DISPATCH_QTY * ZSD.PROD_HOURS
ELSE 0 END, 2)) PLAN_QTY
FROM Z_SFC_DISPATCH ZSD
CROSS JOIN M_MONTH
GROUP BY M_MONTH.MONTH

@ -0,0 +1,111 @@
package com.foreverwin.mesnac.common.controller;
import com.foreverwin.mesnac.common.model.OperLog;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.foreverwin.mesnac.common.service.OperLogService;
import java.util.List;
/**
*
* @author YinQ
* @since 2023-02-01
*/
@RestController
@RequestMapping("/Z-OPER-LOG")
public class OperLogController {
@Autowired
public OperLogService operLogService;
/**
* id
*
* @param id
* @return
*/
@ResponseBody
@GetMapping("/{id:.+}")
public R getOperLogById(@PathVariable String id) {
return R.ok( operLogService.getById(id));
}
/**
*
*
* @return
*/
@ResponseBody
@GetMapping("")
public R getOperLogList(OperLog operLog){
List<OperLog> result;
QueryWrapper<OperLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(operLog);
result = operLogService.list(queryWrapper);
return R.ok(result);
}
/**
*
*
* @param frontPage
* @return
*/
@ResponseBody
@GetMapping("/page")
public R page(FrontPage<OperLog> frontPage, OperLog operLog){
IPage result;
QueryWrapper<OperLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(operLog);
result = operLogService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}
/**
*
* @param operLog
* @return null
*/
@PostMapping
public R save(@RequestBody OperLog operLog) {
return R.ok(operLogService.save(operLog));
}
/**
*
* @param operLog
* @return null
*/
@PutMapping
public R updateById(@RequestBody OperLog operLog) {
return R.ok(operLogService.updateById(operLog));
}
/**
* id
* @param id ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}")
public R removeById(@PathVariable("id") String id){
return R.ok(operLogService.removeById(id));
}
/**
*
* @param ids ID
* @return 0 1
*/
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/delete-batch")
public R removeByIds(List<String> ids){
return R.ok(operLogService.removeByIds(ids));
}
}

@ -0,0 +1,18 @@
package com.foreverwin.mesnac.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.common.model.OperLog;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper
* </p>
*
* @author YinQ
* @since 2023-02-01
*/
@Repository
public interface OperLogMapper extends BaseMapper<OperLog> {
}

@ -0,0 +1,199 @@
package com.foreverwin.mesnac.common.model;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.foreverwin.mesnac.common.model.ExcelColumn;
/**
* <p>
*
* </p>
*
* @author YinQ
* @since 2023-02-01
*/
@TableName("Z_OPER_LOG")
public class OperLog extends Model<OperLog> {
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelColumn(value = "主键")
@TableId(value = "HANDLE", type = IdType.INPUT)
private String handle;
/**
*
*/
@ExcelColumn(value = "场地")
@TableField("SITE")
private String site;
/**
*
*/
@ExcelColumn(value = "业务标题")
@TableField("TITLE")
private String title;
/**
*
*/
@ExcelColumn(value = "方法名称")
@TableField("METHOD")
private String method;
/**
*
*/
@ExcelColumn(value = "请求参数")
@TableField("OPER_PARAM")
private String operParam;
/**
*
*/
@ExcelColumn(value = "返回参数")
@TableField("RESULT")
private String result;
/**
*
*/
@ExcelColumn(value = "错误消息")
@TableField("ERROR_MSG")
private String errorMsg;
/**
*
*/
@ExcelColumn(value = "操作人")
@TableField("OPER_USER")
private String operUser;
/**
*
*/
@ExcelColumn(value = "操作时间")
@TableField("OPER_TIME")
private LocalDateTime operTime;
public String getHandle() {
return handle;
}
public void setHandle(String handle) {
this.handle = handle;
}
public String getSite() {
return site;
}
public void setSite(String site) {
this.site = site;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getOperParam() {
return operParam;
}
public void setOperParam(String operParam) {
this.operParam = operParam;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public String getOperUser() {
return operUser;
}
public void setOperUser(String operUser) {
this.operUser = operUser;
}
public LocalDateTime getOperTime() {
return operTime;
}
public void setOperTime(LocalDateTime operTime) {
this.operTime = operTime;
}
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String TITLE = "TITLE";
public static final String METHOD = "METHOD";
public static final String OPER_PARAM = "OPER_PARAM";
public static final String RESULT = "RESULT";
public static final String ERROR_MSG = "ERROR_MSG";
public static final String OPER_USER = "OPER_USER";
public static final String OPER_TIME = "OPER_TIME";
@Override
protected Serializable pkVal() {
return this.handle;
}
@Override
public String toString() {
return "OperLog{" +
"handle = " + handle +
", site = " + site +
", title = " + title +
", method = " + method +
", operParam = " + operParam +
", result = " + result +
", errorMsg = " + errorMsg +
", operUser = " + operUser +
", operTime = " + operTime +
"}";
}
}

@ -0,0 +1,30 @@
package com.foreverwin.mesnac.common.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.common.model.OperLog;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author YinQ
* @since 2023-02-01
*/
public interface OperLogService extends IService<OperLog> {
/**
*
* @param frontPage
* @return
*/
IPage<OperLog> selectPage(FrontPage<OperLog> frontPage, OperLog operLog);
List<OperLog> selectList(OperLog operLog);
void logSave(OperLog operLog);
}

@ -0,0 +1,51 @@
package com.foreverwin.mesnac.common.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.mapper.OperLogMapper;
import com.foreverwin.mesnac.common.model.OperLog;
import com.foreverwin.mesnac.common.service.OperLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author YinQ
* @since 2023-02-01
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class OperLogServiceImpl extends ServiceImpl<OperLogMapper, OperLog> implements OperLogService {
@Autowired
private OperLogMapper operLogMapper;
@Override
public IPage<OperLog> selectPage(FrontPage<OperLog> frontPage, OperLog operLog) {
QueryWrapper<OperLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(operLog);
return super.page(frontPage.getPagePlus(), queryWrapper);
}
@Override
public List<OperLog> selectList(OperLog operLog) {
QueryWrapper<OperLog> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(operLog);
return super.list(queryWrapper);
}
@Override
public void logSave(OperLog operLog) {
operLogMapper.insert(operLog);
}
}

@ -1,5 +1,11 @@
package com.foreverwin.mesnac.common.util;
import com.foreverwin.mesnac.common.model.OperLog;
import com.foreverwin.mesnac.common.service.OperLogService;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.SpringUtil;
import java.time.LocalDateTime;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -504,6 +510,31 @@ public class StringUtil
return str;
}
/**
*
* @param title
* @param method
* @param operParam
* @param result
* @param errorMsg
* @return
*/
public static OperLog saveOperLog(String title, String method, String operParam, String result, String errorMsg)
{
OperLog operLog = new OperLog();
operLog.setHandle(StringUtil.createQUID());
operLog.setSite(CommonMethods.getSite());
operLog.setTitle(title);
operLog.setMethod(method);
operLog.setOperParam(operParam);
operLog.setResult(result);
operLog.setErrorMsg(errorMsg);
operLog.setOperUser(CommonMethods.getUser());
operLog.setOperTime(LocalDateTime.now());
SpringUtil.getBean(OperLogService.class).logSave(operLog);;
return operLog;
}
public static void main(String[] args)
{
System.out.println(StringUtil.createQUID());

@ -0,0 +1,386 @@
<?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.foreverwin.mesnac.common.mapper.OperLogMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.foreverwin.mesnac.common.model.OperLog">
<id column="HANDLE" property="handle" />
<result column="SITE" property="site" />
<result column="TITLE" property="title" />
<result column="METHOD" property="method" />
<result column="OPER_PARAM" property="operParam" />
<result column="RESULT" property="result" />
<result column="ERROR_MSG" property="errorMsg" />
<result column="OPER_USER" property="operUser" />
<result column="OPER_TIME" property="operTime" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, TITLE, METHOD, OPER_PARAM, RESULT, ERROR_MSG, OPER_USER, OPER_TIME
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_OPER_LOG WHERE HANDLE=#{handle}
</select>
<select id="selectByMap" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_OPER_LOG
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</select>
<select id="selectBatchIds" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
FROM Z_OPER_LOG WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</select>
<select id="selectOne" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include> FROM Z_OPER_LOG
<where>
<if test="ew.entity.handle!=null">
HANDLE=#{ew.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
</where>
</select>
<select id="selectCount" resultType="Integer">
SELECT COUNT(1) FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMaps" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectObjs" resultType="Object">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectPage" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectMapsPage" resultType="HashMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<insert id="insert" parameterType="com.foreverwin.mesnac.common.model.OperLog">
INSERT INTO Z_OPER_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
HANDLE,
<if test="site!=null">SITE,</if>
<if test="title!=null">TITLE,</if>
<if test="method!=null">METHOD,</if>
<if test="operParam!=null">OPER_PARAM,</if>
<if test="result!=null">RESULT,</if>
<if test="errorMsg!=null">ERROR_MSG,</if>
<if test="operUser!=null">OPER_USER,</if>
<if test="operTime!=null">OPER_TIME,</if>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
<if test="site!=null">#{site},</if>
<if test="title!=null">#{title},</if>
<if test="method!=null">#{method},</if>
<if test="operParam!=null">#{operParam},</if>
<if test="result!=null">#{result},</if>
<if test="errorMsg!=null">#{errorMsg},</if>
<if test="operUser!=null">#{operUser},</if>
<if test="operTime!=null">#{operTime},</if>
</trim>
</insert>
<insert id="insertAllColumn" parameterType="com.foreverwin.mesnac.common.model.OperLog">
INSERT INTO Z_OPER_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
<include refid="Base_Column_List"></include>
</trim> VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
#{handle},
#{site},
#{title},
#{method},
#{operParam},
#{result},
#{errorMsg},
#{operUser},
#{operTime},
</trim>
</insert>
<update id="updateById">
UPDATE Z_OPER_LOG <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.title!=null">TITLE=#{et.title},</if>
<if test="et.method!=null">METHOD=#{et.method},</if>
<if test="et.operParam!=null">OPER_PARAM=#{et.operParam},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.errorMsg!=null">ERROR_MSG=#{et.errorMsg},</if>
<if test="et.operUser!=null">OPER_USER=#{et.operUser},</if>
<if test="et.operTime!=null">OPER_TIME=#{et.operTime},</if>
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="updateAllColumnById">
UPDATE Z_OPER_LOG <trim prefix="SET" suffixOverrides=",">
SITE=#{et.site},
TITLE=#{et.title},
METHOD=#{et.method},
OPER_PARAM=#{et.operParam},
RESULT=#{et.result},
ERROR_MSG=#{et.errorMsg},
OPER_USER=#{et.operUser},
OPER_TIME=#{et.operTime},
</trim> WHERE HANDLE=#{et.handle} <if test="et instanceof java.util.Map"><if test="et.MP_OPTLOCK_VERSION_ORIGINAL!=null">and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL}</if></if>
</update>
<update id="update">
UPDATE Z_OPER_LOG <trim prefix="SET" suffixOverrides=",">
<if test="et.site!=null">SITE=#{et.site},</if>
<if test="et.title!=null">TITLE=#{et.title},</if>
<if test="et.method!=null">METHOD=#{et.method},</if>
<if test="et.operParam!=null">OPER_PARAM=#{et.operParam},</if>
<if test="et.result!=null">RESULT=#{et.result},</if>
<if test="et.errorMsg!=null">ERROR_MSG=#{et.errorMsg},</if>
<if test="et.operUser!=null">OPER_USER=#{et.operUser},</if>
<if test="et.operTime!=null">OPER_TIME=#{et.operTime},</if>
</trim>
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
HANDLE=#{ew.entity.handle}
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</update>
<delete id="deleteById">
DELETE FROM Z_OPER_LOG WHERE HANDLE=#{handle}
</delete>
<delete id="deleteByMap">
DELETE FROM Z_OPER_LOG
<if test="cm!=null and !cm.isEmpty">
<where>
<foreach collection="cm.keys" item="k" separator="AND">
<if test="cm[k] != null">
${k} = #{cm[${k}]}
</if>
</foreach>
</where>
</if>
</delete>
<delete id="delete">
DELETE FROM Z_OPER_LOG
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.title!=null"> AND TITLE=#{ew.entity.title}</if>
<if test="ew.entity.method!=null"> AND METHOD=#{ew.entity.method}</if>
<if test="ew.entity.operParam!=null"> AND OPER_PARAM=#{ew.entity.operParam}</if>
<if test="ew.entity.result!=null"> AND RESULT=#{ew.entity.result}</if>
<if test="ew.entity.errorMsg!=null"> AND ERROR_MSG=#{ew.entity.errorMsg}</if>
<if test="ew.entity.operUser!=null"> AND OPER_USER=#{ew.entity.operUser}</if>
<if test="ew.entity.operTime!=null"> AND OPER_TIME=#{ew.entity.operTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</delete>
<delete id="deleteBatchIds">
DELETE FROM Z_OPER_LOG WHERE HANDLE IN (
<foreach item="item" index="index" collection="coll" separator=",">#{item}
</foreach>)
</delete>
<!-- BaseMapper标准查询/修改/删除 -->
</mapper>
Loading…
Cancel
Save