12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?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">
- <!-- namespace必须指向DAO接口 -->
- <mapper namespace="com.jpsoft.picc.modules.sys.dao.RoleMenuDAO">
- <resultMap id="RoleMenuMap" type="com.jpsoft.picc.modules.sys.entity.RoleMenu">
- <id property="id" column="id_" />
- <result property="roleId" column="role_id" />
- <result property="menuId" column="menu_id" />
- <result property="delFlag" column="del_flag" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- </resultMap>
- <insert id="insert" parameterType="com.jpsoft.picc.modules.sys.entity.RoleMenu">
- <!--
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
- select sys_guid() from dual
- </selectKey>
- -->
- <![CDATA[
- insert into sys_role_menu
- (id_,role_id,menu_id,del_flag,create_by,create_time,update_by,update_time)
- values
- (
- #{id,jdbcType=VARCHAR}
- ,#{roleId,jdbcType=VARCHAR}
- ,#{menuId,jdbcType=VARCHAR}
- ,#{delFlag,jdbcType= NUMERIC }
- ,#{createBy,jdbcType=VARCHAR}
- ,#{createTime,jdbcType= TIMESTAMP }
- ,#{updateBy,jdbcType=VARCHAR}
- ,#{updateTime,jdbcType= TIMESTAMP }
- )
- ]]>
- </insert>
- <delete id="delete" parameterType="string">
- delete from sys_role_menu where id_=#{id,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteByRoleId" parameterType="string">
- delete from sys_role_menu where role_id=#{0}
- </delete>
- <update id="update" parameterType="com.jpsoft.picc.modules.sys.entity.RoleMenu">
- update sys_role_menu
- <set>
- <if test="roleId!=null">
- role_id=#{roleId,jdbcType=VARCHAR},
- </if>
- <if test="menuId!=null">
- menu_id=#{menuId,jdbcType=VARCHAR},
- </if>
- <if test="delFlag!=null">
- del_flag=#{delFlag,jdbcType= NUMERIC },
- </if>
- <if test="createBy!=null">
- create_by=#{createBy,jdbcType=VARCHAR},
- </if>
- <if test="createTime!=null">
- create_time=#{createTime,jdbcType= TIMESTAMP },
- </if>
- <if test="updateBy!=null">
- update_by=#{updateBy,jdbcType=VARCHAR},
- </if>
- <if test="updateTime!=null">
- update_time=#{updateTime,jdbcType= TIMESTAMP },
- </if>
- </set>
- where id_=#{id}
- </update>
- <select id="get" parameterType="string" resultMap="RoleMenuMap">
- select
- id_,role_id,menu_id,del_flag,create_by,create_time,update_by,update_time from sys_role_menu where id_=#{0}
- </select>
- <select id="exist" parameterType="string" resultType="int">
- select count(*) from sys_role_menu where id_=#{0}
- </select>
- <select id="list" resultMap="RoleMenuMap">
- select * from sys_role_menu
- </select>
- <select id="search" parameterType="hashmap" resultMap="RoleMenuMap">
- <![CDATA[
- select * from sys_role_menu
- ]]>
- <where>
- <if test="searchParams.id != null">
- and ID_ like #{searchParams.id}
- </if>
- </where>
- <foreach item="sort" collection="sortList" open="order by" separator=",">
- ${sort.name} ${sort.order}
- </foreach>
- </select>
- <select id="findByRoleId" parameterType="string" resultMap="RoleMenuMap">
- select * from sys_role_menu where role_id=#{0}
- </select>
- </mapper>
|