Compare commits
2 Commits
9b1eccbc06
...
64e95844bb
| Author | SHA1 | Date |
|---|---|---|
|
|
64e95844bb | |
|
|
04da3fdd5c |
|
|
@ -250,7 +250,57 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
INNER JOIN sys_user t2 ON t1.user_id = t2.user_id
|
||||
LEFT JOIN account_card ac on t2.user_id = ac.user_id and (ac.card_status is null or ac.card_status in (1,4,5))
|
||||
LEFT JOIN sys_dept t6 on t6.dept_id = t2.dept_id
|
||||
<include refid="queryAccountInfo_ref"/>
|
||||
<where>
|
||||
t1.del_flag = 0
|
||||
and t1.account_status in
|
||||
<foreach collection="accountInfoQueryParam.accountStatusList" item="accStatus" separator="," open="(" close=")">
|
||||
#{accStatus}
|
||||
</foreach>
|
||||
<if test="accountInfoQueryParam.searchValue != null and accountInfoQueryParam.searchValue != ''">
|
||||
and (t2.nick_name like CONCAT('%',#{accountInfoQueryParam.searchValue},'%')
|
||||
or t2.user_id like CONCAT('%',#{accountInfoQueryParam.searchValue},'%')
|
||||
or t2.phonenumber = #{encryptedSearchValue}
|
||||
or ac.serial_num = #{accountInfoQueryParam.searchValue}
|
||||
)
|
||||
</if>
|
||||
<if test="accountInfoQueryParam.deptIdList != null and accountInfoQueryParam.deptIdList.size() > 0">
|
||||
and t2.dept_id in
|
||||
<foreach collection="accountInfoQueryParam.deptIdList" item="deptId" separator="," open="(" close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="accountInfoQueryParam.startDateTime != null">
|
||||
and t1.update_time <![CDATA[ >= ]]> #{accountInfoQueryParam.startDateTime}
|
||||
</if>
|
||||
<if test="accountInfoQueryParam.endDateTime != null">
|
||||
and t1.update_time <![CDATA[ <= ]]> #{accountInfoQueryParam.endDateTime}
|
||||
</if>
|
||||
<if test="accountInfoQueryParam.userType != null">
|
||||
and t2.user_type = #{accountInfoQueryParam.userType}
|
||||
</if>
|
||||
<if test="accountInfoQueryParam.walletType != null">
|
||||
AND EXISTS(
|
||||
SELECT null FROM
|
||||
(
|
||||
SELECT
|
||||
user_id,
|
||||
SUM( CASE WHEN wallet_type = 1 THEN wallet_bal ELSE 0 END ) AS walletBal,
|
||||
SUM( CASE WHEN wallet_type = 2 THEN wallet_bal ELSE 0 END ) AS subsidyBal,
|
||||
SUM( a.wallet_bal ) + SUM( ifnull(a.frozen_balance, 0) ) accBalTotal
|
||||
FROM
|
||||
account_wallet_info a
|
||||
GROUP BY
|
||||
user_id
|
||||
) AS t4
|
||||
<where>
|
||||
t4.user_id = t1.user_id
|
||||
</where>
|
||||
)
|
||||
</if>
|
||||
<if test = "accountInfoQueryParam.userCode != null">
|
||||
and t2.user_code = #{accountInfoQueryParam.userCode}
|
||||
</if>
|
||||
</where>
|
||||
order by t1.account_id desc
|
||||
</select>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue