SELECT <choose> <when test="statisticsType!=null and statisticsType!='' and statisticsType==1"> ate.`direct_superior` as userId, </when> <otherwise> ate.team_leader as userId, </otherwise> </choose> au.username, au.mobile <choose> <when test="isUpgrade!=null and isUpgrade!='' and isUpgrade==1"> ,count(ate.nums) as count </when> <otherwise> ,sum(if(ate.is_upgrade=1,ate.nums-1-ate.refund_num,ate.nums-ate.refund_num)) as count </otherwise> </choose> FROM au_giftpack_extra ate LEFT JOIN au_user au ON <choose> <when test="statisticsType!=null and statisticsType!='' and statisticsType==1"> ate.`direct_superior` </when> <otherwise> ate.team_leader </otherwise> </choose> = au.id <
mybatis中没有if else 用choose when
最新推荐文章于 2024-03-18 10:27:17 发布