Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
f5d239e879
|
|
@ -0,0 +1,155 @@
|
|||
package com.bonus.sgzb.app.controller;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.BmAgreementInfo;
|
||||
import com.bonus.sgzb.app.service.*;
|
||||
import com.bonus.sgzb.base.api.domain.TmTask;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 退料接收
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/backReceive")
|
||||
public class BackReceiveController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private BackReceiveService backReceiveService; // 任务表Service
|
||||
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private TmTaskService tmTaskService; // 任务表Service
|
||||
|
||||
/**
|
||||
* 退料接收列表
|
||||
*
|
||||
* @param record 查询条件
|
||||
* @return AjaxResult对象
|
||||
*/
|
||||
@Log(title = "退料接收列表", businessType = BusinessType.QUERY)
|
||||
@PostMapping("getbackReceiveList")
|
||||
public AjaxResult getbackReceiveList(@RequestBody BackApplyInfo record) {
|
||||
try {
|
||||
List<BackApplyInfo> list =backReceiveService.getbackReceiveList(record);
|
||||
return success(list);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 退料接收明细
|
||||
*
|
||||
* @param record 查询条件
|
||||
* @return AjaxResult对象
|
||||
*/
|
||||
@Log(title = "退料接收明细", businessType = BusinessType.QUERY)
|
||||
@PostMapping("receiveView")
|
||||
public AjaxResult receiveView(@RequestBody BackApplyInfo record) {
|
||||
try {
|
||||
List<BackApplyInfo> list =backReceiveService.receiveView(record);
|
||||
return success(list);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数量退料--管理方式为1的
|
||||
*
|
||||
* @param record 查询条件
|
||||
* @return AjaxResult对象
|
||||
*/
|
||||
@Log(title = "退料接收-数量退料", businessType = BusinessType.INSERT)
|
||||
@PostMapping("setNumBack")
|
||||
public AjaxResult setNumBack(@RequestBody BackApplyInfo record) {
|
||||
try {
|
||||
int res =backReceiveService.setNumBack(record);
|
||||
if (res>0){
|
||||
return AjaxResult.success("接收成功");
|
||||
}else {
|
||||
return AjaxResult.error("接收失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数量退料--管理方式为1的
|
||||
*
|
||||
* @param record 查询条件
|
||||
* @return AjaxResult对象
|
||||
*/
|
||||
@Log(title = "退料接收-编码退料", businessType = BusinessType.INSERT)
|
||||
@PostMapping("setCodeBack")
|
||||
public AjaxResult setCodeBack(@RequestBody BackApplyInfo record) {
|
||||
try {
|
||||
int res =backReceiveService.setCodeBack(record);
|
||||
if (res>0){
|
||||
return AjaxResult.success("接收成功");
|
||||
}else {
|
||||
return AjaxResult.error("接收失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Log(title = "退料接收-结束任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping("endBack")
|
||||
public AjaxResult endBack(@RequestBody BackApplyInfo record) {
|
||||
try {
|
||||
int res =backReceiveService.endBack(record);
|
||||
if (res>0){
|
||||
return AjaxResult.success("接收成功");
|
||||
}else {
|
||||
return AjaxResult.error("接收失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Log(title = "退料接收-编号查询", businessType = BusinessType.INSERT)
|
||||
@PostMapping("codeQuery")
|
||||
public AjaxResult codeQuery(@RequestBody BackApplyInfo record) {
|
||||
try {
|
||||
List<BackApplyInfo> list =backReceiveService.codeQuery(record);
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Log(title = "退料接收-二维码查询", businessType = BusinessType.INSERT)
|
||||
@PostMapping("qrcodeQuery")
|
||||
public AjaxResult qrcodeQuery(@RequestBody BackApplyInfo record) {
|
||||
try {
|
||||
List<BackApplyInfo> list =backReceiveService.qrcodeQuery(record);
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -138,4 +138,7 @@ public class BackApplyInfo {
|
|||
private BackApplyInfo info;
|
||||
|
||||
private BackApplyInfo[] arr;
|
||||
private Integer parentId;
|
||||
private String sdStatus;
|
||||
private String qrCode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
package com.bonus.sgzb.app.mapper;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.BmAgreementInfo;
|
||||
import com.bonus.sgzb.base.api.domain.TmTask;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Mapper
|
||||
public interface BackReceiveMapper {
|
||||
|
||||
List<BackApplyInfo> getbackReceiveList(BackApplyInfo record);
|
||||
|
||||
List<BackApplyInfo> receiveView(BackApplyInfo record);
|
||||
|
||||
/**
|
||||
* 添加退料合格数量
|
||||
*/
|
||||
int setCheckDetails(BackApplyInfo record);
|
||||
|
||||
int insertCheckDetails(BackApplyInfo record);
|
||||
|
||||
int selectTaskNumByMonthWx(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||
|
||||
int addWxTask(BackApplyInfo bean);
|
||||
|
||||
int addWxTaskAgreement(BackApplyInfo bean);
|
||||
|
||||
int addRepairDetails(BackApplyInfo bean);
|
||||
|
||||
int updateTaskStatus(@Param("taskId") int taskId, @Param("status") int status);
|
||||
|
||||
int updateMaStatus(@Param("maId") int maId,@Param("maStatus") String maStatus);
|
||||
|
||||
List<BackApplyInfo> getHgList(BackApplyInfo record);
|
||||
|
||||
int insertIAD(BackApplyInfo bi);
|
||||
|
||||
int updateMT(BackApplyInfo bi);
|
||||
|
||||
List<BackApplyInfo> getWxList(BackApplyInfo record);
|
||||
|
||||
int insertTT(BackApplyInfo bean);
|
||||
|
||||
int insertRAD(BackApplyInfo wx);
|
||||
|
||||
int insertTTA(@Param("taskId") int taskId,@Param("agreementId") String agreementId);
|
||||
|
||||
List<BackApplyInfo> getBfList(BackApplyInfo record);
|
||||
|
||||
int insertSAD(BackApplyInfo bf);
|
||||
|
||||
List<BackApplyInfo> codeQuery(BackApplyInfo record);
|
||||
|
||||
List<BackApplyInfo> qrcodeQuery(BackApplyInfo record);
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.bonus.sgzb.app.service;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.BmAgreementInfo;
|
||||
import com.bonus.sgzb.base.api.domain.TmTask;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BackReceiveService {
|
||||
|
||||
List<BackApplyInfo> getbackReceiveList(BackApplyInfo record);
|
||||
|
||||
List<BackApplyInfo> receiveView(BackApplyInfo record);
|
||||
|
||||
int setNumBack(BackApplyInfo record);
|
||||
|
||||
int setCodeBack(BackApplyInfo record);
|
||||
|
||||
int endBack(BackApplyInfo record);
|
||||
|
||||
List<BackApplyInfo> codeQuery(BackApplyInfo record);
|
||||
|
||||
List<BackApplyInfo> qrcodeQuery(BackApplyInfo record);
|
||||
}
|
||||
|
|
@ -0,0 +1,300 @@
|
|||
package com.bonus.sgzb.app.service.impl;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.BmAgreementInfo;
|
||||
import com.bonus.sgzb.app.mapper.BackApplyMapper;
|
||||
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
|
||||
import com.bonus.sgzb.app.service.BackApplyService;
|
||||
import com.bonus.sgzb.app.service.BackReceiveService;
|
||||
import com.bonus.sgzb.base.api.domain.TmTask;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import org.apache.poi.util.StringUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class BackReceiveServiceImpl implements BackReceiveService {
|
||||
|
||||
@Resource
|
||||
private BackReceiveMapper backReceiveMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<BackApplyInfo> getbackReceiveList(BackApplyInfo record) {
|
||||
return backReceiveMapper.getbackReceiveList(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BackApplyInfo> receiveView(BackApplyInfo record) {
|
||||
return backReceiveMapper.receiveView(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int setNumBack(BackApplyInfo record) {
|
||||
int res =0;
|
||||
try{
|
||||
int taskId = record.getTaskId();
|
||||
//修改任务状态
|
||||
res= updateTaskStatus(taskId,39);
|
||||
//插入back_check_details
|
||||
res = insertBCD(record);
|
||||
if(res == 0) {
|
||||
throw new RuntimeException("插入back_check_details异常");
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
private int updateTaskStatus(int taskId, int i) {
|
||||
int res=0;
|
||||
res=backReceiveMapper.updateTaskStatus(taskId,i);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int setCodeBack(BackApplyInfo record) {
|
||||
int res = 0;
|
||||
try{
|
||||
int taskId = record.getTaskId();
|
||||
//修改任务状态
|
||||
res= updateTaskStatus(taskId,39);
|
||||
if(res == 0) {
|
||||
throw new RuntimeException("插入back_check_details异常");
|
||||
}
|
||||
//插入back_check_details
|
||||
res = insertBCD(record);
|
||||
if(res == 0) {
|
||||
throw new RuntimeException("插入back_check_details异常");
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int endBack(BackApplyInfo record) {
|
||||
int res =0;
|
||||
try{
|
||||
int taskId = record.getTaskId();
|
||||
//修改任务状态
|
||||
res= updateTaskStatus(taskId,40);
|
||||
if(res == 0) {
|
||||
throw new RuntimeException("插入back_check_details异常");
|
||||
}
|
||||
//更加退料接收的数据创建下一步流程
|
||||
//合格的插入入库记录input_apply_details,修改库存ma_type,修改机具状态
|
||||
List<BackApplyInfo> hgList = backReceiveMapper.getHgList(record);
|
||||
if(hgList!=null && hgList.size()>0){
|
||||
res = insertIAD(hgList);
|
||||
if(res == 0) {
|
||||
throw new RuntimeException("input_apply_details");
|
||||
}
|
||||
res = updateMT(hgList);
|
||||
if(res == 0) {
|
||||
throw new RuntimeException("ma_type");
|
||||
}
|
||||
res = updateMaStatus(hgList);
|
||||
if(res == 0) {
|
||||
throw new RuntimeException("ma_machines");
|
||||
}
|
||||
}
|
||||
//维修的创建维修任务,插入任务协议表
|
||||
List<BackApplyInfo> wxList = backReceiveMapper.getWxList(record);
|
||||
if(wxList!=null && wxList.size()>0){
|
||||
//插入任务表tm_task
|
||||
int newTaskId = insertTT(hgList,41);
|
||||
//插入协议任务表tm_task_agreement
|
||||
res = insertTTA(taskId,wxList);
|
||||
//插入维修记录表repair_apply_details
|
||||
res = insertRAD(taskId,wxList);
|
||||
}
|
||||
//待报废的创建报废任务,插入任务协议表
|
||||
|
||||
List<BackApplyInfo> bfList = backReceiveMapper.getBfList(record);
|
||||
if(wxList!=null && wxList.size()>0){
|
||||
//插入任务表tm_task
|
||||
int newTaskId = insertTT(hgList,57);
|
||||
//插入协议任务表tm_task_agreement
|
||||
res = insertTTA(taskId,hgList);
|
||||
//插入维修记录表scrap_apply_details
|
||||
res = insertSAD(taskId,hgList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BackApplyInfo> codeQuery(BackApplyInfo record) {
|
||||
|
||||
return backReceiveMapper.codeQuery(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BackApplyInfo> qrcodeQuery(BackApplyInfo record) {
|
||||
return backReceiveMapper.qrcodeQuery(record);
|
||||
}
|
||||
|
||||
private int insertRAD(int taskId, List<BackApplyInfo> wxList) {
|
||||
|
||||
int result = 0;
|
||||
if(wxList !=null){
|
||||
for( BackApplyInfo wx : wxList ){
|
||||
wx.setTaskId(taskId);
|
||||
result = backReceiveMapper.insertRAD(wx);
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private int insertSAD(int taskId, List<BackApplyInfo> list) {
|
||||
int result = 0;
|
||||
if(list !=null){
|
||||
for( BackApplyInfo bf : list ){
|
||||
bf.setTaskId(taskId);
|
||||
result = backReceiveMapper.insertSAD(bf);
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private int insertTTA(int taskId, List<BackApplyInfo> list) {
|
||||
int res = 0 ;
|
||||
String agreementId = list.get(0).getAgreementId();
|
||||
res = backReceiveMapper.insertTTA(taskId,agreementId);
|
||||
return res;
|
||||
}
|
||||
|
||||
private int insertTT(List<BackApplyInfo> hgList, int taskType) {
|
||||
int newTask = 0;
|
||||
|
||||
//生成单号
|
||||
String code = genCodeRule(taskType);
|
||||
|
||||
BackApplyInfo applyInfo = new BackApplyInfo();
|
||||
applyInfo.setTaskType(taskType);
|
||||
String taskStatus="";
|
||||
if(41 == taskType){
|
||||
taskStatus = "42";
|
||||
}
|
||||
if(57 == taskType){
|
||||
taskStatus = "58";
|
||||
}
|
||||
applyInfo.setTaskStatus(taskStatus);
|
||||
applyInfo.setCode(code);
|
||||
//创建人
|
||||
newTask = backReceiveMapper.insertTT(applyInfo);
|
||||
return newTask;
|
||||
}
|
||||
|
||||
|
||||
private int updateMaStatus(List<BackApplyInfo> hgList) {
|
||||
int res =0;
|
||||
if(hgList!=null && hgList.size()>0){
|
||||
for(BackApplyInfo bi : hgList){
|
||||
Integer maId = bi.getMaId();
|
||||
if(maId == null){
|
||||
|
||||
}else{
|
||||
res = backReceiveMapper.updateMaStatus(maId,"15");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int updateMT(List<BackApplyInfo> hgList) {
|
||||
int res =0;
|
||||
if(hgList!=null && hgList.size()>0){
|
||||
for(BackApplyInfo bi : hgList){
|
||||
res = backReceiveMapper.updateMT(bi);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int insertIAD(List<BackApplyInfo> hgList) {
|
||||
int res =0;
|
||||
if(hgList!=null && hgList.size()>0){
|
||||
for(BackApplyInfo bi : hgList){
|
||||
res = backReceiveMapper.insertIAD(bi);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int insertBCD(BackApplyInfo record) {
|
||||
int res =0;
|
||||
BackApplyInfo[] arr = record.getArr();
|
||||
if(arr.length>0){
|
||||
for(int i=0 ; i< arr.length;i++){
|
||||
res = backReceiveMapper.insertCheckDetails(arr[i]);
|
||||
String manageType = arr[i].getManageType();
|
||||
if("0".equals(manageType)){
|
||||
String backStatus = arr[i].getBackStatus();
|
||||
int maId = arr[i].getMaId();
|
||||
if("1".equals(backStatus)){
|
||||
//退料合格状态变为退料带入库84
|
||||
backReceiveMapper.updateMaStatus(maId,"84");
|
||||
}
|
||||
if("2".equals(backStatus)){
|
||||
//退料维修状态变为退料待检修17
|
||||
backReceiveMapper.updateMaStatus(maId,"17");
|
||||
}
|
||||
if("3".equals(backStatus)){
|
||||
//退料待报废状态变为退料待报废20
|
||||
backReceiveMapper.updateMaStatus(maId,"20");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
// 编号生成规则
|
||||
private String genCodeRule(int taskType) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int taskNum = backReceiveMapper.selectTaskNumByMonthWx(nowDate,taskType) + 1;
|
||||
String code="";
|
||||
if(41 == taskType){
|
||||
code = "WX";
|
||||
}
|
||||
if(57 == taskType){
|
||||
code = "BF";
|
||||
}
|
||||
if (taskNum>9 && taskNum<100){
|
||||
code = code + format + "-00" + taskNum;
|
||||
}else if (taskNum>99 && taskNum<1000){
|
||||
code = code +format + "-0" + taskNum;
|
||||
}else {
|
||||
code = code + format + "-000" + taskNum;
|
||||
}
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,809 @@
|
|||
<?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.bonus.sgzb.app.mapper.BackReceiveMapper">
|
||||
<resultMap id="BaseResultMap" type="com.bonus.sgzb.app.domain.BmAgreementInfo">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table bm_agreement_info-->
|
||||
<id column="agreement_id" jdbcType="INTEGER" property="agreementId" />
|
||||
<result column="agreement_code" jdbcType="VARCHAR" property="agreementCode" />
|
||||
<result column="sign_time" jdbcType="VARCHAR" property="signTime" />
|
||||
<result column="unit_id" jdbcType="INTEGER" property="unitId" />
|
||||
<result column="project_id" jdbcType="INTEGER" property="projectId" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="lease_day" jdbcType="INTEGER" property="leaseDay" />
|
||||
<result column="plan_start_time" jdbcType="TIMESTAMP" property="planStartTime" />
|
||||
<result column="contract_code" jdbcType="VARCHAR" property="contractCode" />
|
||||
<result column="auth_person" jdbcType="VARCHAR" property="authPerson" />
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="company_id" jdbcType="INTEGER" property="companyId" />
|
||||
<result column="unit_id" jdbcType="INTEGER" property="unitId" />
|
||||
<result column="unit_name" jdbcType="VARCHAR" property="unitName" />
|
||||
<result column="lot_id" jdbcType="INTEGER" property="lotId" />
|
||||
<result column="lot_name" jdbcType="VARCHAR" property="lotName" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
<insert id="addWxTask" keyColumn="task_id" keyProperty="taskId" parameterType="com.bonus.sgzb.base.api.domain.TmTask" useGeneratedKeys="true">
|
||||
insert into tm_task
|
||||
(
|
||||
<if test="taskType != null">
|
||||
task_type,
|
||||
</if>
|
||||
<if test="taskStatus != null">
|
||||
task_status,
|
||||
</if>
|
||||
<if test="code != null and code != ''">
|
||||
code,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
create_time
|
||||
) values (
|
||||
<if test="taskType != null">
|
||||
#{taskType},
|
||||
</if>
|
||||
<if test="taskStatus != null">
|
||||
#{taskStatus},
|
||||
</if>
|
||||
<if test="code != null and code != ''">
|
||||
#{code},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertTT" keyColumn="task_id" keyProperty="taskId" parameterType="com.bonus.sgzb.base.api.domain.TmTask" useGeneratedKeys="true">
|
||||
insert into tm_task
|
||||
(
|
||||
<if test="taskType != null">
|
||||
task_type,
|
||||
</if>
|
||||
<if test="taskStatus != null">
|
||||
task_status,
|
||||
</if>
|
||||
<if test="code != null and code != ''">
|
||||
code,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
create_time
|
||||
) values (
|
||||
<if test="taskType != null">
|
||||
#{taskType},
|
||||
</if>
|
||||
<if test="taskStatus != null">
|
||||
#{taskStatus},
|
||||
</if>
|
||||
<if test="code != null and code != ''">
|
||||
#{code},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="addWxTaskAgreement">
|
||||
insert into tm_task_agreement
|
||||
(
|
||||
<if test="taskId != null">
|
||||
task_id,
|
||||
</if>
|
||||
<if test="agreementId != null">
|
||||
agreement_id,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
create_time
|
||||
) values (
|
||||
<if test="taskId != null">
|
||||
#{taskId},
|
||||
</if>
|
||||
<if test="agreementId != null">
|
||||
#{agreementId},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertTTA">
|
||||
insert into tm_task_agreement
|
||||
(
|
||||
<if test="taskId != null">
|
||||
task_id,
|
||||
</if>
|
||||
<if test="agreementId != null">
|
||||
agreement_id,
|
||||
</if>
|
||||
create_time
|
||||
) values (
|
||||
<if test="taskId != null">
|
||||
#{taskId},
|
||||
</if>
|
||||
<if test="agreementId != null">
|
||||
#{agreementId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="addRepairDetails">
|
||||
insert into repair_apply_details
|
||||
(
|
||||
<if test="taskId != null">
|
||||
task_id,
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
ma_id,
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="repairNum != null">
|
||||
repair_num,
|
||||
</if>
|
||||
<if test="repairedNum != null">
|
||||
repaired_num,
|
||||
</if>
|
||||
<if test="scrapNum != null">
|
||||
scrap_num,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
update_by,
|
||||
</if>
|
||||
update_time,
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
<if test="backId != null">
|
||||
back_id,
|
||||
</if>
|
||||
<if test="repairer != null">
|
||||
repairer,
|
||||
</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
<if test="taskId != null">
|
||||
#{taskId},
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
#{maId},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="repairNum != null">
|
||||
#{repairNum},
|
||||
</if>
|
||||
<if test="repairedNum != null">
|
||||
#{repairedNum},
|
||||
</if>
|
||||
<if test="scrapNum != null">
|
||||
#{scrapNum},
|
||||
</if>
|
||||
<if test="scrapNum != null">
|
||||
#{scrapNum},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
NOW(),
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertRAD">
|
||||
insert into repair_apply_details
|
||||
(
|
||||
<if test="taskId != null">
|
||||
task_id,
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
ma_id,
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
repair_num,
|
||||
</if>
|
||||
<if test="repairedNum != null">
|
||||
repaired_num,
|
||||
</if>
|
||||
<if test="scrapNum != null">
|
||||
scrap_num,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
update_by,
|
||||
</if>
|
||||
update_time,
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
<if test="backId != null">
|
||||
back_id,
|
||||
</if>
|
||||
<if test="repairer != null">
|
||||
repairer,
|
||||
</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
<if test="taskId != null">
|
||||
#{taskId},
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
#{maId},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
#{backNum},
|
||||
</if>
|
||||
<if test="repairedNum != null">
|
||||
#{repairedNum},
|
||||
</if>
|
||||
<if test="scrapNum != null">
|
||||
#{scrapNum},
|
||||
</if>
|
||||
<if test="scrapNum != null">
|
||||
#{scrapNum},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
NOW(),
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertCheckDetails">
|
||||
insert into back_check_details
|
||||
(
|
||||
<if test="id != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
ma_id,
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
back_num,
|
||||
</if>
|
||||
<if test="backStatus != null">
|
||||
back_status,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
update_by,
|
||||
</if>
|
||||
update_time,
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
#{maId},
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
#{backNum},
|
||||
</if>
|
||||
<if test="backStatus != null">
|
||||
#{backStatus},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
NOW(),
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="setInputApplyDetails">
|
||||
insert into input_apply_details
|
||||
(
|
||||
<if test="taskId != null">
|
||||
task_id,
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
ma_id,
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="inputNum != null">
|
||||
input_num,
|
||||
</if>
|
||||
input_type,
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
update_by,
|
||||
</if>
|
||||
update_time,
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
<if test="taskId != null">
|
||||
#{taskId},
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
#{maId},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
#{parentId},
|
||||
</if>
|
||||
<if test="inputNum != null">
|
||||
#{inputNum},
|
||||
</if>
|
||||
'2',
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
NOW(),
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertIAD">
|
||||
insert into input_apply_details
|
||||
(
|
||||
<if test="taskId != null">
|
||||
task_id,
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
ma_id,
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
input_num,
|
||||
</if>
|
||||
input_type,
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
update_by,
|
||||
</if>
|
||||
update_time,
|
||||
<if test="remark != null and remark != ''">
|
||||
remark,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
<if test="taskId != null">
|
||||
#{taskId},
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
#{maId},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
#{parentId},
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
#{backNum},
|
||||
</if>
|
||||
'2',
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
NOW(),
|
||||
<if test="remark != null and remark != ''">
|
||||
#{remark},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertSAD">
|
||||
insert into scrap_apply_details
|
||||
(
|
||||
<if test="taskId != null">
|
||||
task_id,
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
ma_id,
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
scrap_num,
|
||||
</if>
|
||||
scrap_source,
|
||||
status,
|
||||
<if test="createBy != null and createBy != ''">
|
||||
create_by,
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
company_id,
|
||||
</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
<if test="taskId != null">
|
||||
#{taskId},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
#{parentId},
|
||||
</if>
|
||||
<if test="maId != null">
|
||||
#{maId},
|
||||
</if>
|
||||
<if test="typeId != null">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="backNum != null">
|
||||
#{backNum},
|
||||
</if>
|
||||
'1',
|
||||
'0',
|
||||
<if test="createBy != null and createBy != ''">
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateTaskStatus">
|
||||
update tm_task
|
||||
set task_status=#{status}
|
||||
where task_id = #{taskId}
|
||||
</update>
|
||||
<update id="updateMaStatus">
|
||||
update ma_machine
|
||||
set ma_status=#{maStatus}
|
||||
where ma_id = #{maId}
|
||||
</update>
|
||||
|
||||
<update id="updateMT">
|
||||
UPDATE ma_type
|
||||
SET num = (IFNULL(num, 0)) + #{backNum}
|
||||
WHERE type_id = #{typeId}
|
||||
</update>
|
||||
|
||||
<select id="getbackReceiveList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id,
|
||||
bai.`code`,
|
||||
bai.task_id as taskId,
|
||||
bai.back_person as backPerson,
|
||||
bai.phone,
|
||||
bpl.lot_id,
|
||||
bpl.lot_name as lotName,
|
||||
bui.unit_id as unitId,
|
||||
bui.unit_name as unitName,
|
||||
bai.back_time as backTime,
|
||||
tt.task_status as taskStatus,
|
||||
tta.agreement_id as agreementId,
|
||||
GROUP_CONCAT(DISTINCT bad.type_id) as typeId,
|
||||
GROUP_CONCAT(mt2.type_name, '') AS typeName
|
||||
FROM
|
||||
back_apply_info bai
|
||||
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||
LEFT JOIN tm_task tt on tt.task_id=bai.task_id
|
||||
LEFT JOIN tm_task_agreement tta on tta.task_id=tt.task_id
|
||||
LEFT JOIN bm_agreement_info bagi on bagi.agreement_id=tta.agreement_id
|
||||
LEFT JOIN bm_project_lot bpl on bpl.lot_id=bagi.project_id
|
||||
LEFT JOIN bm_unit_info bui on bui.unit_id=bagi.unit_id
|
||||
LEFT JOIN sys_user us on us.user_id=bai.create_by
|
||||
LEFT JOIN ma_type mt1 ON mt1.type_id=bad.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id=mt1.parent_id
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id=mt2.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id=mt3.parent_id
|
||||
WHERE
|
||||
bai.company_id=#{companyId}
|
||||
and tt.task_status>='38'
|
||||
GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
|
||||
</select>
|
||||
|
||||
<select id="receiveView" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id,
|
||||
bai.task_id as taskId,
|
||||
tta.agreement_id as agreementId,
|
||||
mt.type_name typeCode,
|
||||
mt2.type_name AS typeName,
|
||||
bad.audit_num as num,
|
||||
mm.ma_code as maCode,
|
||||
mt.manage_type as manageType
|
||||
FROM
|
||||
back_apply_details bad
|
||||
LEFT JOIN back_apply_info bai on bai.id=bad.parent_id
|
||||
LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id
|
||||
LEFT JOIN ma_type mt on mt.type_id=bad.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt1.type_id=bad.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id=mt1.parent_id
|
||||
LEFT JOIN ma_type mt3 ON mt3.type_id=mt2.parent_id
|
||||
LEFT JOIN ma_type mt4 ON mt4.type_id=mt3.parent_id
|
||||
LEFT JOIN ma_machine mm on mm.type_id=bad.type_id
|
||||
WHERE
|
||||
bai.id=#{id}
|
||||
</select>
|
||||
|
||||
<select id="selectTaskNumByMonthWx" resultType="java.lang.Integer">
|
||||
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') and task_type = #{taskType}
|
||||
</select>
|
||||
<select id="getHgList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
SELECT
|
||||
tta.agreement_id as agreementId,
|
||||
bai.id,
|
||||
bcd.type_id as typeId,
|
||||
bcd.back_num as backNum,
|
||||
bcd.parent_id as parentId,
|
||||
bcd.create_by as createBy
|
||||
FROM
|
||||
back_check_details bcd
|
||||
LEFT JOIN back_apply_info bai on bai.id=bcd.parent_id
|
||||
LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id
|
||||
WHERE
|
||||
parent_id=#{parentId}
|
||||
and bcd.back_status='1'
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getWxList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
SELECT
|
||||
tta.agreement_id as agreementId,
|
||||
bai.id,
|
||||
bcd.type_id as typeId,
|
||||
bcd.back_num as backNum,
|
||||
bcd.parent_id as parentId,
|
||||
bcd.create_by as createBy
|
||||
FROM
|
||||
back_check_details bcd
|
||||
LEFT JOIN back_apply_info bai on bai.id=bcd.parent_id
|
||||
LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id
|
||||
WHERE
|
||||
parent_id=#{parentId}
|
||||
and bcd.back_status='2'
|
||||
</select>
|
||||
|
||||
<select id="getBfList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
SELECT
|
||||
tta.agreement_id as agreementId,
|
||||
bai.id,
|
||||
bcd.type_id as typeId,
|
||||
bcd.back_num as backNum,
|
||||
bcd.parent_id as parentId,
|
||||
bcd.create_by as createBy
|
||||
FROM
|
||||
back_check_details bcd
|
||||
LEFT JOIN back_apply_info bai on bai.id=bcd.parent_id
|
||||
LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id
|
||||
WHERE
|
||||
parent_id=#{parentId}
|
||||
and bcd.back_status='3'
|
||||
</select>
|
||||
|
||||
<select id="codeQuery" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
SELECT
|
||||
mt.type_id as typeId,
|
||||
mm.ma_id as maId,
|
||||
mm.ma_code as maCode,
|
||||
mt.type_name as typeCode,
|
||||
mt2.type_name as typeName,
|
||||
sd.`name` as sdStatus
|
||||
FROM
|
||||
ma_machine mm
|
||||
LEFT JOIN ma_type mt on mt.type_id=mm.type_id
|
||||
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
|
||||
LEFT JOIN sys_dic sd on mm.ma_status=sd.id
|
||||
WHERE
|
||||
ma_code LIKE concat('%', #{maCode}, '%')
|
||||
</select>
|
||||
|
||||
<select id="qrcodeQuery" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
SELECT
|
||||
mt.type_id as typeId,
|
||||
mm.ma_id as maId,
|
||||
mm.ma_code as maCode,
|
||||
mt.type_name as typeCode,
|
||||
mt2.type_name as typeName,
|
||||
sd.`name` as sdStatus
|
||||
FROM
|
||||
ma_machine mm
|
||||
LEFT JOIN ma_type mt on mt.type_id=mm.type_id
|
||||
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
|
||||
LEFT JOIN sys_dic sd on mm.ma_status=sd.id
|
||||
WHERE
|
||||
qr_code =#{qrCode}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -90,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
left join ma_type mt2 on mt1.parent_id = mt2.type_id
|
||||
left join ma_label_bind mmb on m.ma_id = mmb.ma_id and m.type_id = mmb.type_id
|
||||
where m.ma_code = #{maCode}
|
||||
where m.ma_code = #{maCode} or m.qr_code = #{maCode}
|
||||
</select>
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue