Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f6bdfe2af9
|
|
@ -318,4 +318,9 @@ public class LeaseApplyInfo extends BaseEntity{
|
|||
private String ids;
|
||||
|
||||
private Long leaseSignId;
|
||||
|
||||
private List<Long> typeIdList;
|
||||
|
||||
@ApiModelProperty(value = "一级类型id")
|
||||
private Long firstId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,12 @@ import com.bonus.common.core.utils.ServletUtils;
|
|||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.basic.domain.*;
|
||||
import com.bonus.material.basic.domain.vo.MaTypeSelectInfo;
|
||||
import com.bonus.material.basic.service.ComplexQueryService;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.api.model.LoginUser;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -39,6 +42,8 @@ public class ComplexQueryController extends BaseController {
|
|||
@GetMapping("/getRetainedEquipmentList")
|
||||
public AjaxResult getRetainedEquipmentList(RetainedEquipmentInfo bean) {
|
||||
bean.setIsExport(1);
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
bean.setUserId(loginUser.getUserid());
|
||||
if (bean.getIsApp() != null && bean.getIsApp() == 1) {
|
||||
List<RetainedEquipmentInfo> pageList = complexQueryService.getRetainedEquipmentList(bean);
|
||||
return AjaxResult.success(pageList);
|
||||
|
|
@ -284,6 +289,8 @@ public class ComplexQueryController extends BaseController {
|
|||
@ApiOperation(value = "综合查询--工程机具使用列表")
|
||||
@GetMapping("/getProjUsingRecordList")
|
||||
public AjaxResult getProjUsingRecordList(ProjUsingRecord bean) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
bean.setUserId(loginUser.getUserid());
|
||||
startPage();
|
||||
List<ProjUsingRecord> pageList = complexQueryService.getProjUsingRecordList(bean);
|
||||
return AjaxResult.success(getDataTable(pageList));
|
||||
|
|
|
|||
|
|
@ -113,4 +113,6 @@ public class ProjUsingRecord {
|
|||
private String externalIds;
|
||||
@ApiModelProperty(value = "关联外部(第三方)的工程ID")
|
||||
private String externalId;
|
||||
|
||||
private Long userId;
|
||||
}
|
||||
|
|
@ -157,4 +157,6 @@ public class RetainedEquipmentInfo {
|
|||
@ApiModelProperty(value = "三级类型id")
|
||||
private Integer thirdTypeId;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
}
|
||||
|
|
@ -16,6 +16,7 @@ import com.bonus.material.clz.service.BmTeamService;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
|
@ -135,7 +136,10 @@ public class BmTeamServiceImpl implements BmTeamService {
|
|||
// 根据i8工程id查询班组信息
|
||||
List<String> ids = Collections.singletonList(tbTeam.getProjectId());
|
||||
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids);
|
||||
return AjaxResult.success(iwsTeamUserVos);
|
||||
if (CollectionUtil.isNotEmpty(iwsTeamUserVos)) {
|
||||
return AjaxResult.success(iwsTeamUserVos);
|
||||
}
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -177,6 +177,17 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
@Override
|
||||
public List<MaterialRetainedEquipmentInfo> getRetainedEquipmentList(MaterialRetainedEquipmentInfo bean) {
|
||||
String username = SecurityUtils.getLoginUser().getUsername();
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
if (teamData == null) {
|
||||
// 根据用户名查询项目部信息
|
||||
String departId = mapper.getDepartId(username);
|
||||
// 根据项目部id查询工程信息
|
||||
List<String> projectIdList = mapper.getProjectId(departId);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(projectIdList)) {
|
||||
bean.setProjectIdList(projectIdList);
|
||||
}
|
||||
}
|
||||
BigDecimal totalPrice = BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP);
|
||||
BigDecimal totalStoreNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal totalUsNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
|
|
@ -184,14 +195,11 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
|
|||
BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal totalRepairInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal totalAllNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
List<MaterialRetainedEquipmentInfo> recordList = materialMachineMapper.getRetainedEquipmentList(bean);
|
||||
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
|
||||
if (!CollectionUtils.isEmpty(recordList) && deptId != null) {
|
||||
// 删除元素
|
||||
recordList.removeIf(m -> !deptId.toString().equals(m.getImpUnit()));
|
||||
if (deptId != null) {
|
||||
bean.setImpUnit(deptId.toString());
|
||||
}
|
||||
// 根据用户名判断用户是否为班组长
|
||||
BmTeam teamData = materialMachineMapper.getTeamData(username);
|
||||
List<MaterialRetainedEquipmentInfo> recordList = materialMachineMapper.getRetainedEquipmentList(bean);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(recordList)) {
|
||||
if (teamData != null) {
|
||||
// 将sortedList中班组身份证号与username相同的元素过滤处理
|
||||
|
|
|
|||
|
|
@ -179,6 +179,11 @@ public class LeaseApplyDetails extends BaseEntity {
|
|||
|
||||
private String leaseSignId;
|
||||
|
||||
@ApiModelProperty(value = "一级类型id")
|
||||
private Long firstId;
|
||||
|
||||
private List<Long> typeIdList;
|
||||
|
||||
@ApiModelProperty(value = "领料物资名称汇总")
|
||||
private String maTypeNames;
|
||||
public LeaseApplyDetails(Long id, Long parentId, Long typeId, BigDecimal preNum, BigDecimal auditNum, BigDecimal alNum, String status, Long companyId) {
|
||||
|
|
@ -194,9 +199,10 @@ public class LeaseApplyDetails extends BaseEntity {
|
|||
|
||||
public LeaseApplyDetails() {}
|
||||
|
||||
public LeaseApplyDetails(Long parentId, String keyword, Long userId) {
|
||||
public LeaseApplyDetails(Long parentId, String keyword, Long userId, List<Long> typeIdList) {
|
||||
this.parentId = parentId;
|
||||
this.keyword = keyword;
|
||||
this.userId = userId;
|
||||
this.typeIdList = typeIdList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,8 @@ public interface LeaseApplyDetailsMapper {
|
|||
* @param publishTask
|
||||
* @return
|
||||
*/
|
||||
List<LeaseApplyDetails> getDetailsPublish(@Param("keyWord") String keyWord, @Param("publishTask") String publishTask);
|
||||
List<LeaseApplyDetails> getDetailsPublish(@Param("keyWord") String keyWord, @Param("publishTask") String publishTask,
|
||||
@Param("list") List<Long> typeIdList);
|
||||
|
||||
/**
|
||||
* 根据领料任务id查询领料任务详细
|
||||
|
|
|
|||
|
|
@ -134,4 +134,11 @@ public interface LeaseApplyInfoMapper {
|
|||
List<LeaseApplyDetails> getDetailsLeaseList(LeaseApplyDetails bean);
|
||||
|
||||
LeaseConfirmSign getLeaseConfirmSign(LeaseApplyDetails bean);
|
||||
|
||||
/**
|
||||
* 首先根据用户名去ma_type_manage表查询是否存在绑定物资信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<Long> selectTypeIdList(Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,13 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
LeaseApplyInfo leaseApplyInfo = new LeaseApplyInfo();
|
||||
leaseApplyInfo.setId(id);
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
leaseApplyInfo.setUserId(userId);
|
||||
// 首先根据用户名去ma_type_manage表查询是否存在绑定物资信息
|
||||
List<Long> typeIdList = leaseApplyInfoMapper.selectTypeIdList(userId);
|
||||
if (!CollectionUtils.isEmpty(typeIdList)) {
|
||||
leaseApplyInfo.setTypeIdList(typeIdList);
|
||||
} else {
|
||||
leaseApplyInfo.setUserId(userId);
|
||||
}
|
||||
Optional<LeaseApplyInfo> optionalInfo = Optional.ofNullable(leaseApplyInfoMapper.selectLeaseApplyInfoById(leaseApplyInfo));
|
||||
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
|
||||
// 查询领用出库数据
|
||||
|
|
@ -134,11 +140,16 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
|
||||
leaseApplyRequestVo.setLeaseApplyInfo(info);
|
||||
// 获取领料单详情
|
||||
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword, userId));
|
||||
List<LeaseApplyDetails> details = new ArrayList<>();
|
||||
if (leaseApplyInfo.getUserId() != null) {
|
||||
details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword, userId, null));
|
||||
} else {
|
||||
details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword, null, typeIdList));
|
||||
}
|
||||
// 走单独的领用详情查询
|
||||
if (StringUtils.isNotBlank(publishTask)) {
|
||||
// 根据领用批次查询领用详情
|
||||
details = leaseApplyDetailsMapper.getDetailsPublish(keyword, publishTask);
|
||||
details = leaseApplyDetailsMapper.getDetailsPublish(keyword, publishTask, typeIdList);
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
for (LeaseApplyDetails detail : details) {
|
||||
if (detail.getPreNum().compareTo(detail.getAlNum()) == 0) {
|
||||
|
|
@ -270,7 +281,12 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
|
||||
leaseApplyInfo.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
// 首先根据用户名去ma_type_manage表查询是否存在绑定物资信息
|
||||
List<Long> typeIdList = leaseApplyInfoMapper.selectTypeIdList(userId);
|
||||
if (CollectionUtils.isEmpty(typeIdList)) {
|
||||
leaseApplyInfo.setUserId(SecurityUtils.getLoginUser().getUserid());
|
||||
}
|
||||
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
||||
// 如果statusList包含3、4、5,则为领料出库查询,需查询领用出库数据,进行拼接
|
||||
if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) {
|
||||
|
|
@ -291,6 +307,11 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
Comparator.nullsFirst(Comparator.naturalOrder())).reversed())
|
||||
.collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(sortedList)) {
|
||||
if (!CollectionUtils.isEmpty(typeIdList)) {
|
||||
sortedList = sortedList.stream()
|
||||
.filter(item -> typeIdList.contains(item.getFirstId()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
String keyWord = leaseApplyInfo.getKeyWord();
|
||||
// 如果关键字不为空,进行过滤
|
||||
if (!StringUtils.isBlank(keyWord)) {
|
||||
|
|
@ -946,7 +967,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<LeaseApplyDetails> selectLeaseApplyDetailsList(LeaseApplyInfo leaseApplyInfo) {
|
||||
return leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(leaseApplyInfo.getId(), leaseApplyInfo.getKeyWord(), leaseApplyInfo.getUserId()));
|
||||
return leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(leaseApplyInfo.getId(), leaseApplyInfo.getKeyWord(), leaseApplyInfo.getUserId(), null));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
if (StringUtils.isNotBlank(record.getPublishTask())) {
|
||||
// 根据领用批次查询领用详情
|
||||
boolean isFinished = true;
|
||||
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.getDetailsPublish(null, record.getPublishTask());
|
||||
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.getDetailsPublish(null, record.getPublishTask(), null);
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
for (LeaseApplyDetails bean : details) {
|
||||
if (bean.getAlNum().compareTo(bean.getPreNum()) != 0) {
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
|||
|
||||
leaseApplyRequestVo.setLeaseApplyInfo(info);
|
||||
// 获取领料单详情
|
||||
List<LeaseApplyDetails> details = mapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyWord, userId));
|
||||
List<LeaseApplyDetails> details = mapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyWord, userId, null));
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
leaseApplyRequestVo.setLeaseApplyDetailsList(details);
|
||||
for (LeaseApplyDetails detail : details) {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
|
||||
LEFT JOIN ma_type mt ON mt.type_id = sai.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_type mt4 ON mt3.parent_id = mt4.type_id
|
||||
LEFT JOIN ma_type_manage mtm ON mt3.parent_id = mtm.type_id
|
||||
WHERE
|
||||
1=1
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
|
|
@ -52,6 +55,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sd.dept_name like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
and mtm.user_id = #{userId}
|
||||
</if>
|
||||
|
||||
<if test="unitId != null">
|
||||
and bu.unit_id = #{unitId}
|
||||
</if>
|
||||
|
|
@ -354,7 +361,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
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
|
||||
sai.`status` = '0'
|
||||
sai.`status` = '0' and sai.`is_slt` = '0'
|
||||
AND sai.end_time IS NULL
|
||||
AND sai.back_id IS NULL
|
||||
GROUP BY mt.type_id
|
||||
|
|
@ -456,8 +463,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt2 on mt2.type_id = mt.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_type_manage mtm ON mt4.type_id = mtm.type_id
|
||||
WHERE mt.`level` = 4
|
||||
and mt.del_flag = '0'
|
||||
<if test="userId != null ">
|
||||
and mtm.user_id = #{userId}
|
||||
</if>
|
||||
|
||||
<if test="typeId != null">
|
||||
<if test="level == 3">
|
||||
and mt.parent_id = #{typeId}
|
||||
|
|
@ -474,6 +486,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt.type_name like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="typeName != null and typeName != ''">
|
||||
and mt2.type_name like concat('%',#{typeName},'%')
|
||||
</if>
|
||||
|
|
@ -493,7 +506,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bs.create_time as inputTime,
|
||||
CASE
|
||||
WHEN tt.`code` LIKE 'XG%' THEN '新购入库'
|
||||
WHEN tt.`code` LIKE 'R%' THEN '修饰入库'
|
||||
WHEN tt.`code` LIKE 'R%' THEN '修试入库'
|
||||
WHEN tt.`code` LIKE 'PD%' THEN '盘点入库'
|
||||
ELSE '未知入库类型'
|
||||
END AS inputType,
|
||||
|
|
|
|||
|
|
@ -169,6 +169,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="typeModelName != null and typeModelName != ''">
|
||||
and mt.type_name like concat('%',#{typeModelName},'%')
|
||||
</if>
|
||||
<if test="impUnit != null and impUnit != ''">
|
||||
and subquery1.impUnit = #{impUnit}
|
||||
</if>
|
||||
<if test="projectIdList != null and projectIdList.size() > 0">
|
||||
and subquery1.externalId in
|
||||
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
mt.type_id,
|
||||
subquery1.proId
|
||||
|
|
|
|||
|
|
@ -44,13 +44,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
IFNULL(lad.audit_num,0) as audit_num,
|
||||
IFNULL(lad.al_num,0) as al_num,
|
||||
IFNULL(lad.status,0) as status, mt.unit_name,mt.unit_value,
|
||||
lad.create_by, lad.create_time, lad.update_by, lad.update_time, lad.remark, lad.company_id
|
||||
lad.create_by, lad.create_time, lad.update_by, lad.update_time, lad.remark, lad.company_id,
|
||||
mt4.type_id as firstId
|
||||
from
|
||||
lease_apply_details lad
|
||||
left join
|
||||
ma_type mt on lad.type_id = mt.type_id and mt.`level` = '4' and mt.del_flag = '0'
|
||||
left join
|
||||
ma_type mt2 on mt2.type_id = mt.parent_id and mt2.`level` = '3' and mt2.del_flag = '0'
|
||||
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0'
|
||||
left join ma_type mt4 ON mt3.parent_id = mt4.type_id and mt4.del_flag = '0'
|
||||
left join (SELECT mt.type_id,
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
|
|
@ -79,6 +82,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<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="typeIdList != null and typeIdList.size() > 0">
|
||||
and mt4.type_id in
|
||||
<foreach item="item" collection="typeIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
@ -439,13 +448,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
IFNULL(subquery0.num, 0)
|
||||
ELSE
|
||||
IFNULL(mt.storage_num, 0)
|
||||
END as storageNum
|
||||
END as storageNum,
|
||||
mt4.type_id as firstId
|
||||
FROM
|
||||
lease_publish_details lpd
|
||||
LEFT JOIN ma_type mt ON lpd.new_type = 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'
|
||||
left join ma_type mt3 ON mt1.parent_id = mt3.type_id and mt3.del_flag = '0'
|
||||
left join ma_type mt4 ON mt3.parent_id = mt4.type_id and mt4.del_flag = '0'
|
||||
left join (SELECT mt.type_id,
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
|
|
@ -460,12 +472,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND lpd.publish_task = lod.publish_task
|
||||
LEFT JOIN (SELECT id, parent_id, type_id from lease_apply_details GROUP BY parent_id, type_id) a
|
||||
on lpd.parent_id = a.parent_id and a.type_id = lpd.type_id
|
||||
<if test="userId != null">
|
||||
JOIN ma_type_keeper mtk ON mtk.type_id = lpd.new_type AND mtk.user_id = #{userId}
|
||||
</if>
|
||||
WHERE
|
||||
lpd.publish_task = #{publishTask}
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (mt1.type_name LIKE CONCAT(CONCAT('%', #{keyWord}), '%')
|
||||
OR mt.type_name LIKE CONCAT(CONCAT('%', #{keyWord}), '%'))
|
||||
</if>
|
||||
<if test="typeIdList != null and typeIdList.size() > 0">
|
||||
and mt4.type_id in
|
||||
<foreach item="item" collection="typeIdList" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
lpd.new_type
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
GROUP_CONCAT(DISTINCT mt1.type_name) as maTypeNames,
|
||||
bp.contract_part as contractPart,
|
||||
sd.dept_name as impUnitName,
|
||||
tt.task_type as taskType
|
||||
tt.task_type as taskType,
|
||||
mt3.type_id as firstId
|
||||
from
|
||||
lease_apply_info lai
|
||||
left join tm_task tt on lai.task_id = tt.task_id
|
||||
|
|
@ -71,6 +72,8 @@ 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'
|
||||
left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = '0'
|
||||
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.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>
|
||||
|
|
@ -334,7 +337,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lai.material_man AS materialMan,
|
||||
lai.confirm_time AS confirmTime,
|
||||
lai.is_confirm AS isConfirm,
|
||||
lai.confirm_remark AS confirmRemark
|
||||
lai.confirm_remark AS confirmRemark,
|
||||
mt3.type_id AS firstId
|
||||
FROM
|
||||
lease_publish_details lpd
|
||||
LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id
|
||||
|
|
@ -349,6 +353,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
AND mt1.del_flag = '0'
|
||||
left join ma_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = '0'
|
||||
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0'
|
||||
LEFT JOIN bm_agreement_info bai ON lpd.unit_id = bai.unit_id
|
||||
AND lpd.project_id = bai.project_id
|
||||
<if test="userId != null">
|
||||
|
|
@ -558,6 +564,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lod.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectTypeIdList" resultType="java.lang.Long">
|
||||
select
|
||||
type_id
|
||||
from
|
||||
ma_type_manage
|
||||
where
|
||||
user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<update id="confirmLeaseTask">
|
||||
update
|
||||
lease_out_details
|
||||
|
|
|
|||
Loading…
Reference in New Issue