Commit b44df648 authored by luzhuang's avatar luzhuang

role

parent b4a00a8b
......@@ -29,9 +29,8 @@ public interface SysRoleRepository extends BaseMapper<SysRole> {
*/
@Select("<script>select * from tm_admin_role " +
"where r_status = 1 " +
"and r_id not in('主管理员','子管理员')" +
" order by create_date desc" +
"</script>")
"and r_id not in ('主管理员','子管理员') " +
" order by r_name desc </script>")
@ResultMap(value = "SelectAllAndUserNum")
List<SysRole> queryRoles();
......
......@@ -24,7 +24,7 @@ public class SysRole extends IdEntity<SysRole> {
private String roleName;
@Length(min = 1,max = 64,message = "长度最小为1,最大为50")
@NotBlank
private String code;
private String businessId;
@Transient
private int userNum;
......
......@@ -14,17 +14,9 @@
<result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
</resultMap>
<resultMap id="SelectAllAndUserNum" type="org.rcisoft.sys.role.entity.SysRole">
<id column="business_id" jdbcType="VARCHAR" property="businessId" />
<result column="role_name" jdbcType="VARCHAR" property="roleName" />
<result column="CODE" jdbcType="VARCHAR" property="code" />
<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"/>
<id column="r_id" jdbcType="VARCHAR" property="businessId" />
<result column="r_name" jdbcType="VARCHAR" property="roleName" />
<association property="userNum" column="r_id" select="countUserNum"/>
</resultMap>
<select id="countUserNum" parameterType="string" resultType="int">
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