Pu Zhibing
2025-06-06 b1f2f102034b4433201225b67a9fc78c08e532f0
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TDispatchMapper.xml
@@ -26,7 +26,7 @@
    <select id="getDispatchList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
        SELECT * FROM (SELECT c1.name as companyName,c2.name as franchiseeName,dd.* FROM t_dispatch as dd
        LEFT JOIN (select * from t_company where type = 2 and flag != 3) as c1 on c1.id = dd.companyId
        LEFT JOIN (select * from t_company where type = 3 and flag != 3) as c2 on c2.id = dd.franchiseeId) as o
        LEFT JOIN (select * from t_company where type = 3 and flag != 3) as c2 on c2.id = dd.companyId) as o
        <where>
            o.state != 3
            <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
@@ -48,10 +48,10 @@
                and o.state = #{state}
            </if>
            <if test="roleType != null and roleType != '' and roleType == 2">
                and (o.companyId = #{nowUserId} or FIND_IN_SET(o.franchiseeId,(SELECT GROUP_CONCAT(id) as ids FROM t_company where superiorId = #{nowUserId} GROUP BY superiorId)))
                and (o.companyId = #{nowUserId} or FIND_IN_SET(o.companyId,(SELECT GROUP_CONCAT(id) as ids FROM t_company where superiorId = #{nowUserId} GROUP BY superiorId)))
            </if>
            <if test="roleType != null and roleType != '' and roleType == 3">
                and o.franchiseeId = #{nowUserId}
                and o.companyId = #{nowUserId}
            </if>
        </where>
        order by o.id desc