| | |
| | | <select id="getUserDetailById" resultType="java.util.Map"> |
| | | SELECT DATE_FORMAT(ui.insertTime,'%Y-%m-%d %H:%i') as insertTimeStr,ci.`name` as companyName, |
| | | case when ui.isAuth = 1 then '否' else '是' end as isAuthStr, |
| | | IFNULL(0,0) as zcNum, |
| | | IFNULL(ot.num,0) as czNum, |
| | | IFNULL(0,0) as kcNum, |
| | | IFNULL(0,0) as wlNum, |
| | | IFNULL(op.num,0) as zcNum, |
| | | IFNULL(0,0) as czNum, |
| | | IFNULL(oc.num,0) as kcNum, |
| | | IFNULL(ol.num,0) as wlNum, |
| | | IFNULL(td.num,0) as consumptionNum, |
| | | IFNULL(ui.balance,0) as balanceStr, |
| | | ui.* from t_user as ui |
| | | LEFT JOIN (select * from t_company where flag != 3) as ci on ci.id = ui.companyId |
| | | LEFT JOIN (SELECT sum(money) as num,userId from t_pub_transaction_details where userType = 1 and type = 1 and state = 2 GROUP BY userId) as td on td.userId = ui.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,userId from t_order_taxi where FIND_IN_SET(state,'8,9') GROUP BY userId) as ot on ot.userId = ui.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,userId from t_order_private_car where FIND_IN_SET(state,'8,9') GROUP BY userId) as op on op.userId = ui.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,userId from t_order_cross_city where FIND_IN_SET(state,'8,9') GROUP BY userId) as oc on oc.userId = ui.id |
| | | LEFT JOIN (SELECT COUNT(id) as num,userId from t_order_logistics where FIND_IN_SET(state,'6') GROUP BY userId) as ol on ol.userId = ui.id |
| | | where ui.id = #{userId} |
| | | </select> |
| | | |