Commit b44df648 authored by luzhuang's avatar luzhuang

role

parent b4a00a8b
...@@ -29,9 +29,8 @@ public interface SysRoleRepository extends BaseMapper<SysRole> { ...@@ -29,9 +29,8 @@ public interface SysRoleRepository extends BaseMapper<SysRole> {
*/ */
@Select("<script>select * from tm_admin_role " + @Select("<script>select * from tm_admin_role " +
"where r_status = 1 " + "where r_status = 1 " +
"and r_id not in('主管理员','子管理员')" + "and r_id not in ('主管理员','子管理员') " +
" order by create_date desc" + " order by r_name desc </script>")
"</script>")
@ResultMap(value = "SelectAllAndUserNum") @ResultMap(value = "SelectAllAndUserNum")
List<SysRole> queryRoles(); List<SysRole> queryRoles();
......
...@@ -24,7 +24,7 @@ public class SysRole extends IdEntity<SysRole> { ...@@ -24,7 +24,7 @@ public class SysRole extends IdEntity<SysRole> {
private String roleName; private String roleName;
@Length(min = 1,max = 64,message = "长度最小为1,最大为50") @Length(min = 1,max = 64,message = "长度最小为1,最大为50")
@NotBlank @NotBlank
private String code; private String businessId;
@Transient @Transient
private int userNum; private int userNum;
......
...@@ -14,17 +14,9 @@ ...@@ -14,17 +14,9 @@
<result column="create_date" property="createDate" jdbcType="TIMESTAMP" /> <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
</resultMap> </resultMap>
<resultMap id="SelectAllAndUserNum" type="org.rcisoft.sys.role.entity.SysRole"> <resultMap id="SelectAllAndUserNum" type="org.rcisoft.sys.role.entity.SysRole">
<id column="business_id" jdbcType="VARCHAR" property="businessId" /> <id column="r_id" jdbcType="VARCHAR" property="businessId" />
<result column="role_name" jdbcType="VARCHAR" property="roleName" /> <result column="r_name" jdbcType="VARCHAR" property="roleName" />
<result column="CODE" jdbcType="VARCHAR" property="code" /> <association property="userNum" column="r_id" select="countUserNum"/>
<result column="checked" jdbcType="VARCHAR" property="checked" />
<result column="CREATE_BY" property="createBy" jdbcType="VARCHAR" />
<result column="FLAG" property="flag" jdbcType="VARCHAR" />
<result column="UPDATE_BY" property="updateBy" jdbcType="VARCHAR" />
<result column="DEL_FLAG" property="delFlag" jdbcType="VARCHAR" />
<result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
<result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
<association property="userNum" column="business_id" select="countUserNum"/>
</resultMap> </resultMap>
<select id="countUserNum" parameterType="string" resultType="int"> <select id="countUserNum" parameterType="string" resultType="int">
select count(*) select count(*)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment