pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
@@ -367,6 +367,19 @@
        where id = #{id,jdbcType=BIGINT}
    </select>
    <!--根据指定的条件获取用户记录数-->
    <select id="countPhone" resultType="java.lang.Long">
        SELECT
        COUNT(*) AS recordCount
        FROM ba_user user
        <where>
            user.deleted = 0
            <if test = "phone != null and phone !=''">
                AND user.phone= #{phone}
            </if>
        </where>
    </select>
    <select id="getPhones" resultType="java.lang.String">
        SELECT phone FROM ba_user WHERE deleted = 0 and disabled = 0
    </select>
@@ -379,4 +392,22 @@
        FROM  ba_user
        WHERE disabled = 0 AND deleted = 0
    </select>
    <!--获取巡检员列表-->
    <select id="getInspectors" resultType="com.dy.pipIrrGlobal.voBa.VoRoleSimple">
        SELECT
            us.id AS inspectorId,
            us.name AS inspector
        FROM ba_user us
            INNER JOIN ba_user_role ur ON ur.userId = us.id
            INNER JOIN ba_role rol ON rol.id = ur.roleId
        <where>
            AND us.disabled = 0
            AND us.deleted = 0
            AND rol.`name` = '巡检员'
            <if test = "inspector != null and inspector !=''">
                AND us.name LIKE CONCAT('%',#{inspector},'%')
            </if>
        </where>
    </select>
</mapper>