工地直转管理开发
This commit is contained in:
parent
63eb8b752d
commit
b1e8d1f91a
|
|
@ -42,7 +42,7 @@ public class SelectServiceImpl implements SelectService {
|
|||
return AjaxResult.success(list);
|
||||
}
|
||||
List<ProjectTreeNode> groupList = new ArrayList<>();
|
||||
List<ProjectTreeNode> list = new ArrayList<>();
|
||||
List<ProjectTreeNode> list;
|
||||
try {
|
||||
list = mapper.getUnitList(bmUnit);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
|
|
|
|||
|
|
@ -137,14 +137,14 @@ public class LeaseApplyInfo extends BaseEntity {
|
|||
@Excel(name = "领料工程")
|
||||
private String leaseProject;
|
||||
|
||||
@ApiModelProperty(value = "租赁工程id")
|
||||
@ApiModelProperty(value = "领料工程id")
|
||||
private Integer leaseProjectId;
|
||||
|
||||
@ApiModelProperty(value = "租赁单位")
|
||||
@ApiModelProperty(value = "领料单位")
|
||||
@Excel(name = "领料单位")
|
||||
private String leaseUnit;
|
||||
|
||||
@ApiModelProperty(value = "租赁单位id")
|
||||
@ApiModelProperty(value = "领料id")
|
||||
private Integer leaseUnitId;
|
||||
|
||||
@ApiModelProperty(value = "协议id")
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ 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.DirectPassApplyInfoDetails;
|
||||
import com.bonus.material.ma.service.WorkSiteDirectManageService;
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -90,16 +91,16 @@ public class WorkSiteDirectManageController extends BaseController {
|
|||
return AjaxResult.success("保存成功");
|
||||
}
|
||||
|
||||
// @ApiOperation(value = "通过")
|
||||
// @PostMapping("/pass")
|
||||
// public AjaxResult pass(@RequestBody DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
// int rows = workSiteDirectManageService.passDirectApplyInfoDetails(directApplyInfoDetails);
|
||||
// if (rows == 1) {
|
||||
// return AjaxResult.success("已通过");
|
||||
// } else {
|
||||
// return AjaxResult.error("未通过");
|
||||
// }
|
||||
// }
|
||||
@ApiOperation(value = "通过")
|
||||
@PostMapping("/pass")
|
||||
public AjaxResult pass(@RequestBody DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
int rows = workSiteDirectManageService.passDirectApplyInfoDetails(directApplyInfoDetails);
|
||||
if (rows == 1) {
|
||||
return AjaxResult.success("已通过");
|
||||
} else {
|
||||
return AjaxResult.error("未通过");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -44,5 +44,4 @@ public class DirectApplyDetails extends BaseEntity {
|
|||
private Integer useNum;
|
||||
|
||||
private String companyId;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@ package com.bonus.material.ma.domain;
|
|||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.material.back.domain.BackApplyInfo;
|
||||
import com.bonus.material.back.domain.vo.BackApplyRequestVo;
|
||||
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||
import com.bonus.material.lease.domain.LeaseOutDetails;
|
||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -19,9 +22,11 @@ public class DirectPassApplyInfoDetails extends BaseEntity {
|
|||
|
||||
private String id;
|
||||
|
||||
private TmTask leaseApplyInfo;
|
||||
private TmTask tmTask;
|
||||
|
||||
private BackApplyInfo backApplyInfo;
|
||||
private BackApplyRequestVo backApplyRequestVo;
|
||||
|
||||
private LeaseApplyRequestVo leaseApplyRequestVo;
|
||||
|
||||
private List<LeaseOutDetails> leaseOutDetails;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,21 +32,7 @@ public interface WorkSiteDirectManageService {
|
|||
|
||||
int insertTmTask(TmTask bean);
|
||||
|
||||
// int insertAgreement(TmTask task);
|
||||
|
||||
// int insertApplyInfoAndDetails(TmTask task);
|
||||
//
|
||||
// int insertLeaseOutDetail(List<LeaseOutDetails> leaseOutDetails, TmTask task);
|
||||
//
|
||||
// int insertBackApplyInfoAndDetails(BackApplyInfo backApplyInfo);
|
||||
//
|
||||
// int insertTmTaskByBackInfo(BackApplyInfo backApplyInfo);
|
||||
|
||||
// int insertAgreementByBackInfo(BackApplyInfo backApplyInfo);
|
||||
//
|
||||
// int insertBackCheckDetails(List<BackApplyInfo> backApplyDetails);
|
||||
|
||||
DirectApplyInfo getInfoById(SltAgreementInfo sltAgreementInfo);
|
||||
|
||||
// int passDirectApplyInfoDetails(DirectPassApplyInfoDetails directApplyInfoDetails);
|
||||
int passDirectApplyInfoDetails(DirectPassApplyInfoDetails directApplyInfoDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,17 @@
|
|||
package com.bonus.material.ma.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.back.domain.BackApplyInfo;
|
||||
import com.bonus.material.back.service.IBackApplyInfoService;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||
import com.bonus.material.lease.domain.LeaseOutDetails;
|
||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
||||
import com.bonus.material.ma.domain.DirectApplyDetails;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.ma.domain.DirectPassApplyInfoDetails;
|
||||
|
|
@ -42,6 +47,9 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
@Resource
|
||||
private IBackApplyInfoService backApplyService;
|
||||
|
||||
@Resource
|
||||
private ILeaseApplyInfoService leaseApplyService;
|
||||
|
||||
// @Resource
|
||||
// private BackRecordMapper backRecordMapper;
|
||||
//
|
||||
|
|
@ -324,60 +332,42 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
return directApplyInfo;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public int passDirectApplyInfoDetails(DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
// int res = 0;
|
||||
// try {
|
||||
// // 修改状态为通过
|
||||
// res = updateDirectApplyInfo(directApplyInfoDetails);
|
||||
// if (res == 0) {
|
||||
// throw new RuntimeException("updateDirectApplyInfo异常");
|
||||
// }
|
||||
//
|
||||
// //创建领料信息和详情
|
||||
// res = createLeaseInfo(directApplyInfoDetails);
|
||||
// if (res == 0) {
|
||||
// throw new RuntimeException("createLeaseInfo异常");
|
||||
// }
|
||||
//
|
||||
// //创建退料信息和详情
|
||||
// res = createBackInfo(directApplyInfoDetails);
|
||||
// if (res == 0) {
|
||||
// throw new RuntimeException("createBackInfo异常");
|
||||
// }
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.getMessage());
|
||||
// }
|
||||
// return res;
|
||||
// }
|
||||
//
|
||||
// private int createBackInfo(DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
// int res = 0;
|
||||
// try {
|
||||
// BackApplyInfo backApplyInfo = directApplyInfoDetails.getBackApplyInfo();
|
||||
// // 创建退料任务(1、创建tm_task )
|
||||
// res = createTmTaskByBackInfo(backApplyInfo);
|
||||
// if (res == 0) {
|
||||
// throw new RuntimeException("createBackTmTask异常");
|
||||
// }
|
||||
// //2.创建协议tm_task_agreement
|
||||
// res = createAgreementByBackInfo(backApplyInfo);
|
||||
// if (res == 0) {
|
||||
// throw new RuntimeException("createBackAgreement异常");
|
||||
// }
|
||||
// // 3、创建back_apply_info和back_apply_details和出库记录back_check_details和计算结算数据
|
||||
// res = createtBackApplyInfoAndDetails(backApplyInfo);
|
||||
// if (res == 0) {
|
||||
// throw new RuntimeException("createBackApplyInfoAndDetails异常");
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.getMessage());
|
||||
// }
|
||||
// return res;
|
||||
//
|
||||
// }
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int passDirectApplyInfoDetails(DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
int res;
|
||||
try {
|
||||
// 修改状态为通过
|
||||
if (StringUtils.isNotBlank(directApplyInfoDetails.getId())) {
|
||||
DirectApplyInfo directApplyInfos = getDirectApplyInfoById(directApplyInfoDetails.getId());
|
||||
directApplyInfos.setStatus("1");
|
||||
directApplyInfos.setAuditor(SecurityUtils.getLoginUser().getUsername());
|
||||
directApplyInfos.setAuditTime(DateUtils.getNowDate());
|
||||
res = refuseDirectApplyInfo(directApplyInfos);
|
||||
} else {
|
||||
throw new RuntimeException("updateDirectApplyInfo异常");
|
||||
}
|
||||
|
||||
//创建领料信息和详情
|
||||
AjaxResult createLeaseResult = leaseApplyService.insertLeaseApplyInfo(directApplyInfoDetails.getLeaseApplyRequestVo());
|
||||
if (!createLeaseResult.isSuccess()) {
|
||||
System.err.println(createLeaseResult.get("msg"));
|
||||
throw new RuntimeException("createLeaseInfo异常");
|
||||
}
|
||||
|
||||
//创建退料信息和详情
|
||||
AjaxResult createBackResult = backApplyService.insertBackApplyInfo(directApplyInfoDetails.getBackApplyRequestVo());
|
||||
if (!createBackResult.isSuccess()) {
|
||||
System.err.println(createBackResult.get("msg"));
|
||||
throw new RuntimeException("createBackInfo异常");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
//
|
||||
// private int createtBackApplyInfoAndDetails(BackApplyInfo backApplyInfo) {
|
||||
// int res = 0;
|
||||
|
|
@ -558,47 +548,7 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
|
|||
// return res;
|
||||
// }
|
||||
|
||||
// private int createTmTask(TmTask task, String taskType) {
|
||||
// int taskId = 0;
|
||||
// int res = 0;
|
||||
// try {
|
||||
// if ("1".equals(taskType)) {
|
||||
// // 生成领料code
|
||||
// String lcode = tmTaskService.genderLeaseCode();
|
||||
// if (StringUtils.isEmpty(lcode)) {
|
||||
// return res;
|
||||
// }
|
||||
// task.setCode(lcode);
|
||||
// task.setTaskStatus(35);
|
||||
// // 创建领料任务(tm_task)
|
||||
// res = insertTmTask(task);
|
||||
// if (res == 0) {
|
||||
// throw new RuntimeException("insertTmTask异常");
|
||||
// }
|
||||
// taskId = Integer.valueOf(task.getId());
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error(e.getMessage());
|
||||
// }
|
||||
//
|
||||
// return taskId;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// private int updateDirectApplyInfo(DirectPassApplyInfoDetails directApplyInfoDetails) {
|
||||
// int res = 0;
|
||||
// if (StringUtils.isNotBlank(directApplyInfoDetails.getId())) {
|
||||
// DirectApplyInfo directApplyInfos = getDirectApplyInfoById(directApplyInfoDetails.getId());
|
||||
// directApplyInfos.setStatus("1");
|
||||
// directApplyInfos.setAuditor(SecurityUtils.getLoginUser().getUsername());
|
||||
// directApplyInfos.setAuditTime(DateUtils.getNowDate());
|
||||
// res = refuseDirectApplyInfo(directApplyInfos);
|
||||
// } else {
|
||||
// return res;
|
||||
// }
|
||||
// return res;
|
||||
// }
|
||||
//
|
||||
|
||||
// public int insertBcd(List<BackApplyInfo> backApplyDetails) {
|
||||
// int res = 0;
|
||||
// for (BackApplyInfo backApplyDetail : backApplyDetails) {
|
||||
|
|
|
|||
|
|
@ -169,4 +169,12 @@ public class SltAgreementInfo extends BaseEntity {
|
|||
@ApiModelProperty(value = "结算状态")
|
||||
private String sltStatus;
|
||||
|
||||
private String typeModelName;
|
||||
|
||||
private String maCode;
|
||||
|
||||
private Double useNum;
|
||||
|
||||
private String keyWord;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<!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.WorkSiteDirectManageMapper">
|
||||
<insert id="saveDirectApplyInfo" parameterType="com.bonus.material.ma.domain.DirectApplyInfo" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
|
||||
|
|
@ -329,7 +328,12 @@
|
|||
</insert>
|
||||
|
||||
<update id="refuseDirectApplyInfo">
|
||||
update direct_apply_info set status = #{status},auditor=#{auditor},audit_time=#{auditTime},update_time = now() where id = #{id}
|
||||
update
|
||||
direct_apply_info
|
||||
set
|
||||
status = #{status},auditor=#{auditor},audit_time= now(),update_time = now()
|
||||
where
|
||||
id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateLeaseApplyDetailsOutNum">
|
||||
|
|
@ -417,21 +421,21 @@
|
|||
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
|
||||
1=1
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (bpl.pro_name like concat('%', #{keyWord}, '%') or
|
||||
<where>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (bpl.pro_name like concat('%', #{keyWord}, '%') or
|
||||
bui.unit_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>
|
||||
</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>
|
||||
</select>
|
||||
|
||||
<select id="getDirectApplyInfoById" resultType="com.bonus.material.ma.domain.DirectApplyInfo">
|
||||
|
|
@ -443,15 +447,16 @@
|
|||
from ma_machine
|
||||
where ma_id = #{maId}
|
||||
</select>
|
||||
|
||||
<select id="getListLease" resultType="com.bonus.material.ma.domain.DirectApplyInfo">
|
||||
SELECT DISTINCT
|
||||
bpl.lot_id as backProId,bpl.lot_name as backProName,
|
||||
bpl.pro_id as backProId,bpl.pro_name as backProName,
|
||||
bui.unit_id as backUnitId,bui.unit_name as backUnitName
|
||||
FROM
|
||||
direct_apply_info dai
|
||||
LEFT JOIN bm_agreement_info bai ON dai.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
|
||||
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
|
||||
LEFT JOIN bm_agreement_info bai ON dai.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project bpl ON bpl.lot_id = bai.project_id
|
||||
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
||||
</select>
|
||||
|
||||
<select id="getInfoById" resultType="com.bonus.material.ma.domain.DirectApplyInfo">
|
||||
|
|
@ -459,23 +464,23 @@
|
|||
dai.*,
|
||||
bai.agreement_code as backAgreementCode,
|
||||
bai1.agreement_code as leaseAgreementCode,
|
||||
bpl.lot_id AS backProId,
|
||||
bpl.lot_name AS backProName,
|
||||
bpl.pro_id AS backProId,
|
||||
bpl.pro_name AS backProName,
|
||||
bui.unit_id AS backUnitId,
|
||||
bui.unit_name AS backUnitName,
|
||||
bpl1.lot_id AS leaseProId,
|
||||
bpl1.lot_name AS leaseProName,
|
||||
bpl1.pro_id AS leaseProId,
|
||||
bpl1.pro_name AS leaseProName,
|
||||
bui1.unit_id AS leaseUnitId,
|
||||
bui1.unit_name AS leaseUnitName
|
||||
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_lot bpl ON bpl.lot_id = bai.project_id
|
||||
LEFT JOIN bm_project_lot bpl1 ON bpl1.lot_id = bai1.project_id
|
||||
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
|
||||
LEFT JOIN bm_unit_info bui1 ON bui1.unit_id = bai1.unit_id
|
||||
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>
|
||||
|
|
@ -484,7 +489,6 @@
|
|||
SELECT
|
||||
dad.direct_num AS directNum,
|
||||
dad.type_id AS typeId,
|
||||
mt.company_id AS companyId,
|
||||
mt3.type_name AS typeName,
|
||||
mt2.type_name AS kindName,
|
||||
mt.type_name AS modelName,
|
||||
|
|
@ -494,16 +498,14 @@
|
|||
mm.ma_id AS maId
|
||||
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 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_type mt3 ON mt2.parent_id = mt3.type_id
|
||||
LEFT JOIN ma_machine mm ON dad.ma_id = mm.ma_id
|
||||
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 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_type mt3 ON mt2.parent_id = mt3.type_id
|
||||
LEFT JOIN ma_machine mm ON dad.ma_id = mm.ma_id
|
||||
WHERE
|
||||
dai.id = #{id}
|
||||
AND sai.STATUS = '0'
|
||||
dai.id = #{id} AND sai.STATUS = '0'
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||
mt.type_name like concat('%', #{keyWord}, '%'))
|
||||
|
|
@ -515,22 +517,22 @@
|
|||
<select id="getListAll" resultType="com.bonus.material.ma.domain.DirectApplyInfo">
|
||||
SELECT
|
||||
dai.*,
|
||||
bpl.lot_id AS backProId,
|
||||
bpl.lot_name AS backProName,
|
||||
bpl.pro_id AS backProId,
|
||||
bpl.pro_name AS backProName,
|
||||
bui.unit_id AS backUnitId,
|
||||
bui.unit_name AS backUnitName,
|
||||
bpl1.lot_id AS leaseProId,
|
||||
bpl1.lot_name AS leaseProName,
|
||||
bpl1.pro_id AS leaseProId,
|
||||
bpl1.pro_name AS leaseProName,
|
||||
bui1.unit_id AS leaseUnitId,
|
||||
bui1.unit_name AS leaseUnitName
|
||||
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_lot bpl ON bpl.lot_id = bai.project_id
|
||||
LEFT JOIN bm_project_lot bpl1 ON bpl1.lot_id = bai1.project_id
|
||||
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
|
||||
LEFT JOIN bm_unit_info bui1 ON bui1.unit_id = bai1.unit_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
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -243,7 +243,7 @@
|
|||
LEFT JOIN tm_task_agreement tta ON rd.task_id = tta.task_id
|
||||
LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id
|
||||
LEFT JOIN bm_unit_info bui ON bai2.unit_id = bui.unit_id
|
||||
LEFT JOIN bm_project_lot bpi ON bai2.project_id = bpi.lot_id AND bpi.STATUS = '0' AND bpi.del_flag = '0'
|
||||
LEFT JOIN bm_project bpi ON bai2.project_id = bpi.lot_id AND bpi.STATUS = '0' AND bpi.del_flag = '0'
|
||||
LEFT JOIN sys_user su ON rd.create_by = su.user_id
|
||||
left join sys_user su2 on rd.repairer = su2.user_id
|
||||
LEFT JOIN ma_machine mm ON mm.ma_id = rd.ma_id
|
||||
|
|
|
|||
|
|
@ -356,21 +356,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="getRelations" resultType="com.bonus.material.settlement.domain.SltAgreementRelation">
|
||||
select sar.id,
|
||||
bui.unit_name as unitName,
|
||||
bp.lot_name as projectName,
|
||||
bp.pro_name as projectName,
|
||||
sar.apply_id as applyId,
|
||||
sar.agreement_id as agreementId,
|
||||
sar.add_cost as addCost,
|
||||
sar.sub_cost as subCost,
|
||||
sar.remark as remark,
|
||||
sar.cost as cost,
|
||||
sar.lease_cost as leaseCost,
|
||||
0 as leaseCost,
|
||||
sar.repair_cost as repairCost,
|
||||
sar.scrap_cost as scrapCost,
|
||||
sar.lose_cost as loseCost
|
||||
from slt_agreement_relation sar
|
||||
LEFT JOIN bm_agreement_info bai on sar.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id
|
||||
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
|
||||
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
|
||||
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
||||
where sar.apply_id = #{id}
|
||||
</select>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue