select * from mt_user t where t.MOBILE = #{mobile}
AND t.MERCHANT_ID = #{merchantId}
select * from mt_user t where t.MOBILE = #{mobile} limit 1
select * from mt_user t where t.NAME = #{name} and t.STATUS = 'A'
AND t.MERCHANT_ID = #{merchantId}
select * from mt_user t where t.OPEN_ID = #{openId} and t.STATUS = 'A'
AND t.MERCHANT_ID = #{merchantId}
limit 1
select * from mt_user t where t.OPEN_ID = #{openId} and t.STATUS = 'A'
limit 1
select * from mt_user t where t.USER_NO = #{userNo} and t.STATUS = 'A'
AND t.MERCHANT_ID = #{merchantId}
limit 1
update mt_user t set t.UPDATE_TIME = #{updateTime} where t.ID = #{userId}
update mt_user t set t.MOBILE = '' where t.MOBILE = #{mobile} and t.ID != #{userId}
select count(*) from mt_user t where t.STATUS != 'D'
AND t.MERCHANT_ID = #{merchantId}
select count(*) from mt_user t where t.STORE_ID = #{storeId} and t.STATUS != 'D'
select count(*) from mt_user t where t.CREATE_TIME >= #{beginTime} and t.CREATE_TIME < #{endTime} and t.STATUS != 'D'
AND t.MERCHANT_ID = #{merchantId}
select count(*) from mt_user t where t.STORE_ID = #{storeId} and t.CREATE_TIME < #{endTime} and t.CREATE_TIME >= #{beginTime} and t.STATUS != 'D'
SELECT u.id AS ID,u.name AS NAME,u.`USER_NO`,SUM(o.`AMOUNT`) AS amount FROM `mt_user` u,`mt_order` o WHERE u.`ID` = o.`USER_ID` AND o.PAY_STATUS = 'B'
AND u.MERCHANT_ID = #{merchantId}
AND u.STORE_ID = #{storeId}
AND o.CREATE_TIME >= #{startTime}
AND o.CREATE_TIME <= #{endTime}
GROUP BY u.`ID` ORDER BY SUM(o.`AMOUNT`) DESC LIMIT 10