...
|
...
|
@@ -32,6 +32,35 @@ |
|
|
<result column="age" property="age" jdbcType="INTEGER" />
|
|
|
<result column="company_id" property="companyId" jdbcType="INTEGER" />
|
|
|
</resultMap>
|
|
|
<resultMap id="WithRoleAndPermResultMap" type="com.tianbo.warehouse.model.USERS" extends="BaseResultMap">
|
|
|
<collection property="roles" javaType="java.util.ArrayList" ofType="com.tianbo.warehouse.model.ROLE">
|
|
|
<result column="role_id" jdbcType="INTEGER" property="roleId" />
|
|
|
<result column="role_name" jdbcType="VARCHAR" property="roleName" />
|
|
|
<result column="role_sign" jdbcType="VARCHAR" property="roleSign" />
|
|
|
<result column="rdescription" jdbcType="VARCHAR" property="description" />
|
|
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
|
|
<result column="parentId" jdbcType="INTEGER" property="parentid" />
|
|
|
<result column="rsort" jdbcType="INTEGER" property="rsort" />
|
|
|
<result column="customs_reg_code" jdbcType="VARCHAR" property="customsRegCode" />
|
|
|
<result column="business_license" jdbcType="VARCHAR" property="businessLicense" />
|
|
|
<result column="departmentId" jdbcType="VARCHAR" property="departmentid" />
|
|
|
<result column="mq_code" jdbcType="VARCHAR" property="mqcode" />
|
|
|
</collection>
|
|
|
<collection property="permissions" javaType="java.util.ArrayList" ofType="com.tianbo.warehouse.model.PERMISSION">
|
|
|
<result column="permission_id" property="permissionId" jdbcType="INTEGER" />
|
|
|
<result column="name" property="name" jdbcType="VARCHAR" />
|
|
|
<result column="permission_order" property="permissionOrder" jdbcType="VARCHAR" />
|
|
|
<result column="pdescription" property="description" jdbcType="VARCHAR" />
|
|
|
<result column="ismenu" property="ismenu" jdbcType="BOOLEAN" />
|
|
|
<result column="hidden" property="hidden" jdbcType="BOOLEAN" />
|
|
|
<result column="parent_id" property="parentId" jdbcType="INTEGER" />
|
|
|
<result column="path" property="path" jdbcType="VARCHAR" />
|
|
|
<result column="url" property="url" jdbcType="VARCHAR" />
|
|
|
<result column="method" property="method" jdbcType="VARCHAR" />
|
|
|
<result column="iconCls" property="iconCls" jdbcType="VARCHAR" />
|
|
|
<result column="component" property="component" jdbcType="VARCHAR" />
|
|
|
</collection>
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List" >
|
|
|
user_id, username, password, birthday, sex, address, state, mobilePhone, creatTime,
|
|
|
updateTime, userFace, realName, email, age,company_id
|
...
|
...
|
@@ -51,6 +80,27 @@ |
|
|
from users
|
|
|
where username = #{username,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectByUsernameWithRoleAndPerm" resultMap="WithRoleAndPermResultMap" parameterType="java.lang.String" >
|
|
|
select
|
|
|
u.user_id, username, password, birthday, sex, address, state, mobilePhone, creatTime,
|
|
|
updateTime, userFace, realName, email, age,company_id,
|
|
|
|
|
|
r.role_id, role_name, role_sign, r.description as rdescription, `type`, parentId, rsort, customs_reg_code,
|
|
|
business_license, departmentId, mq_code,
|
|
|
|
|
|
p.permission_id, `name`, permission_order, p.description as pdescription, ismenu,hidden,parent_id,
|
|
|
path, url, method, iconCls, component
|
|
|
from
|
|
|
(select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from users
|
|
|
where username = 'nmms') u
|
|
|
left join user_role ur on u.user_id = ur.user_id
|
|
|
left join role r on r.role_id = ur.role_id
|
|
|
left join role_permission rp on r.role_id = rp.role_id
|
|
|
left join permission p on rp.permission_id = p.permission_id
|
|
|
</select>
|
|
|
<select id="selectAllUser" resultMap="BaseResultMap" parameterType="com.tianbo.warehouse.model.USERS" >
|
|
|
select
|
|
|
<!-- <include refid="Base_Column_List" />-->
|
...
|
...
|
|