| | |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="name"></result> |
| | | <result property="memo" column="memo"></result> |
| | | <result property="userPermission" column="user_permission"></result> |
| | | <result property="btnPermission" column="btn_permission"></result> |
| | | <result property="createTime" column="create_time"></result> |
| | | <result property="updateTime" column="update_time"></result> |
| | | <result property="validFlag" column="valid_flag" typeHandler="com.nanometer.smartlab.entity.handler.ValidFlagHandler"></result> |
| | |
| | | where valid_flag = 1 |
| | | <include refid="queryWhereSql"/> |
| | | </select> |
| | | <select id="getBaseRoleByUser" resultMap="BaseRole"> |
| | | SELECT br.* FROM base_role br |
| | | LEFT JOIN sys_user su on su.role_id = br.id |
| | | where su.id=#{0} |
| | | and br.valid_flag = 1 |
| | | </select> |
| | | |
| | | <insert id="insertBaseRole" parameterType="com.nanometer.smartlab.entity.BaseRole"> |
| | | insert into base_role(id, name, memo, valid_flag, create_time, update_time) |
| | | values (#{id}, #{name}, #{memo}, 1, now(), now()) |
| | | insert into base_role(id, name, memo, valid_flag, create_time, update_time |
| | | <if test="btnPermission !=null"> |
| | | ,btn_permission |
| | | </if> |
| | | <if test="userPermission !=null"> |
| | | ,user_permission |
| | | </if>) |
| | | values (#{id}, #{name}, #{memo}, 1, now(), now() |
| | | <if test="btnPermission !=null"> |
| | | ,#{btnPermission} |
| | | </if> |
| | | <if test="userPermission !=null"> |
| | | ,#{userPermission} |
| | | </if>) |
| | | </insert> |
| | | |
| | | <update id="updateBaseRole" parameterType="com.nanometer.smartlab.entity.BaseRole"> |
| | |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updateBaseRoleInfo" parameterType="com.nanometer.smartlab.entity.BaseRole"> |
| | | update base_role |
| | | <set> |
| | | <if test="btnPermission != null"> btn_permission=#{btnPermission},</if> |
| | | <if test="userPermission != null"> user_permission=#{userPermission},</if> |
| | | update_time=now() |
| | | </set> |
| | | |
| | | where id=#{id} |
| | | </update> |
| | | <update id="deleteBaseRoles" parameterType="java.util.List"> |
| | | update base_role set valid_flag=0, update_time=now() |
| | | where id in |