You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ocr/jyjz-system/jyjz-system-admin/target/classes/mapper/admin/SysmethodMapper.xml

87 lines
3.9 KiB

<?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="cn.jyjz.xiaoyao.admin.dataDao.SysmethodMybatisDao">
<resultMap id="BaseResultMap" type="cn.jyjz.xiaoyao.admin.dataobject.Sysmethod">
<id column="ID" property="id" jdbcType="BIGINT"/>
<result column="METHODNAME" property="methodname" jdbcType="VARCHAR"/>
<result column="METHODDESC" property="methoddesc" jdbcType="VARCHAR"/>
<result column="ICONMAGE" property="iconmage" jdbcType="VARCHAR"/>
<result column="METHODKEY" property="methodkey" jdbcType="VARCHAR"/>
<result column="MTYPE" property="mtype" jdbcType="INTEGER"/>
<result column="ISCOLUMN" property="iscolumn" jdbcType="INTEGER"/>
<result column="ACTIONMETHOD" property="actionmethod" jdbcType="VARCHAR"/>
<result column="CONO" property="cono" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
ID AS id,
METHODNAME AS methodname,
METHODDESC AS methoddesc,
ICONMAGE AS iconmage,
METHODKEY AS methodkey,
MTYPE AS mtype,
ISCOLUMN AS iscolumn,
ACTIONMETHOD AS actionmethod,
CONO AS cono
</sql>
<sql id="Base_Where">
<where>
<trim prefixOverrides="and|or">
<if test="id != null"> and ID ${id.dataOp} ${id.likestar}#{id.value}${id.likeend}</if>
<if test="methodname != null"> and METHODNAME ${methodname.dataOp} ${methodname.likestar}#{methodname.value}${methodname.likeend}</if>
<if test="methoddesc != null"> and METHODDESC ${methoddesc.dataOp} ${methoddesc.likestar}#{methoddesc.value}${methoddesc.likeend}</if>
<if test="iconmage != null"> and ICONMAGE ${iconmage.dataOp} ${iconmage.likestar}#{iconmage.value}${iconmage.likeend}</if>
<if test="methodkey != null"> and METHODKEY ${methodkey.dataOp} ${methodkey.likestar}#{methodkey.value}${methodkey.likeend}</if>
<if test="mtype != null"> and MTYPE ${mtype.dataOp} ${mtype.likestar}#{mtype.value}${mtype.likeend}</if>
<if test="iscolumn != null"> and ISCOLUMN ${iscolumn.dataOp} ${iscolumn.likestar}#{iscolumn.value}${iscolumn.likeend}</if>
<if test="actionmethod != null"> and ACTIONMETHOD ${actionmethod.dataOp} ${actionmethod.likestar}#{actionmethod.value}${actionmethod.likeend}</if>
<if test="cono != null"> and CONO ${cono.dataOp} ${cono.likestar}#{cono.value}${cono.likeend}</if>
<if test="userid != null"> and USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend}</if>
<if test="listdept != null">
and DEPARTID in
<foreach collection="listdept.value" item="item" index="index" open="(" separator="," close=")" >
#{item}
</foreach>
</if>
</trim>
</where>
<if test="page != null">
<if test="page.sortname != null"> order by ${page.sortname} ${page.sortorder}</if>
limit ${page.start}, ${page.Pagesize}
</if>
</sql>
<!-- 根据资源主键查询方法集合 -->
<select id="listSysmethod" resultMap="BaseResultMap" parameterType="java.lang.String">
select
m.ID as id,
m.METHODNAME as methodname,
m.METHODDESC as methoddesc,
m.ICONMAGE as iconmage,
m.METHODKEY as methodkey,
m.MTYPE as mtype,
m.ISCOLUMN as iscolumn,
m.ACTIONMETHOD as actionmethod,
m.CONO as cono
from S_SYSMETHOD_T m,S_RESOURCEMETHOD_T r where r.METHODID = m.ID and r.RESOURCEID = #{resourceid}
</select>
<!-- 根据资源主键、角色主键查询方法集合 -->
<select id="listSysmethodByRoleId" resultMap="BaseResultMap" parameterType="java.util.Map">
select
m.ID as id,
m.METHODNAME as methodname,
m.METHODDESC as methoddesc,
m.ICONMAGE as iconmage,
m.METHODKEY as methodkey,
m.MTYPE as mtype,
m.ISCOLUMN as iscolumn,
m.ACTIONMETHOD as actionmethod,
m.CONO as cono
from S_SYSMETHOD_T m
RIGHT JOIN(
select rr.MEID as meid,rr.ROLEID AS roleid,rr.RESOURCEID as resourceid
from S_ROLESRESOURCE_T rr
where rr.ROLEID = #{roleid} AND rr.RESOURCEID = #{resourceid}
) as userremth ON userremth.meid = m.ID ORDER BY m.CONO
</select>
</mapper>