xiaoyong931011
2023-10-25 c08844c08e64ad79f25a7e68bbc3f41fea3cded8
src/main/resources/mapper/modules/ChatUserMapper.xml
@@ -20,6 +20,9 @@
        left join chat_wallet b on b.user_id = a.user_id and type = 'USDT'
        <where>
            <if test="record != null">
                <if test="record.phone != null and record.phone != ''">
                    and a.phone like CONCAT('%', CONCAT(#{record.phone}, '%'))
                </if>
                <if test="record.nickName != null and record.nickName != ''">
                    and a.nick_name like CONCAT('%', CONCAT(#{record.nickName}, '%'))
                </if>
@@ -50,6 +53,9 @@
        left join chat_wallet b on b.user_id = a.user_id and type = 'USDT'
        <where>
            <if test="record != null">
                <if test="record.phone != null and record.phone != ''">
                    and a.phone like CONCAT('%', CONCAT(#{record.phone}, '%'))
                </if>
                <if test="record.nickName != null and record.nickName != ''">
                    and a.nick_name like CONCAT('%', CONCAT(#{record.nickName}, '%'))
                </if>
@@ -102,6 +108,7 @@
        a.type type,
        a.amount amount,
        b.nick_name nickName,
        b.phone phone,
        date_format(a.create_time, '%Y-%m-%d %H:%m:%s') createTime,
        a.ava_amount avaAmount,
        a.state state,
@@ -110,6 +117,9 @@
        inner join chat_user b on b.user_id = a.user_id
        <where>
            <if test="record != null">
                <if test="record.phone != null and record.phone != ''">
                    and b.phone like CONCAT('%', CONCAT(#{record.phone}, '%'))
                </if>
                <if test="record.nickName != null and record.nickName != ''">
                    and b.nick_name = #{record.nickName}
                </if>
@@ -125,6 +135,7 @@
        select
        date_format(a.created_time, '%Y-%m-%d %H:%m:%s') createdTime,
        b.nick_name nickName,
        b.phone phone,
        a.amount amount,
        a.last_amount lastAmount,
        a.status status,
@@ -136,6 +147,9 @@
        left join chat_user b on b.user_id = a.user_id
        <where>
            <if test="record != null">
                <if test="record.phone != null and record.phone != ''">
                    and b.phone like CONCAT('%', CONCAT(#{record.phone}, '%'))
                </if>
                <if test="record.nickName != null and record.nickName != ''">
                    and b.nick_name like CONCAT('%', CONCAT(#{record.nickName}, '%'))
                </if>
@@ -151,6 +165,7 @@
        select
        date_format(a.created_time, '%Y-%m-%d %H:%m:%s') createdTime,
        b.nick_name nickName,
        b.phone phone,
        a.id id,
        a.amount amount,
        a.type type,
@@ -160,6 +175,9 @@
        left join chat_user b on b.user_id = a.user_id
        <where>
            <if test="record != null">
                <if test="record.phone != null and record.phone != ''">
                    and b.phone like CONCAT('%', CONCAT(#{record.phone}, '%'))
                </if>
                <if test="record.nickName != null and record.nickName != ''">
                    and b.nick_name like CONCAT('%', CONCAT(#{record.nickName}, '%'))
                </if>
@@ -375,5 +393,12 @@
        where id = #{id}
    </update>
    <update id="updatePortraitById">
        update chat_user
        set
            portrait = #{portrait}
        where user_id = #{userId}
    </update>
</mapper>