1
dd
2025-11-06 b8b0683ebf3aedbca553a3365d05f5e602c94681
src/main/resources/mapper/UserMapper.xml
@@ -36,6 +36,9 @@
  </sql>
    <select id="findByPhone" parameterType="string" resultType="com.nq.pojo.User">
        select * from user where phone= #{phone}
    </select>
    <select id="login" resultMap="BaseResultMap" parameterType="map">
        SELECT
@@ -49,9 +52,10 @@
        <include refid="Base_Column_List"/>
        FROM user
        <where>
            (agent_id = #{searchId} or
             agent_id in (select a.id FROM agent_user a left join agent_distribution_user d on a.id = d.agent_id WHERE d.parent_id = #{searchId})
            )
            1=1
            <if test="searchId != null and searchId != '' ">
                and agent_id = #{searchId}
            </if>
            <if test="realName != null and realName != '' ">
                and real_name like CONCAT('%','${realName}','%')
            </if>
@@ -81,7 +85,7 @@
    <select id="listByAdmin" resultMap="BaseResultMap" parameterType="map">
        SELECT
        <include refid="Base_Column_List"/>
        *
        FROM user
        <where>
            <if test="searchId != null ">
@@ -96,6 +100,18 @@
            <if test="accountType != null ">
                and account_type = #{accountType}
            </if>
            <if test="isLock != null ">
                and is_lock = #{isLock}
            </if>
            <if test="isLogin != null ">
                and is_login = #{isLogin}
            </if>
            <if test="regTime != null and regTime != ''">
                and  DATE_FORMAT(reg_time, '%Y-%m-%d') = #{regTime}
            </if>
            <if test="isActive != null ">
                and is_active = #{isActive}
            </if>
        </where>
        ORDER BY id DESC
    </select>