直转申请,直转记录查询

This commit is contained in:
hayu 2025-02-18 18:58:20 +08:00
parent 2ca16fd1d5
commit dc5343ce48
21 changed files with 1023 additions and 107 deletions

View File

@ -12,6 +12,8 @@ import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
import com.bonus.material.lease.service.ILeaseApplyInfoService;
import com.bonus.material.lease.service.ILeaseTaskService;
import com.bonus.material.ma.domain.Type;
import com.bonus.material.ma.domain.vo.StandardConfigDetailsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
@ -101,4 +103,19 @@ public class LeaseTaskController extends BaseController {
return toAjax(service.deleteLeaseApplyInfoByIds(ids));
}
/**
* 查询规格型号对应数据
*/
@ApiOperation(value = "查询规格型号对应数据")
@GetMapping("/getTypeDataList")
public AjaxResult getTypeDataList(Type bean) {
try {
List<Type> listByMaType = service.getTypeDataList(bean);
return success(listByMaType);
} catch (Exception e) {
return success(new ArrayList<>());
}
}
}

View File

@ -3,6 +3,7 @@ package com.bonus.material.lease.mapper;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.material.lease.domain.LeaseApplyDetails;
import com.bonus.material.ma.domain.Type;
import java.util.List;
@ -60,4 +61,12 @@ public interface LeaseTaskMapper {
* @return 领用任务
*/
LeaseApplyInfo selectLeaseApplyInfoById(LeaseApplyInfo leaseApplyInfo);
/**
* 查询规格型号对应数据
*
* @param bean
* @return 结果
*/
List<Type> getTypeDataList(Type bean);
}

View File

@ -4,6 +4,7 @@ package com.bonus.material.lease.service;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
import com.bonus.material.ma.domain.Type;
import java.util.List;
@ -55,5 +56,13 @@ public interface ILeaseTaskService {
* @return 结果
*/
int deleteLeaseApplyInfoByIds(Long[] ids);
/**
* 查询规格型号对应数据
*
* @param bean
* @return
*/
List<Type> getTypeDataList(Type bean);
}

View File

@ -19,6 +19,7 @@ import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
import com.bonus.material.lease.mapper.LeaseApplyInfoMapper;
import com.bonus.material.lease.mapper.LeaseTaskMapper;
import com.bonus.material.lease.service.ILeaseTaskService;
import com.bonus.material.ma.domain.Type;
import com.bonus.material.task.domain.TmTask;
import com.bonus.material.task.domain.TmTaskAgreement;
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
@ -267,6 +268,11 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
return leaseApplyInfoMapper.deleteLeaseApplyInfoByIds(ids);
}
@Override
public List<Type> getTypeDataList(Type bean) {
return mapper.getTypeDataList(bean);
}
/**
* 关键字搜索
* @param item

View File

@ -0,0 +1,130 @@
package com.bonus.material.ma.controller;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.ma.domain.DirectApplyDetails;
import com.bonus.material.ma.domain.DirectApplyInfo;
import com.bonus.material.ma.domain.DirectApplyInfoDetails;
import com.bonus.material.ma.domain.StandardConfigBean;
import com.bonus.material.ma.service.DirectRotationService;
import com.bonus.material.ma.service.WorkSiteDirectManageService;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @description 直转申请
* @author hay
* @date 2025/2/17 19:27
*/
@Api(tags = " 直转申请")
@RestController
@RequestMapping("/directRotation")
public class DirectRotationController extends BaseController {
@Resource(name = "directRotationService")
private DirectRotationService service;
/**
* 根据协议Id查询在用数据
*/
@ApiOperation(value = "根据协议Id查询在用数据")
@GetMapping("/getUseringData")
public AjaxResult getUseringData(SltAgreementInfo sltAgreementInfo) {
try {
List<SltAgreementInfo> useringData = service.getUseringData(sltAgreementInfo);
return AjaxResult.success(useringData);
} catch (Exception e) {
return AjaxResult.success(new ArrayList<>());
}
}
/**
* 根据协议Id查询在用数据--类型名称下拉,规格型号下拉在用数据列表
* @param bean
* @return
*/
@ApiOperation(value = "标准配置下拉选")
@PostMapping("/getTypeNameList")
public AjaxResult getTypeNameList(@RequestBody SltAgreementInfo bean){
return service.getTypeNameList(bean);
}
/**
* 新增直转申请
*/
@ApiOperation(value = "新增直转申请")
@PostMapping("/submit")
public AjaxResult submit(@RequestBody DirectApplyInfoDetails directApplyInfoDetails) {
try {
return service.submit(directApplyInfoDetails);
} catch (Exception e) {
return AjaxResult.error("保存失败");
}
}
/**
* 修改直转申请
*/
@ApiOperation(value = "修改直转申请")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody DirectApplyInfoDetails directApplyInfoDetails) {
try {
return service.edit(directApplyInfoDetails);
} catch (Exception e) {
return AjaxResult.error("保存失败");
}
}
/**
* 直转记录查询列表
*/
@ApiOperation(value = "直转记录查询列表")
@GetMapping("/list")
public TableDataInfo list(DirectApplyInfo directApplyInfo) {
startPage();
try {
List<DirectApplyInfo> directApplyInfos = service.getList(directApplyInfo);
return getDataTable(directApplyInfos);
} catch (Exception e) {
return getDataTable(new ArrayList<>());
}
}
@ApiOperation(value = "查看详情")
@GetMapping("/getInfo")
public AjaxResult getInfo(SltAgreementInfo sltAgreementInfo) {
try {
return AjaxResult.success(service.getInfoById(sltAgreementInfo));
} catch (Exception e) {
return AjaxResult.success(new DirectApplyInfo());
}
}
/**
* 删除直转申请
*/
@ApiOperation(value = "删除直转申请")
@PreventRepeatSubmit
@SysLog(title = "直转记录查询", businessType = OperaType.DELETE, logType = 1,module = "直转记录查询->删除直转申请")
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id) {
return toAjax(service.delData(id));
}
}

View File

@ -165,6 +165,17 @@ public class TypeController extends BaseController {
return success(listByMaType);
}
/**
* 查询物资类型3级--前端联动式下拉框(在用设备)
* 没有4级规格型号
*/
@ApiOperation(value = "获取物资类型连动式下拉框")
@GetMapping("/equipmentThreeTypes")
public AjaxResult equipmentThreeTypes(@RequestParam(required = false) Long typeId, @RequestParam(required = false) Long agreementId) {
List<Type> listByMaType = typeService.getEquipmentThreeTypes(typeId, agreementId);
return success(listByMaType);
}
/**
* TODO : 后续优化代码逻辑

View File

@ -33,6 +33,8 @@ public class DirectApplyDetails extends BaseEntity {
private String typeName;
private String typeModelName;
private String kindName;
private String modelName;
@ -44,4 +46,8 @@ public class DirectApplyDetails extends BaseEntity {
private Integer useNum;
private String companyId;
private String leasePerson;
private String startTime;
}

View File

@ -99,6 +99,12 @@ public class DirectApplyInfo extends BaseEntity {
* 直转附件
*/
private String dirUrl;
/**
* 直转附件数组
*/
private List<DirectApplyUrl> dirUrls;
/**
* 0待审批1审批同意2驳回
*/
@ -135,6 +141,10 @@ public class DirectApplyInfo extends BaseEntity {
*/
private String unitId;
private String typeName;
private String createName;
/**
* 退料明细
*/

View File

@ -0,0 +1,15 @@
package com.bonus.material.ma.domain;
import com.bonus.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = false)
@Data
public class DirectApplyUrl extends BaseEntity {
private String url;
public DirectApplyUrl(String s) {
this.url = s;
}
}

View File

@ -219,6 +219,8 @@ public class Type extends BaseEntity {
private String keyword;
private String maTypeName;
/** 子节点 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private List<Type> children = new ArrayList<>();

View File

@ -0,0 +1,74 @@
package com.bonus.material.ma.mapper;
import com.bonus.material.ma.domain.DirectApplyDetails;
import com.bonus.material.ma.domain.DirectApplyInfo;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @description 直转申请
* @author hay
* @date 2025/2/17 19:38
*/
@Mapper
public interface DirectRotationMapper {
/**
* 根据协议Id查询在用数据
* @param sltAgreementInfo
* @return List<SltAgreementInfo>
*/
List<SltAgreementInfo> getUseringData(SltAgreementInfo sltAgreementInfo);
/**
* 直转记录查询列表
* @param directApplyInfo
* @return
*/
List<DirectApplyInfo> getList(DirectApplyInfo directApplyInfo);
/**
* 查看
* @param sltAgreementInfo
* @return
*/
DirectApplyInfo getInfoById(SltAgreementInfo sltAgreementInfo);
/**
* 查看详情
* @param sltAgreementInfo
* @return
*/
List<DirectApplyDetails> getDetailById(SltAgreementInfo sltAgreementInfo);
/**
* 修改直转记录
* @param directApplyInfos
* @return
*/
int updateDirectApplyInfo(DirectApplyInfo directApplyInfos);
/**
* 删除直转记录详情
* @param id
* @return
*/
int deleteDirectApplyDetails(Integer id);
/**
* 删除直转记录
* @param id
* @return
*/
int deleteDirectApply(Long id);
/**
* 查询规格型号对应数据
* @param bean
* @return
*/
List<SltAgreementInfo> getTypeNameList(SltAgreementInfo bean);
}

View File

@ -183,4 +183,10 @@ public interface TypeMapper {
*/
int addMaTypeStockNum(@Param("record") LeaseOutDetails leaseOutDetails);
/**
* 根据合同ID查询三级物资类型
* @param agreementId
* @return
*/
List<Type> selectMaTypeThreeLists(Long agreementId);
}

View File

@ -0,0 +1,67 @@
package com.bonus.material.ma.service;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.ma.domain.DirectApplyInfo;
import com.bonus.material.ma.domain.DirectApplyInfoDetails;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import java.util.List;
/**
* @description 直转申请
* @author hay
* @date 2025/2/17 19:32
*/
public interface DirectRotationService {
/**
* 根据协议Id查询在用数据
* @param sltAgreementInfo
* @return List<SltAgreementInfo>
*/
List<SltAgreementInfo> getUseringData(SltAgreementInfo sltAgreementInfo);
/**
* 直转记录查询列表
* @param directApplyInfo
* @return
*/
List<DirectApplyInfo> getList(DirectApplyInfo directApplyInfo);
/**
* 新增直转申请
* @param directApplyInfoDetails
* @return
*/
AjaxResult submit(DirectApplyInfoDetails directApplyInfoDetails);
/**
* 查看详情
* @param sltAgreementInfo
* @return
*/
DirectApplyInfo getInfoById(SltAgreementInfo sltAgreementInfo);
/**
* 修改直转申请
* @param directApplyInfoDetails
* @return
*/
AjaxResult edit(DirectApplyInfoDetails directApplyInfoDetails);
/**
* 删除直转申请
* @param id
* @return
*/
int delData(Long id);
/**
* 查询规格型号对应数据
* @param bean
* @return
*/
AjaxResult getTypeNameList(SltAgreementInfo bean);
}

View File

@ -122,4 +122,12 @@ public interface ITypeService {
List<MaTypeVo> getMyTypeAndBindUsers(List<MaTypeVo> list,Long userId);
/**
* 查询物资类型3级--前端联动式下拉框
* 没有4级规格型号
* @param typeId
* @param agreementId
* @return
*/
List<Type> getEquipmentThreeTypes(Long typeId, Long agreementId);
}

View File

@ -0,0 +1,166 @@
package com.bonus.material.ma.service.impl;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.material.ma.domain.DirectApplyDetails;
import com.bonus.material.ma.domain.DirectApplyInfo;
import com.bonus.material.ma.domain.DirectApplyInfoDetails;
import com.bonus.material.ma.domain.DirectApplyUrl;
import com.bonus.material.ma.mapper.DirectRotationMapper;
import com.bonus.material.ma.service.DirectRotationService;
import com.bonus.material.ma.service.WorkSiteDirectManageService;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @author hay
* @description 直转申请
* @date 2025/2/17 19:34
*/
@Service(value = "directRotationService")
@Slf4j
public class DirectRotationImpl implements DirectRotationService {
@Resource
private DirectRotationMapper mapper;
@Resource(name = "workSiteDirectManageService")
private WorkSiteDirectManageService workSiteDirectManageService;
@Override
public List<SltAgreementInfo> getUseringData(SltAgreementInfo sltAgreementInfo) {
return mapper.getUseringData(sltAgreementInfo);
}
@Override
public List<DirectApplyInfo> getList(DirectApplyInfo directApplyInfo) {
return mapper.getList(directApplyInfo);
}
@Override
public AjaxResult submit(DirectApplyInfoDetails directApplyInfoDetails) {
int id = 0;
if (directApplyInfoDetails != null) {
if (directApplyInfoDetails.getDirectApplyInfo() != null) {
DirectApplyInfo directApplyInfos = directApplyInfoDetails.getDirectApplyInfo();
directApplyInfos.setCode(workSiteDirectManageService.genderLeaseCode());
directApplyInfos.setCreateTime(new Date());
List<String> urls = new ArrayList<>();
if (directApplyInfoDetails.getDirectApplyInfo().getDirUrls() != null) {
List<DirectApplyUrl> dirUrls = directApplyInfoDetails.getDirectApplyInfo().getDirUrls();
for (DirectApplyUrl dirUrl : dirUrls){
urls.add(dirUrl.getUrl());
}
//将urls所有内容用逗号拼接
directApplyInfos.setDirUrl(String.join(",", urls));
}
// if (directApplyInfoDetails.getDirectApplyInfo().getDirUrls() != null && directApplyInfoDetails.getDirectApplyInfo().getDirUrls().length > 0){
// //使用逗号拼接
// directApplyInfos.setDirUrl(String.join(",", directApplyInfoDetails.getDirectApplyInfo().getDirUrls()));
// }
directApplyInfos.setCreateBy(SecurityUtils.getUserId().toString());
int i = workSiteDirectManageService.saveDirectApplyInfo(directApplyInfos);
if (i < 0) {
return AjaxResult.error("保存失败");
}
id = directApplyInfos.getId();
} else {
return AjaxResult.error("保存失败");
}
if (directApplyInfoDetails.getDirectApplyInfoDetails() != null) {
List<DirectApplyDetails> directApplyDetails = directApplyInfoDetails.getDirectApplyInfoDetails();
for (DirectApplyDetails directApplyDetail : directApplyDetails) {
directApplyDetail.setDirectId(id);
int i = workSiteDirectManageService.saveDirectApplyDetails(directApplyDetail);
if (i < 0) {
return AjaxResult.error("保存失败");
}
}
}
} else {
return AjaxResult.error("保存失败");
}
return AjaxResult.success("保存成功");
}
@Override
public AjaxResult edit(DirectApplyInfoDetails directApplyInfoDetails) {
if (directApplyInfoDetails != null) {
if (directApplyInfoDetails.getDirectApplyInfo() != null && directApplyInfoDetails.getDirectApplyInfo().getId() != null) {
DirectApplyInfo directApplyInfos = directApplyInfoDetails.getDirectApplyInfo();
directApplyInfos.setUpdateTime(new Date());
List<String> urls = new ArrayList<>();
if (directApplyInfoDetails.getDirectApplyInfo().getDirUrls() != null) {
List<DirectApplyUrl> dirUrls = directApplyInfoDetails.getDirectApplyInfo().getDirUrls();
for (DirectApplyUrl dirUrl : dirUrls){
urls.add(dirUrl.getUrl());
}
//将urls所有内容用逗号拼接
directApplyInfos.setDirUrl(String.join(",", urls));
//修改info表
int i = mapper.updateDirectApplyInfo(directApplyInfos);
//删除详情表内容
int i1 = mapper.deleteDirectApplyDetails(directApplyInfos.getId());
if (directApplyInfoDetails.getDirectApplyInfoDetails() != null) {
List<DirectApplyDetails> directApplyDetails = directApplyInfoDetails.getDirectApplyInfoDetails();
for (DirectApplyDetails directApplyDetail : directApplyDetails) {
directApplyDetail.setDirectId(directApplyInfos.getId());
int i2 = workSiteDirectManageService.saveDirectApplyDetails(directApplyDetail);
}
}
}
} else {
return AjaxResult.error("修改失败");
}
} else {
return AjaxResult.error("修改失败");
}
return null;
}
@Override
public DirectApplyInfo getInfoById(SltAgreementInfo sltAgreementInfo) {
DirectApplyInfo directApplyInfo = mapper.getInfoById(sltAgreementInfo);
if (directApplyInfo.getDirUrl()!= null){
//用逗号分割放入数组
String[] split = directApplyInfo.getDirUrl().split(",");
List<DirectApplyUrl> list1 = new ArrayList<>();
for (String s : split) {
list1.add(new DirectApplyUrl(s));
}
directApplyInfo.setDirUrls(list1);
}
List<DirectApplyDetails> detailById = mapper.getDetailById(sltAgreementInfo);
directApplyInfo.setDirectApplyDetails(detailById);
return directApplyInfo;
}
@Override
public int delData(Long id) {
try {
mapper.deleteDirectApply(id);
return 1;
} catch (Exception e) {
return 0;
}
}
@Override
public AjaxResult getTypeNameList(SltAgreementInfo bean) {
List<SltAgreementInfo> list =new ArrayList<>();
try {
list = mapper.getTypeNameList(bean);
} catch (Exception e) {
return AjaxResult.success(new ArrayList());
}
return AjaxResult.success(list);
}
}

View File

@ -166,6 +166,23 @@ public class TypeServiceImpl implements ITypeService {
return list;
}
@Override
public List<Type> getEquipmentThreeTypes(Long typeId, Long agreementId) {
List<Type> maTypes = typeMapper.selectMaTypeThreeLists(agreementId);
List<Type> list = new ArrayList<>();
for (Type maType : maTypes) {
if (maType.getParentId() == 0) {
list.add(maType);
}
}
//根据父节点获取对应的儿子节点
for (Type maType : list) {
List<Type> child = getChild(maTypes, maType.getTypeId());
maType.setChildren(child);
}
return list;
}
@Override
public List<MaTypeSelectVo> selectMaTypeListByHouseId(Long houseId) {
@ -815,5 +832,4 @@ public class TypeServiceImpl implements ITypeService {
}
}

View File

@ -206,4 +206,11 @@ public class SltAgreementInfo extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date auditTime;
@ApiModelProperty(value = "领料人")
private String leasePerson;
private Long parentId;
private Integer type;
}

View File

@ -1,63 +1,104 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.material.lease.mapper.LeaseTaskMapper">
<resultMap type="com.bonus.common.biz.domain.lease.LeaseApplyInfo" id="LeaseApplyInfoResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="taskId" column="task_id" />
<result property="leasePerson" column="lease_person" />
<result property="phone" column="phone" />
<result property="type" column="type" />
<result property="companyAuditBy" column="company_audit_by" />
<result property="companyAuditTime" column="company_audit_time" />
<result property="companyAuditRemark" column="company_audit_remark" />
<result property="deptAuditBy" column="dept_audit_by" />
<result property="deptAuditTime" column="dept_audit_time" />
<result property="deptAuditRemark" column="dept_audit_remark" />
<result property="directAuditBy" column="direct_audit_by" />
<result property="directAuditTime" column="direct_audit_time" />
<result property="directAuditRemark" column="direct_audit_remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="companyId" column="company_id" />
<result property="directId" column="direct_id" />
<result property="leaseType" column="lease_type" />
<result property="estimateLeaseTime" column="estimate_lease_time" />
<result property="costBearingParty" column="cost_bearing_party" />
<result property="leaseProject" column="pro_name" />
<result property="leaseProjectId" column="project_id" />
<result property="leaseUnit" column="unit_name" />
<result property="leaseUnitId" column="unit_id" />
<result property="agreementCode" column="agreement_code" />
<result property="leaseSignUrl" column="lease_sign_url" />
<result property="leaseSignType" column="lease_sign_type" />
<result property="applyCode" column="apply_code" />
<result property="id" column="id"/>
<result property="code" column="code"/>
<result property="taskId" column="task_id"/>
<result property="leasePerson" column="lease_person"/>
<result property="phone" column="phone"/>
<result property="type" column="type"/>
<result property="companyAuditBy" column="company_audit_by"/>
<result property="companyAuditTime" column="company_audit_time"/>
<result property="companyAuditRemark" column="company_audit_remark"/>
<result property="deptAuditBy" column="dept_audit_by"/>
<result property="deptAuditTime" column="dept_audit_time"/>
<result property="deptAuditRemark" column="dept_audit_remark"/>
<result property="directAuditBy" column="direct_audit_by"/>
<result property="directAuditTime" column="direct_audit_time"/>
<result property="directAuditRemark" column="direct_audit_remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="companyId" column="company_id"/>
<result property="directId" column="direct_id"/>
<result property="leaseType" column="lease_type"/>
<result property="estimateLeaseTime" column="estimate_lease_time"/>
<result property="costBearingParty" column="cost_bearing_party"/>
<result property="leaseProject" column="pro_name"/>
<result property="leaseProjectId" column="project_id"/>
<result property="leaseUnit" column="unit_name"/>
<result property="leaseUnitId" column="unit_id"/>
<result property="agreementCode" column="agreement_code"/>
<result property="leaseSignUrl" column="lease_sign_url"/>
<result property="leaseSignType" column="lease_sign_type"/>
<result property="applyCode" column="apply_code"/>
</resultMap>
<resultMap type="com.bonus.material.lease.domain.LeaseApplyDetails" id="LeaseApplyDetailsResult">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="typeId" column="type_id" />
<result property="typeName" column="type_name" />
<result property="maTypeName" column="ma_type_name" />
<result property="unitName" column="unit_name" />
<result property="unitValue" column="unit_value" />
<result property="storageNum" column="storage_num" />
<result property="preNum" column="pre_num" />
<result property="auditNum" column="audit_num" />
<result property="alNum" column="al_num" />
<result property="status" column="status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="companyId" column="company_id" />
<result property="id" column="id"/>
<result property="parentId" column="parent_id"/>
<result property="typeId" column="type_id"/>
<result property="typeName" column="type_name"/>
<result property="maTypeName" column="ma_type_name"/>
<result property="unitName" column="unit_name"/>
<result property="unitValue" column="unit_value"/>
<result property="storageNum" column="storage_num"/>
<result property="preNum" column="pre_num"/>
<result property="auditNum" column="audit_num"/>
<result property="alNum" column="al_num"/>
<result property="status" column="status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="companyId" column="company_id"/>
</resultMap>
<resultMap type="com.bonus.material.ma.domain.Type" id="TypeResult">
<result property="typeId" column="type_id"/>
<result property="typeName" column="type_name"/>
<result property="parentId" column="parent_id"/>
<result property="keeperNickName" column="keeper_nick_name"/>
<result property="repairNickName" column="repair_nick_name"/>
<result property="houseId" column="house_id"/>
<result property="houseName" column="house_name"/>
<result property="storageNum" column="storage_num"/>
<result property="typeCode" column="type_code"/>
<result property="modelCode" column="model_code"/>
<result property="unitId" column="unit_id"/>
<result property="unitName" column="unit_name"/>
<result property="unitValue" column="unit_value"/>
<result property="sortNum" column="sort_num"/>
<result property="manageType" column="manage_type"/>
<result property="leasePrice" column="lease_price"/>
<result property="effTime" column="eff_time"/>
<result property="rentPrice" column="rent_price"/>
<result property="buyPrice" column="buy_price"/>
<result property="payRatio" column="pay_ratio"/>
<result property="payPrice" column="pay_price"/>
<result property="taxRatio" column="tax_ratio"/>
<result property="level" column="level"/>
<result property="ratedLoad" column="rated_load"/>
<result property="testLoad" column="test_load"/>
<result property="holdingTime" column="holding_time"/>
<result property="warnNum" column="warn_num"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="isPlan" column="is_plan"/>
<result property="isAncuo" column="is_ancuo"/>
<result property="remark" column="remark"/>
<result property="facModel" column="fac_model"/>
<result property="intelligentCode" column="intelligent_code"/>
<result property="isTest" column="is_test"/>
</resultMap>
<sql id="selectLeaseApplyInfoVo">
@ -66,7 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
lai.company_audit_time, lai.company_audit_remark, lai.dept_audit_by, lai.dept_audit_time,
lai.dept_audit_remark, lai.direct_audit_by, lai.direct_audit_time, lai.direct_audit_remark,
lai.create_by, lai.create_time, lai.update_by, lai.update_time, lai.remark, lai.company_id,
lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url, lai.lease_sign_type,
lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url,
lai.lease_sign_type,
bai.unit_id,bai.project_id,bu.unit_name, bp.pro_name, bai.agreement_code, tt.task_status as taskStatus,
sda.dict_label as taskStatusName,
IFNULL(sum(lad.pre_num),0) as preCountNum,
@ -87,9 +129,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and sda.dict_type = 'lease_task_status'
left join ma_type mt on lad.type_id = mt.type_id and mt.del_flag = '0'
left join ma_type mt1 on mt.parent_id = mt1.type_id and mt1.del_flag = '0'
<!-- <if test="userId != null">-->
<!-- JOIN ma_type_keeper mtk ON mtk.type_id = lad.type_id AND mtk.user_id = #{userId}-->
<!-- </if>-->
<!-- <if test="userId != null">-->
<!-- JOIN ma_type_keeper mtk ON mtk.type_id = lad.type_id AND mtk.user_id = #{userId}-->
<!-- </if>-->
</sql>
<sql id="selectLeaseApplyDetailsVo">
@ -123,12 +165,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
WHERE mm.ma_code is not null and mm.ma_status in (1)
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
<!-- <if test="userId != null">-->
<!-- JOIN ma_type_keeper mtk ON mtk.type_id = lad.type_id AND mtk.user_id = #{userId}-->
<!-- </if>-->
<!-- <if test="userId != null">-->
<!-- JOIN ma_type_keeper mtk ON mtk.type_id = lad.type_id AND mtk.user_id = #{userId}-->
<!-- </if>-->
</sql>
<insert id="insertLeaseApplyInfo" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo" useGeneratedKeys="true" keyProperty="id">
<insert id="insertLeaseApplyInfo" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo"
useGeneratedKeys="true" keyProperty="id">
insert into lease_apply_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null">code,</if>
@ -186,7 +229,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<insert id="insertLeaseApplyDetailsList" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<insert id="insertLeaseApplyDetailsList" keyColumn="id" keyProperty="id" parameterType="map"
useGeneratedKeys="true">
insert into lease_apply_details
(parent_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by,
update_time, remark, company_id)
@ -229,24 +273,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<select id="selectLeaseApplyInfoList" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo" resultMap="LeaseApplyInfoResult">
<select id="selectLeaseApplyInfoList" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo"
resultMap="LeaseApplyInfoResult">
<include refid="selectLeaseApplyInfoVo"/>
<where>
<if test="code != null and code != ''"> and lai.code = #{code}</if>
<if test="taskId != null "> and lai.task_id = #{taskId}</if>
<if test="leasePerson != null and leasePerson != ''"> and lai.lease_person = #{leasePerson}</if>
<if test="phone != null and phone != ''"> and lai.phone = #{phone}</if>
<if test="type != null and type != ''"> and lai.type = #{type}</if>
<if test="companyAuditBy != null "> and lai.company_audit_by = #{companyAuditBy}</if>
<if test="companyAuditTime != null "> and lai.company_audit_time = #{companyAuditTime}</if>
<if test="companyAuditRemark != null and companyAuditRemark != ''"> and lai.company_audit_remark = #{companyAuditRemark}</if>
<if test="deptAuditBy != null "> and lai.dept_audit_by = #{deptAuditBy}</if>
<if test="deptAuditTime != null "> and lai.dept_audit_time = #{deptAuditTime}</if>
<if test="deptAuditRemark != null and deptAuditRemark != ''"> and lai.dept_audit_remark = #{deptAuditRemark}</if>
<if test="directAuditBy != null "> and lai.direct_audit_by = #{directAuditBy}</if>
<if test="directAuditTime != null "> and lai.direct_audit_time = #{directAuditTime}</if>
<if test="directAuditRemark != null and directAuditRemark != ''"> and lai.direct_audit_remark = #{directAuditRemark}</if>
<if test="companyId != null "> and lai.company_id = #{companyId}</if>
<if test="code != null and code != ''">and lai.code = #{code}</if>
<if test="taskId != null ">and lai.task_id = #{taskId}</if>
<if test="leasePerson != null and leasePerson != ''">and lai.lease_person = #{leasePerson}</if>
<if test="phone != null and phone != ''">and lai.phone = #{phone}</if>
<if test="type != null and type != ''">and lai.type = #{type}</if>
<if test="companyAuditBy != null ">and lai.company_audit_by = #{companyAuditBy}</if>
<if test="companyAuditTime != null ">and lai.company_audit_time = #{companyAuditTime}</if>
<if test="companyAuditRemark != null and companyAuditRemark != ''">and lai.company_audit_remark =
#{companyAuditRemark}
</if>
<if test="deptAuditBy != null ">and lai.dept_audit_by = #{deptAuditBy}</if>
<if test="deptAuditTime != null ">and lai.dept_audit_time = #{deptAuditTime}</if>
<if test="deptAuditRemark != null and deptAuditRemark != ''">and lai.dept_audit_remark =
#{deptAuditRemark}
</if>
<if test="directAuditBy != null ">and lai.direct_audit_by = #{directAuditBy}</if>
<if test="directAuditTime != null ">and lai.direct_audit_time = #{directAuditTime}</if>
<if test="directAuditRemark != null and directAuditRemark != ''">and lai.direct_audit_remark =
#{directAuditRemark}
</if>
<if test="companyId != null ">and lai.company_id = #{companyId}</if>
<if test="statusList != null and statusList.size() > 0">
and tt.task_status in
<foreach item="item" collection="statusList" open="(" separator="," close=")">
@ -267,30 +318,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
<![CDATA[ AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if>
<if test="directId != null "> and lai.direct_id = #{directId}</if>
<if test="leaseType != null and leaseType != ''"> and lai.lease_type = #{leaseType}</if>
<if test="estimateLeaseTime != null "> and lai.estimate_lease_time = #{estimateLeaseTime}</if>
<if test="costBearingParty != null and costBearingParty != ''"> and lai.cost_bearing_party = #{costBearingParty}</if>
<if test="directId != null ">and lai.direct_id = #{directId}</if>
<if test="leaseType != null and leaseType != ''">and lai.lease_type = #{leaseType}</if>
<if test="estimateLeaseTime != null ">and lai.estimate_lease_time = #{estimateLeaseTime}</if>
<if test="costBearingParty != null and costBearingParty != ''">and lai.cost_bearing_party =
#{costBearingParty}
</if>
and lai.apply_code is not null
</where>
GROUP BY lai.id
ORDER BY tt.task_status,tt.create_time desc
</select>
<select id="selectLeaseApplyDetailsList" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails" resultMap="LeaseApplyDetailsResult">
<select id="selectLeaseApplyDetailsList" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails"
resultMap="LeaseApplyDetailsResult">
<include refid="selectLeaseApplyDetailsVo"/>
<where>
<if test="parentId != null "> and lad.parent_id = #{parentId}</if>
<if test="parentId != null ">and lad.parent_id = #{parentId}</if>
<if test="keyword != null and keyword != ''">
AND (mt.type_name LIKE CONCAT('%', #{keyword}, '%')
OR mt2.type_name LIKE CONCAT('%', #{keyword}, '%'))
</if>
<if test="typeId != null "> and lad.type_id = #{typeId}</if>
<if test="preNum != null "> and lad.pre_num = #{preNum}</if>
<if test="auditNum != null "> and lad.audit_num = #{auditNum}</if>
<if test="alNum != null "> and lad.al_num = #{alNum}</if>
<if test="status != null and status != ''"> and lad.status = #{status}</if>
<if test="companyId != null "> and lad.company_id = #{companyId}</if>
<if test="typeId != null ">and lad.type_id = #{typeId}</if>
<if test="preNum != null ">and lad.pre_num = #{preNum}</if>
<if test="auditNum != null ">and lad.audit_num = #{auditNum}</if>
<if test="alNum != null ">and lad.al_num = #{alNum}</if>
<if test="status != null and status != ''">and lad.status = #{status}</if>
<if test="companyId != null ">and lad.company_id = #{companyId}</if>
</where>
</select>
@ -298,4 +352,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectLeaseApplyInfoVo"/>
where lai.id = #{id}
</select>
<select id="getTypeDataList" resultType="com.bonus.material.ma.domain.Type">
SELECT DISTINCT m.type_id as typeId,
m.type_name as typeName,
m2.type_name as maTypeName,
m.parent_id as parentId,
m.unit_name as unitName,
m.manage_type as manageType,
m.lease_price as leasePrice,
m.LEVEL,
CASE m.manage_type
WHEN 0 THEN
IFNULL(subquery0.num, 0)
ELSE
IFNULL(m.storage_num, 0)
END as storageNum
from ma_type m
LEFT JOIN ma_type m2 on m2.type_id = m.parent_id and m2.del_flag = 0
left join (SELECT mt.type_id,
mt2.type_name AS typeName,
mt.type_name AS typeModelName,
count(mm.ma_id) num
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
WHERE mm.ma_code is not null
and mm.ma_status in (1)
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = m.type_id
where m.del_flag = '0'
and m.parent_id = #{typeId}
</select>
</mapper>

View File

@ -0,0 +1,241 @@
<?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.material.ma.mapper.DirectRotationMapper">
<update id="updateDirectApplyInfo">
update direct_apply_info
set
<if test="backAgreementId != null">
back_agreement_id = #{backAgreementId},
</if>
<if test="backMan != null">
back_man = #{backMan},
</if>
<if test="backPhone != null">
back_phone = #{backPhone},
</if>
<if test="leaseAgreementId != null">
lease_agreement_id = #{leaseAgreementId},
</if>
<if test="leaseMan != null">
lease_man = #{leaseMan},
</if>
<if test="leasePhone != null">
lease_phone = #{leasePhone},
</if>
<if test="dirUrl != null">
dir_url = #{dirUrl},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="auditor != null">
auditor = #{auditor},
</if>
<if test="auditTime != null">
audit_time = #{auditTime},
</if>
update_time= NOW()
where id = #{id}
</update>
<delete id="deleteDirectApplyDetails">
delete
from direct_apply_details
where direct_id = #{id}
</delete>
<delete id="deleteDirectApply">
delete
from direct_apply_info
where id = #{id};
delete
from direct_apply_details
where direct_id = #{id}
</delete>
<select id="getUseringData" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
SELECT
mt2.type_name AS typeName,
mt.type_name AS typeModelName,
mt.unit_name as unitName,
sum( sai.num ) AS useNum ,
mm.ma_code AS maCode,
lai.lease_person as leasePerson,
DATE(sai.start_time) as startTime,
sai.ma_id as maId,
sai.type_id as typeId,
sai.*
FROM
slt_agreement_info sai
LEFT JOIN ma_type mt on sai.type_id = mt.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm on sai.ma_id = mm.ma_id
LEFT JOIN lease_apply_info lai on lai.id=sai.lease_id
where sai.agreement_id = #{agreementId} and sai.status = '0'
<if test="typeId != null">
and sai.type_id = #{typeId}
</if>
<if test="maId != null">
and mt.parent_id = #{maId}
</if>
<if test="keyWord != null and keyWord != ''">
and (mt2.type_name like concat('%', #{keyWord}, '%') or
mt.type_name like concat('%', #{keyWord}, '%'))
</if>
GROUP BY
sai.ma_id,sai.type_id
</select>
<select id="getList" resultType="com.bonus.material.ma.domain.DirectApplyInfo">
SELECT DISTINCT
dai.create_time AS createTime,
su.user_name AS createName,
bui.unit_id AS backUnitId,
bui.unit_name AS backUnitName,
bpl.pro_id AS backProId,
bpl.pro_name AS backProName,
bui1.unit_id AS leaseUnitId,
bui1.unit_name AS leaseUnitName,
bpl1.pro_id AS leaseProId,
bpl1.pro_name AS leaseProName,
GROUP_CONCAT(DISTINCT mt2.type_name) as typeName,
dai.*
FROM
direct_apply_info dai
LEFT JOIN bm_agreement_info bai ON dai.back_agreement_id = bai.agreement_id
LEFT JOIN bm_agreement_info bai1 ON dai.lease_agreement_id = bai1.agreement_id
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
LEFT JOIN bm_project bpl1 ON bpl1.pro_id = bai1.project_id
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
LEFT JOIN bm_unit bui1 ON bui1.unit_id = bai1.unit_id
LEFT JOIN direct_apply_details dad on dad.direct_id=dai.id
LEFT JOIN ma_type mt1 on mt1.type_id=dad.type_id
LEFT JOIN ma_type mt2 on mt2.type_id=mt1.parent_id
left join sys_user su on dai.create_by = su.user_id
<where>
<if test="keyWord != null and keyWord != ''">
and (
bui.unit_name like concat('%', #{keyWord}, '%') or
bpl.pro_name like concat('%', #{keyWord}, '%') or
bui1.unit_name like concat('%', #{keyWord}, '%') or
bpl1.pro_name like concat('%', #{keyWord}, '%'))
</if>
<if test="lotId != null and lotId != ''">
and bpl.pro_id = #{lotId}
</if>
<if test="unitId != null and unitId != ''">
and bui.unit_id = #{unitId}
</if>
<if test="status != null and status != ''">
and dai.status = #{status}
</if>
</where>
GROUP BY dai.id
order by dai.create_time desc
</select>
<select id="getInfoById" resultType="com.bonus.material.ma.domain.DirectApplyInfo">
SELECT
dai.id,
dai.`code`,
bui.unit_id AS backUnitId,
bui.unit_name AS backUnitName,
bpl.pro_id AS backProId,
bpl.pro_name AS backProName,
dai.back_agreement_id AS backAgreementId,
bai.agreement_code AS backAgreementCode,
dai.back_man AS backMan,
dai.back_phone AS backPhone,
bui1.unit_id AS leaseUnitId,
bui1.unit_name AS leaseUnitName,
bpl1.pro_id AS leaseProId,
bpl1.pro_name AS leaseProName,
dai.lease_agreement_id AS leaseAgreementId,
bai1.agreement_code AS leaseAgreementCode,
dai.lease_man AS leaseMan,
dai.lease_phone AS leasePhone,
dai.dir_url AS dirUrl,
dai.`status`
FROM
direct_apply_info dai
LEFT JOIN direct_apply_details dad ON dai.id = dad.direct_id
LEFT JOIN bm_agreement_info bai ON dai.back_agreement_id = bai.agreement_id
LEFT JOIN bm_agreement_info bai1 ON dai.lease_agreement_id = bai1.agreement_id
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
LEFT JOIN bm_project bpl1 ON bpl1.pro_id = bai1.project_id
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
LEFT JOIN bm_unit bui1 ON bui1.unit_id = bai1.unit_id
WHERE
dai.id = #{id}
GROUP BY
dai.id
</select>
<select id="getDetailById" resultType="com.bonus.material.ma.domain.DirectApplyDetails">
SELECT
dad.direct_num AS directNum,
dad.type_id AS typeId,
mt2.type_name AS typeName,
mt.type_name AS typeModelName,
mt.unit_name AS unitName,
sum( sai.num ) AS useNum,
mm.ma_code AS maCode,
mm.ma_id AS maId,
lai.lease_person as leasePerson,
DATE(sai.start_time) as startTime
FROM
direct_apply_info dai
LEFT JOIN direct_apply_details dad ON dai.id = dad.direct_id
LEFT JOIN slt_agreement_info sai ON dai.back_agreement_id = sai.agreement_id
AND sai.type_id = dad.type_id
LEFT JOIN lease_apply_info lai on lai.id=sai.lease_id
LEFT JOIN ma_type mt ON mt.type_id = dad.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm ON dad.ma_id = mm.ma_id
WHERE
dai.id = #{id} AND sai.STATUS = '0'
<if test="typeId != null">
and sai.type_id = #{typeId}
</if>
<if test="maId != null">
and mt.parent_id = #{maId}
</if>
<if test="keyWord != null and keyWord != ''">
and (mt2.type_name like concat('%', #{keyWord}, '%') or
mt.type_name like concat('%', #{keyWord}, '%'))
</if>
GROUP BY
dad.id,
sai.type_id
</select>
<select id="getTypeNameList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
SELECT mt2.type_name AS typeName,
mt.type_name AS typeModelName,
mt.unit_name as unitName,
sum(sai.num) AS useNum,
mm.ma_code AS maCode,
lai.lease_person as leasePerson, DATE (sai.start_time) as startTime, sai.ma_id as maId, sai.type_id as typeId, mt.parent_id as parentId, sai.*
FROM
slt_agreement_info sai
LEFT JOIN ma_type mt
on sai.type_id = mt.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm on sai.ma_id = mm.ma_id
LEFT JOIN lease_apply_info lai on lai.id=sai.lease_id
where sai.agreement_id = #{agreementId} and sai.status = '0'
<if test="parentId != null">
and mt.parent_id=#{parentId}
</if>
<if test="typeId != null">
and sai.type_id=#{typeId}
</if>
<if test="type != null and type==1">
GROUP BY
mt.parent_id
</if>
<if test="type != null and type==2">
GROUP BY
sai.ma_id,sai.type_id
</if>
</select>
</mapper>

View File

@ -891,4 +891,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectLeasePriceByTypeId" resultType="java.math.BigDecimal">
select lease_price from ma_type where type_id = #{typeId}
</select>
<select id="selectMaTypeThreeLists" resultMap="TypeResult">
SELECT m.type_id,
m.type_name,
m.parent_id,
m.manage_type,
m.LEVEL,
m.type_id AS id,
m.type_name AS label
FROM ma_type m
WHERE m.type_id IN (SELECT DISTINCT mt_parent.parent_id
FROM slt_agreement_info sai
INNER JOIN ma_type mt ON mt.type_id = sai.type_id
LEFT JOIN ma_type mt_parent ON (
mt_parent.type_id = mt.type_id OR
mt_parent.type_id = mt.parent_id OR
EXISTS(
SELECT 1
FROM ma_type mt2
WHERE mt2.type_id = mt.parent_id
AND mt_parent.type_id = mt2.parent_id
)
)
WHERE sai.agreement_id = #{agreementId}
AND sai.STATUS = '0')
</select>
</mapper>

View File

@ -43,6 +43,9 @@
</if>
<if test="auditRemark != null and auditRemark != ''">
audit_remark,
</if>
<if test="createBy != null">
create_by,
</if>
create_time
) values (
@ -85,6 +88,9 @@
<if test="auditRemark != null and auditRemark != ''">
#{auditRemark},
</if>
<if test="createBy != null">
#{createBy},
</if>
NOW()
)
</insert>