|
@@ -2,18 +2,35 @@
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
<mapper namespace="com.bosshand.virgo.core.dao.IdentityDao">
|
|
<mapper namespace="com.bosshand.virgo.core.dao.IdentityDao">
|
|
|
|
|
|
|
|
+ <resultMap type="com.bosshand.virgo.core.model.Identity" id="result">
|
|
|
|
+ <id column="id" property="id"/>
|
|
|
|
+ <result column="name" property="name"/>
|
|
|
|
+ <result column="remark" property="remark"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
<resultMap type="com.bosshand.virgo.core.model.Identity" id="identityResult">
|
|
<resultMap type="com.bosshand.virgo.core.model.Identity" id="identityResult">
|
|
<id column="id" property="id"/>
|
|
<id column="id" property="id"/>
|
|
<result column="name" property="name"/>
|
|
<result column="name" property="name"/>
|
|
<result column="remark" property="remark"/>
|
|
<result column="remark" property="remark"/>
|
|
|
|
+ <collection property="resourceList" ofType="com.bosshand.virgo.core.model.IdentityResource" resultMap="com.bosshand.virgo.core.dao.IdentityResourceDao.result" columnPrefix="identityResult_"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
+ <sql id="query">
|
|
|
|
+ select a.*,
|
|
|
|
+ b.identityId as identityResult_identityId,
|
|
|
|
+ b.type as identityResult_type,
|
|
|
|
+ b.menus as identityResult_menus,
|
|
|
|
+ b.resource as identityResult_resource,
|
|
|
|
+ b.remark as identityResult_remark
|
|
|
|
+ from identity a LEFT JOIN identity_resource b ON a.id = b.identityId
|
|
|
|
+ </sql>
|
|
|
|
+
|
|
<select id="getList" resultMap="identityResult">
|
|
<select id="getList" resultMap="identityResult">
|
|
- select * from identity
|
|
|
|
|
|
+ <include refid="query"/>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getIds" resultMap="identityResult">
|
|
<select id="getIds" resultMap="identityResult">
|
|
- select * from identity id in
|
|
|
|
|
|
+ <include refid="query"/> where a.id in
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|