<?xml version="1.0" encoding="UTF-8"?>  
 | 
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">  
 | 
<mapper namespace="com.xzx.gc.role.mapper.RoleConsoleMapper">  
 | 
    <select id="queryByCondtion" resultType="com.xzx.gc.entity.CoreRole">  
 | 
        select ID "id",CODE "code",NAME "name",CREATE_TIME "createTime",TYPE "type",del_flag "delFlag"  
 | 
        from core_role r where 1=1 and del_flag=0  
 | 
        <if test="code != null">  
 | 
            and  r.code like concat("%",#{code},"%")  
 | 
        </if>  
 | 
        <if test="name != null">  
 | 
            and  r.name like concat("%",#{name},"%")  
 | 
        </if>  
 | 
  
 | 
        <if test="type != null">  
 | 
            and  r.type = #{type}  
 | 
        </if>  
 | 
        order by id desc  
 | 
    </select>  
 | 
    <delete id="batchDelByIds">  
 | 
        delete from core_role  where id in  
 | 
        <foreach collection="ids" index="index" item="id" separator="," open="(" close=")">  
 | 
            #{id}  
 | 
        </foreach>  
 | 
    </delete>  
 | 
    <delete id="batchDeleteRoleFunction">  
 | 
        delete from core_role_function  where role_id in  
 | 
        <foreach collection="ids" index="index" item="id" separator="," open="(" close=")">  
 | 
            #{id}  
 | 
        </foreach>  
 | 
    </delete>  
 | 
    <delete id="batchDeleteRoleMenu">  
 | 
        delete from core_role_menu  where role_id in  
 | 
        <foreach collection="ids" index="index" item="id" separator="," open="(" close=")">  
 | 
            #{id}  
 | 
        </foreach>  
 | 
    </delete>  
 | 
    <delete id="batchDeleteUserRole">  
 | 
        delete from core_user_role  where role_id in  
 | 
        <foreach collection="ids" index="index" item="id" separator="," open="(" close=")">  
 | 
            #{id}  
 | 
        </foreach>  
 | 
    </delete>  
 | 
</mapper> 
 |