领料接口优化
This commit is contained in:
parent
3db75704c5
commit
e18a20bf1b
|
|
@ -127,25 +127,25 @@ public class TmTaskController extends BaseController {
|
|||
* @param souceBy app为1 web为0
|
||||
* @return 列表
|
||||
*/
|
||||
@ApiOperation(value = "查询机具领料申请列表")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("task:task:query")
|
||||
@SysLog(title = "任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->查询机具领料申请列表")
|
||||
@GetMapping(value = "getLeaseAuditListAll")
|
||||
public AjaxResult getLeaseAuditListAll(TmTaskRequestVo task, Integer souceBy) {
|
||||
if (StringUtils.isNull(task)) {
|
||||
return AjaxResult.error("参数错误");
|
||||
}
|
||||
List<TmTaskRequestVo> leaseAuditList;
|
||||
if (souceBy != null && souceBy == 1) {
|
||||
leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||
return AjaxResult.success(leaseAuditList);
|
||||
} else {
|
||||
startPage();
|
||||
leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||
return AjaxResult.success(getDataTable(leaseAuditList));
|
||||
}
|
||||
}
|
||||
// @ApiOperation(value = "查询机具领料申请列表")
|
||||
// @PreventRepeatSubmit
|
||||
// @RequiresPermissions("task:task:query")
|
||||
// @SysLog(title = "任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->查询机具领料申请列表")
|
||||
// @GetMapping(value = "getLeaseAuditListAll")
|
||||
// public AjaxResult getLeaseAuditListAll(TmTaskRequestVo task, Integer souceBy) {
|
||||
// if (StringUtils.isNull(task)) {
|
||||
// return AjaxResult.error("参数错误");
|
||||
// }
|
||||
// List<TmTaskRequestVo> leaseAuditList;
|
||||
// if (souceBy != null && souceBy == 1) {
|
||||
// leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||
// return AjaxResult.success(leaseAuditList);
|
||||
// } else {
|
||||
// startPage();
|
||||
// leaseAuditList = tmTaskService.getLeaseAuditList(task);
|
||||
// return AjaxResult.success(getDataTable(leaseAuditList));
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,12 +89,6 @@ public class TmTaskRequestVo extends BaseEntity {
|
|||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
/**
|
||||
* 领料任务实体集合
|
||||
*/
|
||||
@ApiModelProperty(value = "领料任务实体集合")
|
||||
private List<LeaseApplyInfo> leaseApplyInfoList;
|
||||
|
||||
@ApiModelProperty(value = "领料任务汇总")
|
||||
private LeaseApplyInfo leaseApplyInfo;
|
||||
|
||||
|
|
|
|||
|
|
@ -89,11 +89,11 @@ public interface TmTaskMapper {
|
|||
|
||||
int deleteTmTaskByPurchaseIds(Long[] ids);
|
||||
|
||||
List<TmTaskRequestVo> getAuditListByLeaseTmTask(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
||||
|
||||
List<TmTaskRequestVo> getAuditListByLeaseTmTaskByPeople(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
||||
|
||||
List<LeaseApplyInfo> getAuditListByLeaseInfo(@Param("record") TmTaskRequestVo record);
|
||||
|
||||
List<LeaseApplyDetails> getLeaseApplyDetails(@Param("record") LeaseApplyInfo record);
|
||||
// List<TmTaskRequestVo> getAuditListByLeaseTmTask(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
||||
//
|
||||
// List<TmTaskRequestVo> getAuditListByLeaseTmTaskByPeople(@Param("record") TmTaskRequestVo tmTaskRequestVo);
|
||||
//
|
||||
// List<LeaseApplyInfo> getAuditListByLeaseInfo(@Param("record") TmTaskRequestVo record);
|
||||
//
|
||||
// List<LeaseApplyDetails> getLeaseApplyDetails(@Param("record") LeaseApplyInfo record);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,5 +59,7 @@ public interface ITmTaskService {
|
|||
*/
|
||||
public int deleteTmTaskByTaskId(Long taskId);
|
||||
|
||||
List<TmTaskRequestVo> getLeaseAuditList(TmTaskRequestVo tmTask);
|
||||
// List<TmTaskRequestVo> getLeaseAuditList(TmTaskRequestVo tmTask);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,49 +106,50 @@ public class TmTaskServiceImpl implements ITmTaskService {
|
|||
/**
|
||||
* 获取单个申请列表
|
||||
*/
|
||||
@Override
|
||||
public List<TmTaskRequestVo> getLeaseAuditList(TmTaskRequestVo tmTaskRequestVo) {
|
||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
List<TmTaskRequestVo> tmTaskList;
|
||||
if (roles.contains(MaterialConstants.STRING_ADMIN)) {
|
||||
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTask(tmTaskRequestVo);
|
||||
} else {
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
tmTaskRequestVo.setCreateBy(username);
|
||||
tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(tmTaskRequestVo);
|
||||
}
|
||||
for (TmTaskRequestVo tmTask : tmTaskList) {
|
||||
int count = 0;
|
||||
if (tmTask != null) {
|
||||
// 去查询任务分单表
|
||||
List<LeaseApplyInfo> auditListByLeaseInfo = tmTaskMapper.getAuditListByLeaseInfo(tmTask);
|
||||
if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
||||
// 对领料任务集合查询具体详情
|
||||
for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) {
|
||||
if (leaseApplyInfo != null) {
|
||||
// 去查询领料任务详情表
|
||||
List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyDetails(leaseApplyInfo);
|
||||
if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) {
|
||||
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
|
||||
if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) {
|
||||
// 统计预领数量
|
||||
count += leaseApplyDetail.getPreNum();
|
||||
}
|
||||
}
|
||||
// 塞入领料任务详情的集合中
|
||||
leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 存入领料任务实体集合
|
||||
tmTask.setLeaseApplyInfoList(auditListByLeaseInfo);
|
||||
tmTask.setRemark(auditListByLeaseInfo.get(0).getRemark());
|
||||
}
|
||||
// 塞入预领的合计数量
|
||||
tmTask.setPreCountNum(count);
|
||||
}
|
||||
}
|
||||
// @Override
|
||||
// public List<TmTaskRequestVo> getLeaseAuditList(TmTaskRequestVo tmTaskRequestVo) {
|
||||
// Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||
// List<TmTaskRequestVo> tmTaskList;
|
||||
// if (roles.contains(MaterialConstants.STRING_ADMIN)) {
|
||||
// tmTaskList = tmTaskMapper.getAuditListByLeaseTmTask(tmTaskRequestVo);
|
||||
// } else {
|
||||
// String username = SecurityUtils.getLoginUser().getUsername();
|
||||
// tmTaskRequestVo.setCreateBy(username);
|
||||
// tmTaskList = tmTaskMapper.getAuditListByLeaseTmTaskByPeople(tmTaskRequestVo);
|
||||
// }
|
||||
// for (TmTaskRequestVo tmTask : tmTaskList) {
|
||||
// int count = 0;
|
||||
// if (tmTask != null) {
|
||||
// // 去查询任务分单表
|
||||
// List<LeaseApplyInfo> auditListByLeaseInfo = tmTaskMapper.getAuditListByLeaseInfo(tmTask);
|
||||
// if (auditListByLeaseInfo != null && !auditListByLeaseInfo.isEmpty()) {
|
||||
// // 对领料任务集合查询具体详情
|
||||
// for (LeaseApplyInfo leaseApplyInfo : auditListByLeaseInfo) {
|
||||
// if (leaseApplyInfo != null) {
|
||||
// // 去查询领料任务详情表
|
||||
// List<LeaseApplyDetails> leaseApplyDetails = tmTaskMapper.getLeaseApplyDetails(leaseApplyInfo);
|
||||
// if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) {
|
||||
// for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
|
||||
// if (leaseApplyDetail != null && leaseApplyDetail.getPreNum() != null) {
|
||||
// // 统计预领数量
|
||||
// count += leaseApplyDetail.getPreNum();
|
||||
// }
|
||||
// }
|
||||
// // 塞入领料任务详情的集合中
|
||||
// leaseApplyInfo.setLeaseApplyDetails(leaseApplyDetails);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // 存入领料任务实体集合
|
||||
// tmTask.setLeaseApplyInfoList(auditListByLeaseInfo);
|
||||
// tmTask.setRemark(auditListByLeaseInfo.get(0).getRemark());
|
||||
// }
|
||||
// // 塞入预领的合计数量
|
||||
// tmTask.setPreCountNum(count);
|
||||
// }
|
||||
// }
|
||||
// return tmTaskList;
|
||||
// }
|
||||
|
||||
|
||||
return tmTaskList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,130 +129,120 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</delete>
|
||||
|
||||
<select id="getAuditListByLeaseTmTask" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">
|
||||
SELECT DISTINCT
|
||||
tt.task_id as taskId, tt.task_type as taskType, tt.task_status as taskStatus, tt.status, tt.code,
|
||||
su.phonenumber AS phoneNumber, sd.dept_name as deptName,
|
||||
bpl.pro_id as proId,bpl.pro_name as projectName,
|
||||
bui.unit_id as unitId,bui.unit_name as unitName,
|
||||
lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,
|
||||
lai.lease_type as leaseType,lai.estimate_lease_time as estimateLeaseTime,
|
||||
bai.agreement_code as agreementCode,
|
||||
tt.create_time as createTimes, tt.update_time as updateTimes
|
||||
FROM
|
||||
tm_task tt
|
||||
LEFT JOIN sys_user su ON tt.create_by = su.user_name
|
||||
LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id
|
||||
LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id
|
||||
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
|
||||
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
|
||||
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
||||
LEFT JOIN lease_apply_info lai ON lai.task_id = tt.task_id
|
||||
WHERE
|
||||
tt.task_type = 2 and tt.status = '1'
|
||||
<if test="record.taskId != null and record.taskId != '' ">
|
||||
AND tt.task_id = #{record.taskId}
|
||||
</if>
|
||||
<!-- <select id="getAuditListByLeaseTmTask" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">-->
|
||||
<!-- SELECT DISTINCT-->
|
||||
<!-- tt.task_id as taskId, tt.task_type as taskType, tt.task_status as taskStatus, tt.status, tt.code,-->
|
||||
<!-- su.phonenumber AS phoneNumber, sd.dept_name as deptName,-->
|
||||
<!-- bpl.pro_id as proId,bpl.pro_name as projectName,-->
|
||||
<!-- bui.unit_id as unitId,bui.unit_name as unitName,-->
|
||||
<!-- lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,-->
|
||||
<!-- lai.lease_type as leaseType,lai.estimate_lease_time as estimateLeaseTime,-->
|
||||
<!-- bai.agreement_code as agreementCode,-->
|
||||
<!-- tt.create_time as createTimes, tt.update_time as updateTimes-->
|
||||
<!-- FROM-->
|
||||
<!-- tm_task tt-->
|
||||
<!-- LEFT JOIN sys_user su ON tt.create_by = su.user_name-->
|
||||
<!-- LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id-->
|
||||
<!-- LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id-->
|
||||
<!-- LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id-->
|
||||
<!-- LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id-->
|
||||
<!-- LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id-->
|
||||
<!-- LEFT JOIN lease_apply_info lai ON lai.task_id = tt.task_id-->
|
||||
<!-- WHERE-->
|
||||
<!-- tt.task_type = 2 and tt.status = '1'-->
|
||||
<!-- <if test="record.taskId != null and record.taskId != '' ">-->
|
||||
<!-- AND tt.task_id = #{record.taskId}-->
|
||||
<!-- </if>-->
|
||||
|
||||
<if test="record.startTime != null and record.startTime != '' and record.endTime != null and record.endTime != '' ">
|
||||
AND tt.update_time BETWEEN CONCAT(#{record.startTime}, ' 00:00:00') AND CONCAT(#{record.endTime}, ' 23:59:59')
|
||||
</if>
|
||||
<!-- <if test="record.startTime != null and record.startTime != '' and record.endTime != null and record.endTime != '' ">-->
|
||||
<!-- AND tt.update_time BETWEEN CONCAT(#{record.startTime}, ' 00:00:00') AND CONCAT(#{record.endTime}, ' 23:59:59')-->
|
||||
<!-- </if>-->
|
||||
|
||||
<if test="record.unitId != null and record.unitId != ''">
|
||||
AND bui.unit_id = #{record.unitId}
|
||||
</if>
|
||||
<!-- <if test="record.unitId != null and record.unitId != ''">-->
|
||||
<!-- AND bui.unit_id = #{record.unitId}-->
|
||||
<!-- </if>-->
|
||||
|
||||
<if test="record.projectId != null and record.projectId != ''">
|
||||
AND bpl.pro_id = #{record.projectId}
|
||||
</if>
|
||||
<!-- <if test="record.projectId != null and record.projectId != ''">-->
|
||||
<!-- AND bpl.pro_id = #{record.projectId}-->
|
||||
<!-- </if>-->
|
||||
|
||||
<if test="record.keyWord != null and record.keyWord != ''">
|
||||
AND (bai.agreement_code like concat('%', #{record.keyWord}, '%') or
|
||||
tt.code like concat('%', #{record.keyWord}, '%'))
|
||||
</if>
|
||||
GROUP BY tt.task_id
|
||||
ORDER BY tt.update_time DESC
|
||||
</select>
|
||||
<!-- <if test="record.keyWord != null and record.keyWord != ''">-->
|
||||
<!-- AND (bai.agreement_code like concat('%', #{record.keyWord}, '%') or-->
|
||||
<!-- tt.code like concat('%', #{record.keyWord}, '%'))-->
|
||||
<!-- </if>-->
|
||||
<!-- GROUP BY tt.task_id-->
|
||||
<!-- ORDER BY tt.update_time DESC-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="getAuditListByLeaseTmTaskByPeople" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">
|
||||
SELECT DISTINCT
|
||||
tt.*, su.phonenumber AS phoneNumber, sd.dept_name as deptName,
|
||||
bpl.pro_id as proId,bpl.pro_name as projectName,
|
||||
bui.unit_id as unitId,bui.unit_name as unitName,
|
||||
lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,
|
||||
-- d.`name` as taskName,
|
||||
lai.lease_type as leaseType,lai.estimate_lease_time as estimateLeaseTime,
|
||||
-- case when d.id = '31' then lai.company_audit_remark
|
||||
-- when d.id = '32' then lai.dept_audit_remark
|
||||
-- when d.id = '33' then lai.direct_audit_remark
|
||||
-- when d.id = '98' then lai.company_audit_remark
|
||||
-- when d.id = '99' then lai.dept_audit_remark
|
||||
-- when d.id = '100' then lai.direct_audit_remark
|
||||
-- end examineStatus ,
|
||||
-- d.id as examineStatusId,
|
||||
bai.agreement_code as agreementCode,
|
||||
tt.create_time as createTimes, tt.update_time as updateTimes
|
||||
FROM
|
||||
tm_task tt
|
||||
LEFT JOIN sys_user su ON tt.create_by = su.user_name
|
||||
LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id
|
||||
LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id
|
||||
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
|
||||
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
|
||||
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
|
||||
LEFT JOIN lease_apply_info lai ON lai.task_id = tt.task_id
|
||||
-- LEFT JOIN sys_dic d ON d.id = tt.task_status
|
||||
WHERE
|
||||
tt.task_type = 2 and tt.status = '1' and tt.create_by = #{record.createBy}
|
||||
<if test="record.taskId != null and record.taskId != '' ">
|
||||
AND tt.task_id = #{record.taskId}
|
||||
</if>
|
||||
<!-- <select id="getAuditListByLeaseTmTaskByPeople" resultType="com.bonus.material.task.domain.vo.TmTaskRequestVo">-->
|
||||
<!-- SELECT DISTINCT-->
|
||||
<!-- tt.*, su.phonenumber AS phoneNumber, sd.dept_name as deptName,-->
|
||||
<!-- bpl.pro_id as proId,bpl.pro_name as projectName,-->
|
||||
<!-- bui.unit_id as unitId,bui.unit_name as unitName,-->
|
||||
<!-- lai.lease_person as leasePerson, lai.phone as leasePhone, tt.create_by as applyFor,-->
|
||||
<!-- lai.lease_type as leaseType,lai.estimate_lease_time as estimateLeaseTime,-->
|
||||
<!-- bai.agreement_code as agreementCode,-->
|
||||
<!-- tt.create_time as createTimes, tt.update_time as updateTimes-->
|
||||
<!-- FROM-->
|
||||
<!-- tm_task tt-->
|
||||
<!-- LEFT JOIN sys_user su ON tt.create_by = su.user_name-->
|
||||
<!-- LEFT JOIN sys_dept sd ON su.dept_id = sd.dept_id-->
|
||||
<!-- LEFT JOIN tm_task_agreement tta ON tt.task_id = tta.task_id-->
|
||||
<!-- LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id-->
|
||||
<!-- LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id-->
|
||||
<!-- LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id-->
|
||||
<!-- LEFT JOIN lease_apply_info lai ON lai.task_id = tt.task_id-->
|
||||
<!-- WHERE-->
|
||||
<!-- tt.task_type = 2 and tt.status = '1' and tt.create_by = #{record.createBy}-->
|
||||
<!-- <if test="record.taskId != null and record.taskId != '' ">-->
|
||||
<!-- AND tt.task_id = #{record.taskId}-->
|
||||
<!-- </if>-->
|
||||
|
||||
<if test="record.startTime != null and record.startTime != '' and record.endTime != null and record.endTime != '' ">
|
||||
AND tt.update_time BETWEEN CONCAT(#{record.startTime}, ' 00:00:00') AND CONCAT(#{record.endTime}, ' 23:59:59')
|
||||
</if>
|
||||
<!-- <if test="record.startTime != null and record.startTime != '' and record.endTime != null and record.endTime != '' ">-->
|
||||
<!-- AND tt.update_time BETWEEN CONCAT(#{record.startTime}, ' 00:00:00') AND CONCAT(#{record.endTime}, ' 23:59:59')-->
|
||||
<!-- </if>-->
|
||||
|
||||
<if test="record.unitId != null and record.unitId != ''">
|
||||
AND bui.unit_id = #{record.unitId}
|
||||
</if>
|
||||
<!-- <if test="record.unitId != null and record.unitId != ''">-->
|
||||
<!-- AND bui.unit_id = #{record.unitId}-->
|
||||
<!-- </if>-->
|
||||
|
||||
<if test="record.projectId != null and record.projectId != ''">
|
||||
AND bpl.pro_id = #{record.projectId}
|
||||
</if>
|
||||
<!-- <if test="record.projectId != null and record.projectId != ''">-->
|
||||
<!-- AND bpl.pro_id = #{record.projectId}-->
|
||||
<!-- </if>-->
|
||||
|
||||
<if test="record.keyWord != null and record.keyWord != ''">
|
||||
AND (bai.agreement_code like concat('%', #{record.keyWord}, '%') or
|
||||
tt.code like concat('%', #{record.keyWord}, '%'))
|
||||
</if>
|
||||
GROUP BY tt.task_id
|
||||
ORDER BY tt.update_time DESC
|
||||
</select>
|
||||
<!-- <if test="record.keyWord != null and record.keyWord != ''">-->
|
||||
<!-- AND (bai.agreement_code like concat('%', #{record.keyWord}, '%') or-->
|
||||
<!-- tt.code like concat('%', #{record.keyWord}, '%'))-->
|
||||
<!-- </if>-->
|
||||
<!-- GROUP BY tt.task_id-->
|
||||
<!-- ORDER BY tt.update_time DESC-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="getAuditListByLeaseInfo" resultType="com.bonus.material.lease.domain.LeaseApplyInfo">
|
||||
SELECT
|
||||
lai.id, lai.code, lai.task_id as taskId, lai.lease_person as leasePerson, lai.phone, lai.type,
|
||||
lai.create_by as createBy, lai.create_time as createTime, lai.remark, lai.company_id as companyId,
|
||||
lai.status, lai.direct_id as directId, lai.lease_type as leaseType, lai.estimate_lease_time as estimateLeaseTime,
|
||||
lai.cost_bearing_party as costBearingParty
|
||||
FROM
|
||||
lease_apply_info lai
|
||||
WHERE
|
||||
lai.task_id = #{record.taskId} AND lai.`code` = #{record.code}
|
||||
</select>
|
||||
<!-- <select id="getAuditListByLeaseInfo" resultType="com.bonus.material.lease.domain.LeaseApplyInfo">-->
|
||||
<!-- SELECT-->
|
||||
<!-- lai.id, lai.code, lai.task_id as taskId, lai.lease_person as leasePerson, lai.phone, lai.type,-->
|
||||
<!-- lai.create_by as createBy, lai.create_time as createTime, lai.remark, lai.company_id as companyId,-->
|
||||
<!-- lai.status, lai.direct_id as directId, lai.lease_type as leaseType, lai.estimate_lease_time as estimateLeaseTime,-->
|
||||
<!-- lai.cost_bearing_party as costBearingParty-->
|
||||
<!-- FROM-->
|
||||
<!-- lease_apply_info lai-->
|
||||
<!-- WHERE-->
|
||||
<!-- lai.task_id = #{record.taskId} AND lai.`code` = #{record.code}-->
|
||||
<!-- </select>-->
|
||||
|
||||
<select id="getLeaseApplyDetails" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||
SELECT
|
||||
lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType,
|
||||
case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,
|
||||
mt.storage_num, (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,mm.ma_code as maCode
|
||||
FROM
|
||||
lease_apply_details lad
|
||||
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN ma_machine mm ON lad.type_id = mm.type_id
|
||||
WHERE
|
||||
lad.parent_id = #{record.taskId}
|
||||
GROUP BY
|
||||
lad.id
|
||||
</select>
|
||||
<!-- <select id="getLeaseApplyDetails" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">-->
|
||||
<!-- SELECT-->
|
||||
<!-- lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType,-->
|
||||
<!-- case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,-->
|
||||
<!-- mt.storage_num, (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,mm.ma_code as maCode-->
|
||||
<!-- FROM-->
|
||||
<!-- lease_apply_details lad-->
|
||||
<!-- LEFT JOIN ma_type mt ON lad.type_id = mt.type_id-->
|
||||
<!-- LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id-->
|
||||
<!-- LEFT JOIN ma_machine mm ON lad.type_id = mm.type_id-->
|
||||
<!-- WHERE-->
|
||||
<!-- lad.parent_id = #{record.taskId}-->
|
||||
<!-- GROUP BY-->
|
||||
<!-- lad.id-->
|
||||
<!-- </select>-->
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue