作者 朱兆平

暂时修复role的树形结构查询SQL mapper BUG

@@ -11,7 +11,6 @@ import lombok.extern.slf4j.Slf4j; @@ -11,7 +11,6 @@ import lombok.extern.slf4j.Slf4j;
11 import org.apache.commons.lang.StringUtils; 11 import org.apache.commons.lang.StringUtils;
12 import org.aspectj.lang.ProceedingJoinPoint; 12 import org.aspectj.lang.ProceedingJoinPoint;
13 import org.aspectj.lang.Signature; 13 import org.aspectj.lang.Signature;
14 -import org.aspectj.lang.annotation.After;  
15 import org.aspectj.lang.annotation.Around; 14 import org.aspectj.lang.annotation.Around;
16 import org.aspectj.lang.annotation.Aspect; 15 import org.aspectj.lang.annotation.Aspect;
17 import org.springframework.beans.factory.annotation.Autowired; 16 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,37 +14,15 @@ @@ -14,37 +14,15 @@
14 <result column="departmentId" jdbcType="VARCHAR" property="departmentid" /> 14 <result column="departmentId" jdbcType="VARCHAR" property="departmentid" />
15 <result column="mq_code" jdbcType="VARCHAR" property="mqcode" /> 15 <result column="mq_code" jdbcType="VARCHAR" property="mqcode" />
16 </resultMap> 16 </resultMap>
17 - <resultMap id="TreeWithPermResultMap" type="com.tianbo.warehouse.model.ROLE">  
18 - <id column="role_id" jdbcType="INTEGER" property="roleId" />  
19 - <result column="role_name" jdbcType="VARCHAR" property="roleName" />  
20 - <result column="role_sign" jdbcType="VARCHAR" property="roleSign" />  
21 - <result column="description" jdbcType="VARCHAR" property="description" />  
22 - <result column="type" jdbcType="VARCHAR" property="type" />  
23 - <result column="parentId" jdbcType="INTEGER" property="parentid" />  
24 - <result column="rsort" jdbcType="INTEGER" property="rsort" />  
25 - <result column="customs_reg_code" jdbcType="VARCHAR" property="customsRegCode" />  
26 - <result column="business_license" jdbcType="VARCHAR" property="businessLicense" />  
27 - <result column="departmentId" jdbcType="VARCHAR" property="departmentid" />  
28 - <result column="mq_code" jdbcType="VARCHAR" property="mqcode" /> 17 + <resultMap id="TreeWithPermResultMap" type="com.tianbo.warehouse.model.ROLE" extends="BaseResultMap">
29 <collection column="role_id" javaType="java.util.ArrayList" ofType="com.tianbo.warehouse.model.PERMISSION" property="permissions" select="com.tianbo.warehouse.dao.PERMISSIONMapper.getRolePermisson" /> 18 <collection column="role_id" javaType="java.util.ArrayList" ofType="com.tianbo.warehouse.model.PERMISSION" property="permissions" select="com.tianbo.warehouse.dao.PERMISSIONMapper.getRolePermisson" />
30 <collection column="role_id" property="children" select="selectByParentId" /> 19 <collection column="role_id" property="children" select="selectByParentId" />
31 - </resultMap>  
32 - <resultMap id="TreeWithResultMap" type="com.tianbo.warehouse.model.ROLE">  
33 - <id column="role_id" jdbcType="INTEGER" property="roleId" />  
34 - <result column="role_name" jdbcType="VARCHAR" property="roleName" />  
35 - <result column="role_sign" jdbcType="VARCHAR" property="roleSign" />  
36 - <result column="description" jdbcType="VARCHAR" property="description" />  
37 - <result column="type" jdbcType="VARCHAR" property="type" />  
38 - <result column="parentId" jdbcType="INTEGER" property="parentid" />  
39 - <result column="rsort" jdbcType="INTEGER" property="rsort" />  
40 - <result column="customs_reg_code" jdbcType="VARCHAR" property="customsRegCode" />  
41 - <result column="business_license" jdbcType="VARCHAR" property="businessLicense" />  
42 - <result column="departmentId" jdbcType="VARCHAR" property="departmentid" />  
43 - <result column="mq_code" jdbcType="VARCHAR" property="mqcode" />  
44 - <collection column="role_id" property="children" select="selectByParentId" />  
45 - </resultMap> 20 + </resultMap>
  21 + <resultMap id="TreeWithResultMap" type="com.tianbo.warehouse.model.ROLE" extends="BaseResultMap">
  22 + <collection column="role_id" property="children" select="selectByParentId" />
  23 + </resultMap>
46 <sql id="Base_Column_List"> 24 <sql id="Base_Column_List">
47 - role_id, role_name, role_sign, description, type, parentId, rsort, customs_reg_code, 25 + role_id, role_name, role_sign, description, `type`, parentId, rsort, customs_reg_code,
48 business_license, departmentId, mq_code 26 business_license, departmentId, mq_code
49 </sql> 27 </sql>
50 <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> 28 <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
@@ -53,7 +31,7 @@ @@ -53,7 +31,7 @@
53 from role 31 from role
54 where role_id = #{roleId,jdbcType=INTEGER} 32 where role_id = #{roleId,jdbcType=INTEGER}
55 </select> 33 </select>
56 - <select id="selectByParentId" parameterType="java.lang.Integer" resultMap="TreeWithResultMap"> 34 + <select id="selectByParentId" parameterType="java.lang.Integer" resultMap="TreeWithPermResultMap">
57 select 35 select
58 <include refid="Base_Column_List" /> 36 <include refid="Base_Column_List" />
59 from role 37 from role