Merge branch 'master' of http://192.168.30.2:3000/bonus/Bonus-Cloud-Material
This commit is contained in:
commit
f1a2a69919
|
|
@ -24,6 +24,26 @@ public class ProjectTreeNode {
|
|||
|
||||
private String typeKey;
|
||||
|
||||
/**
|
||||
* 班组长id
|
||||
*/
|
||||
private String teamLeaderIdCard;
|
||||
|
||||
/**
|
||||
* 班组长姓名
|
||||
*/
|
||||
private String relName;
|
||||
|
||||
/**
|
||||
* 班组长手机号
|
||||
*/
|
||||
private String relPhone;
|
||||
|
||||
/**
|
||||
* 工程id
|
||||
*/
|
||||
private String projectId;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<ProjectTreeNode> children = new ArrayList<>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,7 +191,8 @@ public class HttpHelper {
|
|||
*/
|
||||
private static String getToken() {
|
||||
// String tokenUrl = "http://10.138.55.113:8036/micro-server/zygqj/generatcorToekn";
|
||||
String tokenUrl = "http://10.138.55.113:8036/micro-server/zygqj/generatcorToekn";
|
||||
// String tokenUrl = "http://10.138.55.113:8036/micro-server/zygqj/generatcorToekn";
|
||||
String tokenUrl = "http://10.99.30.251:8036/micro-server/zygqj/generatcorToekn";
|
||||
try {
|
||||
|
||||
String loginName= SecurityUtils.getLoginUser().getSysUser().getUserName();
|
||||
|
|
|
|||
|
|
@ -413,4 +413,11 @@ public interface SelectMapper {
|
|||
* @return
|
||||
*/
|
||||
List<MaterialRetainedEquipmentInfo> getClzAgreementId(MaterialRetainedEquipmentInfo info);
|
||||
|
||||
/**
|
||||
* 根据领料id查询i8工程id
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
ProAuthorizeInfo selectProAuthorizeInfo(ProAuthorizeInfo bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,14 +12,13 @@ import com.bonus.material.ma.service.DirectRotationService;
|
|||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -30,6 +29,7 @@ import java.util.List;
|
|||
@Api(tags = " 直转申请")
|
||||
@RestController
|
||||
@RequestMapping("/directRotation")
|
||||
@Slf4j
|
||||
public class DirectRotationController extends BaseController {
|
||||
|
||||
@Resource(name = "directRotationService")
|
||||
|
|
@ -45,42 +45,74 @@ public class DirectRotationController extends BaseController {
|
|||
List<SltAgreementInfo> datas = new ArrayList<>();
|
||||
List<SltAgreementInfo> useringData = service.getUseringData(sltAgreementInfo);
|
||||
Integer projectId = service.getprojectId(sltAgreementInfo);
|
||||
// 根据项目获取材料站在用机具
|
||||
List<SltAgreementInfo> useringDataClz = service.getUseringDataByClz(projectId);
|
||||
Iterator<SltAgreementInfo> iterator = useringData.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
SltAgreementInfo useringDatum = iterator.next();
|
||||
// 1. 构建typeId -> 材料站数据的映射(同之前)
|
||||
Map<Long, List<SltAgreementInfo>> clzMap = new HashMap<>();
|
||||
for (SltAgreementInfo clzInfo : useringDataClz) {
|
||||
Long typeId = clzInfo.getTypeId();
|
||||
clzMap.computeIfAbsent(typeId, k -> new ArrayList<>()).add(clzInfo);
|
||||
}
|
||||
// 2. 批量查询待审核数量:收集所有必要参数,一次查库
|
||||
Set<SltAgreementInfo> pairSet = new HashSet<>();
|
||||
for (SltAgreementInfo data : useringData) {
|
||||
Long typeId = data.getTypeId();
|
||||
Long maId = data.getMaId();
|
||||
SltAgreementInfo info = new SltAgreementInfo();
|
||||
info.setTypeId(typeId);
|
||||
info.setMaId(maId);
|
||||
pairSet.add(info); // 去重相同组合
|
||||
}
|
||||
List<SltAgreementInfo> pairs = new ArrayList<>(pairSet);
|
||||
// 批量查询待转数量
|
||||
List<SltAgreementInfo> batchInfoList = service.getBatchInfo(sltAgreementInfo.getAgreementId(),pairs);
|
||||
// 构建infoMap:key = "typeId:maId",value = 对应的SltAgreementInfo(含waitTransNum)
|
||||
Map<String, SltAgreementInfo> infoMap = new HashMap<>();
|
||||
for (SltAgreementInfo info : batchInfoList) {
|
||||
Long typeId = info.getTypeId();
|
||||
Long maId = info.getMaId();
|
||||
// 生成唯一key(处理maId为null的情况)
|
||||
String key = typeId + ":" + (maId == null ? "null" : maId);
|
||||
infoMap.put(key, info);
|
||||
}
|
||||
// 3. 遍历useringData处理逻辑(用批量结果替代循环查库)
|
||||
for (SltAgreementInfo data : useringData) {
|
||||
boolean shouldAdd = true;
|
||||
for (SltAgreementInfo agreementInfo : useringDataClz) {
|
||||
if (useringDatum.getTypeId().equals(agreementInfo.getTypeId())) {
|
||||
if (useringDatum.getMaId() == null && agreementInfo.getMaId() == null) {
|
||||
if (useringDatum.getUseNum().compareTo(agreementInfo.getUseNum()) > 0) {
|
||||
useringDatum.setUseNum(useringDatum.getUseNum().subtract(agreementInfo.getUseNum()));
|
||||
Long dataTypeId = data.getTypeId();
|
||||
List<SltAgreementInfo> matchedClzList = clzMap.get(dataTypeId);
|
||||
if (matchedClzList != null && !matchedClzList.isEmpty()) {
|
||||
for (SltAgreementInfo clzInfo : matchedClzList) {
|
||||
if (data.getMaId() == null && clzInfo.getMaId() == null) {
|
||||
// 优化:先计算结果,最后一次set,减少BigDecimal创建
|
||||
BigDecimal subtractResult = data.getUseNum().subtract(clzInfo.getUseNum());
|
||||
if (subtractResult.compareTo(BigDecimal.ZERO) > 0) {
|
||||
data.setUseNum(subtractResult);
|
||||
} else {
|
||||
shouldAdd = false;
|
||||
break;
|
||||
}
|
||||
} else if (useringDatum.getMaId() != null && useringDatum.getMaId().equals(agreementInfo.getMaId())) {
|
||||
} else if (Objects.equals(data.getMaId(), clzInfo.getMaId())) {
|
||||
shouldAdd = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 根据协议以及类型id查询待审核数量
|
||||
SltAgreementInfo info = service.getInfo(useringDatum);
|
||||
// 4. 从批量查询结果中获取数据(O(1)查询)
|
||||
String infoKey = data.getTypeId() + ":" + (data.getMaId() == null ? "null" : data.getMaId());
|
||||
SltAgreementInfo info = infoMap.get(infoKey);
|
||||
if (info != null) {
|
||||
useringDatum.setWaitTransNum(info.getWaitTransNum());
|
||||
useringDatum.setTransNum(useringDatum.getUseNum().subtract(useringDatum.getWaitTransNum()));
|
||||
data.setWaitTransNum(info.getWaitTransNum());
|
||||
data.setTransNum(data.getUseNum().subtract(info.getWaitTransNum()));
|
||||
} else {
|
||||
useringDatum.setWaitTransNum(BigDecimal.ZERO);
|
||||
useringDatum.setTransNum(useringDatum.getUseNum());
|
||||
data.setWaitTransNum(BigDecimal.ZERO);
|
||||
data.setTransNum(data.getUseNum());
|
||||
}
|
||||
if (shouldAdd) {
|
||||
datas.add(useringDatum);
|
||||
datas.add(data);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(datas);
|
||||
} catch (Exception e) {
|
||||
log.error("查询失败", e);
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,4 +108,12 @@ public interface DirectRotationMapper {
|
|||
* @return
|
||||
*/
|
||||
SltAgreementInfo getInfo(SltAgreementInfo useringDatum);
|
||||
|
||||
/**
|
||||
* 批量查询
|
||||
* @param agreementId
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
List<SltAgreementInfo> getBatchInfo(@Param("agreementId") Long agreementId, @Param("pairs")List<SltAgreementInfo> list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,4 +106,12 @@ public interface DirectRotationService {
|
|||
* @return
|
||||
*/
|
||||
SltAgreementInfo getInfo(SltAgreementInfo useringDatum);
|
||||
|
||||
/**
|
||||
* 批量查询待转数量
|
||||
* @param agreementId
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
List<SltAgreementInfo> getBatchInfo(Long agreementId, List<SltAgreementInfo> list);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -550,6 +550,17 @@ public class DirectRotationImpl implements DirectRotationService {
|
|||
return mapper.getInfo(useringDatum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量查询协议信息
|
||||
* @param agreementId
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SltAgreementInfo> getBatchInfo(Long agreementId, List<SltAgreementInfo> list) {
|
||||
return mapper.getBatchInfo(agreementId, list);
|
||||
}
|
||||
|
||||
// 将签名分类的逻辑提取到一个单独的方法
|
||||
private void classifySignature(ClzDirectApplyInfo clzDirectApplyInfo, LeaseOutSign leaseOutSign,
|
||||
List<LeaseOutSign> list1, List<LeaseOutSign> list2, List<LeaseOutSign> list3) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class ProAuthorizeInfo {
|
|||
/**
|
||||
* 班组id
|
||||
*/
|
||||
private Long teamId;
|
||||
private String teamId;
|
||||
|
||||
/**
|
||||
* 班组名称
|
||||
|
|
|
|||
|
|
@ -1,18 +1,24 @@
|
|||
package com.bonus.material.materialStation.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.common.biz.constant.GlobalConstants;
|
||||
import com.bonus.common.biz.domain.ProjectTreeNode;
|
||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||
import com.bonus.common.biz.domain.lease.LeasePublishInfo;
|
||||
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||
import com.bonus.common.core.domain.R;
|
||||
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.clz.domain.BmTeam;
|
||||
import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo;
|
||||
import com.bonus.material.clz.mapper.BmTeamMapper;
|
||||
import com.bonus.material.common.mapper.SelectMapper;
|
||||
import com.bonus.material.materialStation.domain.ProAuthorizeDetails;
|
||||
import com.bonus.material.materialStation.domain.ProAuthorizeInfo;
|
||||
import com.bonus.material.materialStation.mapper.ProAuthorizeMapper;
|
||||
import com.bonus.material.materialStation.service.ProAuthorizeService;
|
||||
import com.google.common.net.MediaType;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import okhttp3.*;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
|
@ -60,6 +66,9 @@ public class ProAuthorizeServiceImpl implements ProAuthorizeService {
|
|||
@Resource(name = "SelectMapper")
|
||||
private SelectMapper selectMapper;
|
||||
|
||||
@Resource
|
||||
private BmTeamMapper bmTeamMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<LeasePublishInfo> getPublishList(LeaseApplyInfo leaseApplyInfo) {
|
||||
|
|
@ -162,8 +171,8 @@ public class ProAuthorizeServiceImpl implements ProAuthorizeService {
|
|||
public AjaxResult authorizeSubmit(ProAuthorizeInfo bean) {
|
||||
try {
|
||||
String userId = SecurityUtils.getLoginUser().getUserid().toString();
|
||||
bean.setCreateBy(userId);
|
||||
if (bean != null) {
|
||||
bean.setCreateBy(userId);
|
||||
if (bean.getAuthId() != null) {
|
||||
//修改
|
||||
//删除详情数据
|
||||
|
|
@ -175,6 +184,37 @@ public class ProAuthorizeServiceImpl implements ProAuthorizeService {
|
|||
} else {
|
||||
for (Long lesaeId : bean.getLeaseIds()){
|
||||
bean.setLeaseId(lesaeId);
|
||||
// 根据领料id查询i8工程id
|
||||
ProAuthorizeInfo info = selectMapper.selectProAuthorizeInfo(bean);
|
||||
// 根据i8工程id以及班组名称查询班组信息
|
||||
if (info != null) {
|
||||
bean.setExternalId(info.getExternalId());
|
||||
}
|
||||
List<ProjectTreeNode> newList = selectMapper.getTeamNewList(bean);
|
||||
if (!CollectionUtils.isEmpty(newList)) {
|
||||
ProjectTreeNode projectTreeNode = newList.get(0);
|
||||
// 先根据班组名称查询此班组是否存在
|
||||
BmTeam tbTeam = new BmTeam();
|
||||
tbTeam.setTeamName(projectTreeNode.getName());
|
||||
tbTeam.setProjectId(projectTreeNode.getProjectId());
|
||||
// 班组类型固定传值
|
||||
tbTeam.setTypeId(1731L);
|
||||
tbTeam.setIdCard(projectTreeNode.getTeamLeaderIdCard());
|
||||
BmTeam bmTeam = bmTeamMapper.selectByName(tbTeam);
|
||||
if (bmTeam == null) {
|
||||
// 新增班组
|
||||
tbTeam.setCreateUser(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
tbTeam.setRelName(projectTreeNode.getRelName());
|
||||
tbTeam.setRelPhone(projectTreeNode.getRelPhone());
|
||||
int result = bmTeamMapper.insert(tbTeam);
|
||||
if (result <= GlobalConstants.INT_0) {
|
||||
return AjaxResult.error(HttpCodeEnum.UPDATE_TO_DATABASE.getCode(), HttpCodeEnum.UPDATE_TO_DATABASE.getMsg());
|
||||
}
|
||||
bean.setTeamId(tbTeam.getId().toString());
|
||||
} else {
|
||||
bean.setTeamId(bmTeam.getId().toString());
|
||||
}
|
||||
}
|
||||
//新增
|
||||
int res = mapper.insertProAuthorizeInfo(bean);
|
||||
if (res > 0 && bean.getId() != null) {
|
||||
|
|
|
|||
|
|
@ -786,7 +786,8 @@ public class IwsCostPushServiceImpl implements IwsCostPushService {
|
|||
map.put("body", encrypt);
|
||||
String body = JSONObject.toJSONString(map);
|
||||
// String url = "http://10.138.55.113:8036/micro-server/zygqj/syncProjectCostsData";
|
||||
String url = "http://10.138.55.113:8036/micro-server/zygqj/syncProjectCostsData";
|
||||
//String url = "http://10.138.55.113:8036/micro-server/zygqj/syncProjectCostsData";
|
||||
String url = "http://10.99.30.251:8036/micro-server/zygqj/syncProjectCostsData";
|
||||
String data = HttpHelper.sendHttpPostPushCost(url, body);
|
||||
System.err.println("dataString-=========:" + data);
|
||||
|
||||
|
|
|
|||
|
|
@ -103,6 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="teamName != null and teamName != ''">
|
||||
and unit_name = #{teamName}
|
||||
</if>
|
||||
<if test="idCard != null and idCard != ''">
|
||||
and bzz_idcard = #{idCard}
|
||||
</if>
|
||||
Limit 1
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -1166,16 +1166,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<select id="getTeamNewList" resultType="com.bonus.common.biz.domain.ProjectTreeNode">
|
||||
SELECT DISTINCT
|
||||
unit_id AS id,
|
||||
unit_name AS NAME
|
||||
FROM
|
||||
bm_unit
|
||||
SELECT
|
||||
DISTINCT
|
||||
bz.id as id,
|
||||
bz.bzmc as name, bz.bzz_name as relName,
|
||||
bz.bzz_idcard as teamLeaderIdCard,
|
||||
bz.project_id as projectId,
|
||||
ou.mobile as relPhone
|
||||
from
|
||||
`micro-tool`.bzgl_bz bz
|
||||
left join `uni_org`.org_user ou on bz.bzz_idcard = ou.id_card
|
||||
WHERE
|
||||
del_flag = '0'
|
||||
AND project_id = #{externalId}
|
||||
GROUP BY
|
||||
unit_id
|
||||
bz.bz_status = 3
|
||||
AND bz.sfjs = 0
|
||||
AND bz.project_id = #{externalId}
|
||||
<if test="teamName != null and teamName != ''">
|
||||
AND bz.bzmc = #{teamName}
|
||||
</if>
|
||||
GROUP BY bz.bzmc
|
||||
</select>
|
||||
<select id="getUnsettledProId" resultType="java.lang.String">
|
||||
<!-- 数据量小的时候用上面的SQL,数据量大的时候用下面的sql -->
|
||||
|
|
@ -1279,4 +1287,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND bu.project_id = #{externalId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectProAuthorizeInfo" resultType="com.bonus.material.materialStation.domain.ProAuthorizeInfo">
|
||||
SELECT
|
||||
bp.pro_id AS proId,
|
||||
bp.external_id AS externalId
|
||||
FROM
|
||||
bm_project bp
|
||||
LEFT JOIN lease_apply_info lai ON bp.pro_id = lai.project_id
|
||||
WHERE
|
||||
lai.id = #{leaseId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -379,4 +379,32 @@
|
|||
HAVING
|
||||
waitTransNum > 0
|
||||
</select>
|
||||
<select id="getBatchInfo" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||
SELECT
|
||||
da.back_agreement_id AS agreementId,
|
||||
dad.type_id AS typeId,
|
||||
dad.ma_id AS maId,
|
||||
da.id AS id,
|
||||
SUM(IFNULL(dad.direct_num, 0)) AS waitTransNum -- 待转数量
|
||||
FROM
|
||||
direct_apply_info da
|
||||
INNER JOIN direct_apply_details dad ON da.id = dad.direct_id
|
||||
WHERE
|
||||
da.`status` = '0'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM sys_workflow_record swr
|
||||
WHERE swr.task_id = da.id
|
||||
)
|
||||
AND da.back_agreement_id = #{agreementId}
|
||||
AND (
|
||||
<foreach collection="pairs" item="pair" separator="OR">
|
||||
(dad.type_id = #{pair.typeId}
|
||||
<if test="pair.maId != null">AND dad.ma_id = #{pair.maId}</if>
|
||||
<if test="pair.maId == null">AND dad.ma_id IS NULL</if>)
|
||||
</foreach>
|
||||
)
|
||||
AND IFNULL(dad.direct_num, 0) > 0 -- 提前过滤0值,减少计算
|
||||
GROUP BY
|
||||
da.back_agreement_id, dad.type_id, dad.ma_id, da.id;
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -1056,29 +1056,58 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
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
|
||||
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')
|
||||
WHERE m.type_id IN (
|
||||
-- 对三级节点去重
|
||||
SELECT DISTINCT node_id
|
||||
FROM (
|
||||
-- 三级父节点
|
||||
SELECT
|
||||
mt.parent_id AS node_id
|
||||
FROM (
|
||||
SELECT DISTINCT sai.type_id
|
||||
FROM slt_agreement_info sai
|
||||
WHERE sai.agreement_id = #{agreementId} AND sai.STATUS = '0'
|
||||
) AS sai_filtered
|
||||
INNER JOIN ma_type mt ON mt.type_id = sai_filtered.type_id
|
||||
WHERE mt.parent_id IS NOT NULL
|
||||
|
||||
UNION ALL -- 二级父节点
|
||||
|
||||
SELECT
|
||||
mt2.parent_id AS node_id
|
||||
FROM (
|
||||
SELECT DISTINCT sai.type_id
|
||||
FROM slt_agreement_info sai
|
||||
WHERE sai.agreement_id = #{agreementId} AND sai.STATUS = '0'
|
||||
) AS sai_filtered
|
||||
INNER JOIN ma_type mt ON mt.type_id = sai_filtered.type_id
|
||||
INNER JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
WHERE mt2.parent_id IS NOT NULL
|
||||
|
||||
UNION ALL -- 一级父节点
|
||||
|
||||
SELECT
|
||||
mt3.parent_id AS node_id
|
||||
FROM (
|
||||
SELECT DISTINCT sai.type_id
|
||||
FROM slt_agreement_info sai
|
||||
WHERE sai.agreement_id = #{agreementId} AND sai.STATUS = '0'
|
||||
) AS sai_filtered
|
||||
INNER JOIN ma_type mt ON mt.type_id = sai_filtered.type_id
|
||||
INNER JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
INNER JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||
WHERE mt3.parent_id IS NOT NULL
|
||||
) AS all_nodes
|
||||
);
|
||||
</select>
|
||||
|
||||
<select id="getListLevel" resultType="com.bonus.material.ma.domain.vo.MaTypeVo">
|
||||
|
|
|
|||
Loading…
Reference in New Issue