选择车队不一致修改
This commit is contained in:
@@ -380,31 +380,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
group by u.user_id
|
||||
</select>
|
||||
<select id="queryNonePagingList" resultType="com.mhd.user.domain.motorcade.repository.po.MotorcadePo">
|
||||
SELECT
|
||||
SELECT DISTINCT
|
||||
m.motorcade_id,
|
||||
m.motorcade_name
|
||||
m.motorcade_name,
|
||||
m.organization_id,
|
||||
m.organization_name
|
||||
FROM
|
||||
motorcade m
|
||||
LEFT JOIN
|
||||
INNER JOIN
|
||||
motorcade_driver d
|
||||
ON m.motorcade_id = d.motorcade_id and d.del_flag = 1
|
||||
INNER JOIN
|
||||
user_driver ud
|
||||
ON d.user_id = ud.user_id and ud.del_flag = 1
|
||||
LEFT JOIN
|
||||
user_driver_enterprise ude
|
||||
ON ud.user_id = ude.user_id and ude.del_flag = 1
|
||||
<where>
|
||||
m.del_flag = 1
|
||||
<!-- 数据权限:南光组织(organizationId=2827)查全部,其他组织查自己 -->
|
||||
<if test="organizationId != null">
|
||||
<!-- 如果设置了 organizationId,添加 organization_id 条件 -->
|
||||
and m.organization_id = #{organizationId}
|
||||
and m.organization_name IS NOT NULL
|
||||
</if>
|
||||
<if test="topOrganizationId != null">
|
||||
<!-- 如果设置了 topOrganizationId,添加 top_organization_id 条件 -->
|
||||
and m.top_organization_id = #{topOrganizationId}
|
||||
<if test="organizationId == null">
|
||||
<!-- 如果没有设置 organizationId,添加 organization_name IS NOT NULL 条件 -->
|
||||
and m.organization_name IS NOT NULL
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY m.motorcade_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -122,13 +122,13 @@
|
||||
</if>
|
||||
<if test="organizationId !=null">
|
||||
and a.organization_id = #{organizationId}
|
||||
and a.organization_name IS NOT NULL
|
||||
-- and a.organization_name IS NOT NULL
|
||||
</if>
|
||||
<if test="topOrganizationId !=null">
|
||||
and a.top_organization_id = #{topOrganizationId}
|
||||
<if test="organizationId == null">
|
||||
and a.organization_name IS NOT NULL
|
||||
</if>
|
||||
<!-- <if test="organizationId == null">-->
|
||||
<!-- and a.organization_name IS NOT NULL-->
|
||||
<!-- </if>-->
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and a.organization_name like concat('%' , #{organizationName} , '%')
|
||||
|
||||
@@ -185,27 +185,13 @@
|
||||
ude.driver_corp_legal_name,
|
||||
ude.driver_corp_name,
|
||||
ude.driver_corp_idcard_number,
|
||||
r.roleName,
|
||||
b.role_name AS roleName,
|
||||
dvb.vehicle_id,
|
||||
wlhydriver.id as wlhydriverId,
|
||||
WM_CONCAT(DISTINCT dvb.vehicle_license_plate_number ) AS vehicleLicensePlateNumber,
|
||||
WM_CONCAT(DISTINCT m.motorcade_name ) AS driverTeamName
|
||||
FROM
|
||||
"USER" b
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
user_id,
|
||||
LISTAGG(DISTINCT r.role_name, '&') WITHIN GROUP(ORDER BY r.role_name) AS roleName
|
||||
FROM
|
||||
role r
|
||||
LEFT JOIN user_role ur ON r.role_id = ur.role_id
|
||||
AND ur.del_flag = 1
|
||||
WHERE
|
||||
r.del_flag = 1
|
||||
AND role_code IN ( 'driver', 'carrier', 'captain' )
|
||||
GROUP BY
|
||||
user_id
|
||||
) r ON r.user_id = b.user_id
|
||||
LEFT JOIN user_driver a ON a.user_id = b.user_id
|
||||
LEFT JOIN NGWL_TEST_WLHY.sys_user wlhyuser ON wlhyuser.szwl_user_id = b.user_id
|
||||
LEFT JOIN NGWL_TEST_WLHY.tms_driver wlhydriver ON wlhydriver.driver_id = wlhyuser.id
|
||||
@@ -220,7 +206,7 @@
|
||||
left join motorcade m on md.motorcade_id = m.motorcade_id and m.del_flag = 1
|
||||
|
||||
LEFT JOIN motorcade mo ON a.driver_id = mo.motorcade_header_id
|
||||
AND m.del_flag = 1
|
||||
AND mo.del_flag = 1
|
||||
left join motorcade_driver mdr on mo.motorcade_id = mdr.motorcade_id and mdr.del_flag = 1
|
||||
WHERE
|
||||
b.del_flag = 1
|
||||
@@ -353,12 +339,6 @@
|
||||
select count(1)
|
||||
from ( select b.user_id
|
||||
from "USER" b
|
||||
left join (select user_id, WM_CONCAT(r.role_name separator '&') roleName
|
||||
from role r
|
||||
left join user_role ur on r.role_id = ur.role_id and ur.del_flag = 1
|
||||
where r.del_flag = 1
|
||||
and role_code in ('driver', 'carrier', 'captain', 'must')
|
||||
group by user_id) r on r.user_id = b.user_id
|
||||
left join user_driver a on a.user_id = b.user_id
|
||||
left join user_driver_enterprise ude on b.user_id = ude.user_id and ude.driver_type = 1
|
||||
left join user_driver_enterprise ud on b.user_id = ud.user_id and ud.driver_type = 2
|
||||
@@ -558,7 +538,7 @@
|
||||
</if>
|
||||
/*角色*/
|
||||
<if test="userDriverDO.roleName != null and userDriverDO.roleName != ''">
|
||||
AND r.roleName like concat('%', #{userDriverDO.roleName}, '%')
|
||||
AND b.role_name like concat('%', #{userDriverDO.roleName}, '%')
|
||||
</if>
|
||||
/*车牌号*/
|
||||
<if test="userDriverDO.vehicleLicensePlateNumber != null and userDriverDO.vehicleLicensePlateNumber != ''">
|
||||
|
||||
Reference in New Issue
Block a user