初始化
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
<?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.adc.da.sys.dao.mysql.RoleOrgEODao" >
|
||||
<!-- Result Map-->
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.sys.entity.RoleOrgEO" >
|
||||
<result column="role_id" property="roleId" />
|
||||
<result column="org_id" property="orgId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- TR_ROLE_ORG table all fields -->
|
||||
<sql id="Base_Column_List" >
|
||||
role_id, org_id
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="Base_Where_Clause">
|
||||
where 1=1
|
||||
<trim suffixOverrides="," >
|
||||
<if test="roleId != null" >
|
||||
and role_id ${roleIdOperator} #{roleId}
|
||||
</if>
|
||||
<if test="orgId != null" >
|
||||
and org_id ${orgIdOperator} #{orgId}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<!-- 插入记录 -->
|
||||
<insert id="insert" parameterType="com.adc.da.sys.entity.RoleOrgEO" >
|
||||
insert into TR_ROLE_ORG(<include refid="Base_Column_List" />)
|
||||
values (#{roleId, jdbcType=VARCHAR}, #{orgId, jdbcType=VARCHAR})
|
||||
</insert>
|
||||
|
||||
<!-- 动态插入记录 主键是序列 -->
|
||||
<insert id="insertSelective" parameterType="com.adc.da.sys.entity.RoleOrgEO" >
|
||||
insert into TR_ROLE_ORG
|
||||
<trim prefix="(" suffix=")" suffixOverrides="," >
|
||||
<if test="roleId != null" >role_id,</if>
|
||||
<if test="orgId != null" >org_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
||||
<if test="roleId != null" >#{roleId, jdbcType=VARCHAR},</if>
|
||||
<if test="orgId != null" >#{orgId, jdbcType=VARCHAR},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- TR_ROLE_ORG 列表总数-->
|
||||
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
|
||||
select count(1) from TR_ROLE_ORG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
</select>
|
||||
|
||||
<!-- 查询TR_ROLE_ORG列表 -->
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List" /> from
|
||||
(select tmp_tb.* , rownum rn from
|
||||
(select <include refid="Base_Column_List" /> from TR_ROLE_ORG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
) tmp_tb where rownum <= ${pager.endIndex})
|
||||
where rn >= ${pager.startIndex}
|
||||
</select>
|
||||
|
||||
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
|
||||
select <include refid="Base_Column_List"/> from TR_ROLE_ORG
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
|
||||
${pager.orderCondition}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleOrgByRoleId" parameterType="java.lang.String">
|
||||
delete from TR_ROLE_ORG ro where ro.role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<select id="queryOrgIdList" resultType="java.lang.String" parameterType="java.lang.String">
|
||||
select org_id from TR_ROLE_ORG where role_id in
|
||||
<foreach item="roleId" collection="array" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user