xiaoyong931011
2022-06-13 36a143b19cc919c9a814d065029b2340ef7330d7
src/main/resources/mapper/UserMapper.xml
@@ -7,14 +7,26 @@
        a.*
        FROM
        t_user a
        left join t_belong b on a.belong_id = b.id
        <where>
            and a.id not in (
            SELECT b.user_id FROM t_user_role b
            WHERE b.role_id = ( SELECT id FROM t_role WHERE role_name = #{record.roleName})
            )
            <if test="record != null" >
                <if test="record.username!=null">
                    and a.username like concat ('%',#{record.username},'%')
                </if>
                <if test="record.belongId!=null">
                    and a.belong_id = #{record.belongId}
                </if>
            </if>
        </where>
        order by a.create_time desc
    </select>
    <select id="selectByUserNameAndPassword" resultType="com.xcong.farmer.cms.modules.system.entity.UserEntity">
        SELECT a.* FROM t_user a where a.username = #{username} and a.password = #{password}
    </select>
</mapper>