| | |
| | | LEFT JOIN (select * from t_car_brand where state = 1) as cb on cb.id = cc.carBrandId |
| | | LEFT JOIN (select * from t_car_model where state = 1) as cm on cm.id = cc.carModelId |
| | | LEFT JOIN (select * from t_company where type = 2 and flag != 3) as c1 on c1.id = cc.companyId |
| | | LEFT JOIN (select * from t_company where type = 3 and flag != 3) as c2 on c2.id = cc.franchiseeId |
| | | LEFT JOIN (select * from t_company where type = 3 and flag != 3) as c2 on c2.id = cc.companyId |
| | | LEFT JOIN ( |
| | | SELECT |
| | | GROUP_CONCAT(case when type = 1 then '专车' |
| | |
| | | and o.franchiseeName LIKE CONCAT('%',#{franchiseeName},'%') |
| | | </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 |
| | |
| | | LEFT JOIN (select * from t_car_brand where state = 1) as cb on cb.id = cc.carBrandId |
| | | LEFT JOIN (select * from t_car_model where state = 1) as cm on cm.id = cc.carModelId |
| | | LEFT JOIN (select * from t_company where type = 2 and flag != 3) as c1 on c1.id = cc.companyId |
| | | LEFT JOIN (select * from t_company where type = 3 and flag != 3) as c2 on c2.id = cc.franchiseeId |
| | | LEFT JOIN (select * from t_company where type = 3 and flag != 3) as c2 on c2.id = cc.companyId |
| | | LEFT JOIN ( |
| | | SELECT |
| | | GROUP_CONCAT(case when type = 1 then '专车' |
| | |
| | | and o.franchiseeName LIKE CONCAT('%',#{franchiseeName},'%') |
| | | </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 |
| | |
| | | LEFT JOIN (select * from t_car_brand where state = 1) as cb on cb.id = cc.carBrandId |
| | | LEFT JOIN (select * from t_car_model where state = 1) as cm on cm.id = cc.carModelId |
| | | LEFT JOIN (select * from t_company where type = 2 and flag != 3) as c1 on c1.id = cc.companyId |
| | | LEFT JOIN (select * from t_company where type = 3 and flag != 3) as c2 on c2.id = cc.franchiseeId |
| | | LEFT JOIN (select * from t_company where type = 3 and flag != 3) as c2 on c2.id = cc.companyId |
| | | LEFT JOIN ( |
| | | SELECT |
| | | GROUP_CONCAT(case when type = 1 then '专车' |
| | |
| | | <where> |
| | | o.state = 1 |
| | | <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 |