| | |
| | | <select id="selectCount" resultType="java.lang.Integer" parameterType="java.lang.String"> |
| | | select count(*) from lf.sys_menu_auth |
| | | <where> |
| | | <if test="menuid != 0"> |
| | | <if test="menuid != null"> |
| | | menuid = #{menuid} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="com.lf.server.entity.sys.MenuAuthEntity"> |
| | | select * from lf.sys_menu_auth |
| | | select a.*,b.name as authName from lf.sys_menu_auth a inner join lf.sys_auth b |
| | | on a.authid = b.id |
| | | <where> |
| | | <if test="menuid != 0"> |
| | | menuid = #{menuid} |
| | | <if test="menuid != null"> |
| | | a.menuid = #{menuid} |
| | | </if> |
| | | </where> |
| | | order by id |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | | <select id="selectCountForRole" resultType="java.lang.Integer" parameterType="java.lang.String"> |
| | | select count(a.id) from lf.sys_menu_auth a inner join lf.sys_auth c on a.authid = c.id |
| | | where not exists (select b.id from lf.sys_role_menu_auth b where b.menu_auth_id = a.id |
| | | <if test="roleid != null"> |
| | | and b.roleid = #{roleid} |
| | | </if> |
| | | ) |
| | | <if test="menuid != null"> |
| | | and a.menuid = #{menuid} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectByPageForRole" resultType="com.lf.server.entity.sys.MenuAuthEntity"> |
| | | select a.*,c.name from lf.sys_menu_auth a inner join lf.sys_auth c on a.authid = c.id |
| | | where not exists (select b.id from lf.sys_role_menu_auth b where b.menu_auth_id = a.id |
| | | <if test="roleid != null"> |
| | | and b.roleid = #{roleid} |
| | | </if> |
| | | ) |
| | | <if test="menuid != null"> |
| | | and a.menuid = #{menuid} |
| | | </if> |
| | | order by c.id |
| | | limit #{limit} offset #{offset} |
| | | </select> |
| | | |
| | |
| | | |
| | | <delete id="deletes"> |
| | | delete from lf.sys_menu_auth where id in |
| | | <foreach item="ids" collection="list" index="index" open="(" separator="," close=")"> |
| | | #{ids} |
| | | <foreach item="id" collection="ids" index="index" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |