Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
77e7bc5369
|
|
@ -15,35 +15,35 @@ public interface CompanyDao {
|
|||
|
||||
List<CompanyBean> list(@Param("params")Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
|
||||
|
||||
@Select("SELECT id,NAME AS companyName FROM pm_company where name = #{companyName} and is_active = '1'")
|
||||
@Select("SELECT \"id\",\"name\" AS companyName FROM \"ynrealname\".\"pm_company\" where \"name\" = #{companyName} and \"is_active\" = '1'")
|
||||
CompanyBean getCompanyByName(String companyName);
|
||||
|
||||
@Options(useGeneratedKeys = true, keyProperty = "id")
|
||||
@Insert("INSERT INTO `pm_company`(`NAME`, `type_id`, `address`, `register_date`, `legal_person`, `legal_phone`, `legal_idnumber`, `IS_ACTIVE`) VALUES (#{companyName}, #{unitType}, #{address}, #{registerDate}, #{represent}, #{representPhone}, #{representIdNumber}, '1')")
|
||||
@SelectKey(statement = "SELECT IDENTITY()", keyProperty = "id", before = false, resultType = Long.class)
|
||||
@Insert("INSERT INTO \"ynrealname\".\"pm_company\"(\"name\", \"type_id\", \"address\", \"register_date\", \"legal_person\", \"legal_phone\", \"legal_idnumber\", \"is_active\") VALUES (#{companyName}, #{unitType}, #{address}, #{registerDate}, #{represent}, #{representPhone}, #{representIdNumber}, '1')")
|
||||
int saveCompany(CompanyBean o);
|
||||
|
||||
@Select("select id,NAME AS companyName,type_id as unitType,legal_person as represent,`legal_phone` as representPhone, `legal_idnumber` as representIdNumber, register_date as registerDate, address from `pm_company` where id = #{id}")
|
||||
@Select("select \"id\",\"name\" AS companyName,\"type_id\" as unitType,\"legal_person\" as represent,\"legal_phone\" as representPhone, \"legal_idnumber\" as representIdNumber, \"register_date\" as registerDate, \"address\" from \"ynrealname\".\"pm_company\" where \"id\" = #{id}")
|
||||
CompanyBean getCompanyById(Long id);
|
||||
|
||||
int updateCompany(CompanyBean o);
|
||||
|
||||
@Select("select ID as companyId,NAME as companyName from pm_company where IS_ACTIVE = '1'")
|
||||
@Select("select \"id\" as companyId,\"name\" as companyName from \"ynrealname\".\"pm_company\" where \"is_active\" = '1'")
|
||||
List<ProjectBean> getCompanyKeyValue();
|
||||
|
||||
|
||||
@Select("select ID from pm_company where NAME = #{name}")
|
||||
@Select("select \"id\" from \"ynrealname\".\"pm_company\" where \"name\" = #{name}")
|
||||
Integer getCompanyIdByName(String name);
|
||||
|
||||
@Select("select ID from pm_organization where IS_ACTIVE = '1' and `NAME` = #{name} ")
|
||||
@Select("select \"id\" from \"ynrealname\".\"pm_organization\" where \"is_active\" = '1' and \"name\" = #{name}")
|
||||
Integer getOrgIdByName(String name);
|
||||
|
||||
@Select("SELECT id FROM t_dict WHERE `value` = #{value} AND is_active = '1'")
|
||||
@Select("SELECT \"id\" FROM \"ynrealname\".\"t_dict\" WHERE \"value\" = #{value} AND \"is_active\" = '1'")
|
||||
Integer getLevelIdByValue(String value);
|
||||
|
||||
@Select("SELECT id FROM bm_owner WHERE owner_name = #{name} AND is_active = '1'")
|
||||
@Select("SELECT \"id\" FROM \"ynrealname\".\"bm_owner\" WHERE \"owner_name\" = #{name} AND \"is_active\" = '1'")
|
||||
Integer getOwnerIdByName(String name);
|
||||
|
||||
@Update("update pm_company set is_active = '0' where id = #{id}")
|
||||
@Update("update \"ynrealname\".\"pm_company\" set \"is_active\" = '0' where \"id\" = #{id}")
|
||||
int deleteCompany(Long id);
|
||||
|
||||
int saveCompanyWithOrg(CompanyBean o);
|
||||
|
|
@ -52,6 +52,6 @@ public interface CompanyDao {
|
|||
|
||||
void deleteCompanyWithOrg(Long id);
|
||||
|
||||
@Select("select id,value as name from t_dict where type = 'infrastructure_project_type' and is_active = '1'")
|
||||
@Select("select \"id\",\"value\" as name from \"ynrealname\".\"t_dict\" where \"type\" = 'infrastructure_project_type' and \"is_active\" = '1'")
|
||||
List<ZNode> getProType();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,31 +8,31 @@ import java.util.Set;
|
|||
@Mapper
|
||||
public interface PermissionDao {
|
||||
|
||||
@Select("select * from \"ynrealname\".\"sys_permission\" t where IS_ACTIVE = 1 order by t.SORT")
|
||||
@Select("select * from \"ynrealname\".\"sys_permission\" t where \"is_active\" = 1 order by t.\"sort\"")
|
||||
List<Permission> listAll();
|
||||
|
||||
@Select("select * from \"ynrealname\".\"sys_permission\" t where t.TYPE = 1 and \"permission_type\" = '后台' and IS_ACTIVE = 1 order by t.SORT")
|
||||
@Select("select * from \"ynrealname\".\"sys_permission\" t where t.\"type\" = 1 and \"permission_type\" = '后台' and \"is_active\" = 1 order by t.\"sort\"")
|
||||
List<Permission> listParents();
|
||||
|
||||
@Select("select distinct p.* from \"ynrealname\".\"sys_permission\" p inner join \"ynrealname\".\"sys_role_permission\" rp on p.ID = rp.\"permissionId\" inner join \"ynrealname\".\"sys_role_user\" ru on ru.\"roleId\" = rp.\"roleId\" where p.IS_ACTIVE = 1 and rp.\"is_active\" = 1 and ru.\"is_active\" = 1 and ru.\"userId\" = #{userId} order by p.SORT")
|
||||
@Select("select distinct p.* from \"ynrealname\".\"sys_permission\" p inner join \"ynrealname\".\"sys_role_permission\" rp on p.\"id\" = rp.\"permissionId\" inner join \"ynrealname\".\"sys_role_user\" ru on ru.\"roleId\" = rp.\"roleId\" where p.\"is_active\" = 1 and rp.\"is_active\" = 1 and ru.\"is_active\" = 1 and ru.\"userId\" = #{userId} order by p.\"sort\"")
|
||||
List<Permission> listByUserId(Long userId);
|
||||
|
||||
@Select("select p.* from \"ynrealname\".\"sys_permission\" p inner join \"ynrealname\".\"sys_role_permission\" rp on p.ID = rp.\"permissionId\" where p.IS_ACTIVE = 1 and rp.\"is_active\" = 1 and rp.\"roleId\" = #{roleId} order by p.SORT")
|
||||
@Select("select p.* from \"ynrealname\".\"sys_permission\" p inner join \"ynrealname\".\"sys_role_permission\" rp on p.\"id\" = rp.\"permissionId\" where p.\"is_active\" = 1 and rp.\"is_active\" = 1 and rp.\"roleId\" = #{roleId} order by p.\"sort\"")
|
||||
List<Permission> listByRoleId(Long roleId);
|
||||
|
||||
@Select("select * from \"ynrealname\".\"sys_permission\" t where t.IS_ACTIVE = 1 and t.ID = #{id}")
|
||||
@Select("select * from \"ynrealname\".\"sys_permission\" t where t.\"is_active\" = 1 and t.\"id\" = #{id}")
|
||||
Permission getById(Long id);
|
||||
|
||||
@Insert("insert into \"ynrealname\".\"sys_permission\"(\"parentId\", NAME, \"css\", \"href\", TYPE, \"permission\", SORT, \"permission_type\") values(#{parentId}, #{name}, #{css}, #{href}, #{type}, #{permission}, #{sort}, #{permissionType})")
|
||||
@Insert("insert into \"ynrealname\".\"sys_permission\"(\"parentId\", \"name\", \"css\", \"href\", \"type\", \"permission\", \"sort\", \"permission_type\") values(#{parentId}, #{name}, #{css}, #{href}, #{type}, #{permission}, #{sort}, #{permissionType})")
|
||||
int save(Permission permission);
|
||||
|
||||
@Update("update \"ynrealname\".\"sys_permission\" t set \"parentId\" = #{parentId}, NAME = #{name}, \"css\" = #{css}, \"href\" = #{href}, TYPE = #{type}, \"permission\" = #{permission}, SORT = #{sort}, \"permission_type\" = #{permissionType} where t.ID = #{id}")
|
||||
@Update("update \"ynrealname\".\"sys_permission\" t set \"parentId\" = #{parentId}, \"name\" = #{name}, \"css\" = #{css}, \"href\" = #{href}, \"type\" = #{type}, \"permission\" = #{permission}, \"sort\" = #{sort}, \"permission_type\" = #{permissionType} where t.\"id\" = #{id}")
|
||||
int update(Permission permission);
|
||||
|
||||
@Delete("update \"ynrealname\".\"sys_permission\" set \"is_active\" = '0' where \"id\" in ( ${id} )")
|
||||
int delete(String id);
|
||||
|
||||
@Delete("update \"ynrealname\".\"sys_permission\" set IS_ACTIVE = '0' where \"parentId\" = #{id}")
|
||||
@Delete("update \"ynrealname\".\"sys_permission\" set \"is_active\" = '0' where \"parentId\" = #{id}")
|
||||
int deleteByParentId(Long id);
|
||||
|
||||
@Delete("delete from \"ynrealname\".\"sys_role_permission\" where \"permissionId\" = #{permissionId}")
|
||||
|
|
@ -41,26 +41,26 @@ public interface PermissionDao {
|
|||
@Select("select ru.\"userId\" from \"ynrealname\".\"sys_role_permission\" rp inner join \"ynrealname\".\"sys_role_user\" ru on ru.\"roleId\" = rp.\"roleId\" where rp.\"permissionId\" = #{permissionId}")
|
||||
Set<Long> listUserIds(Long permissionId);
|
||||
|
||||
@Select("select * from \"ynrealname\".\"sys_permission\" t where t.IS_ACTIVE = '1' AND t.\"permission_type\"='APP' order by t.SORT")
|
||||
@Select("select * from \"ynrealname\".\"sys_permission\" t where t.\"is_active\" = '1' AND t.\"permission_type\"='APP' order by t.\"sort\"")
|
||||
List<Permission> listAppAll();
|
||||
|
||||
@Select("select * from \"ynrealname\".\"sys_permission\" t where t.IS_ACTIVE = '1' AND t.\"permission_type\"='后台' order by t.SORT")
|
||||
@Select("select * from \"ynrealname\".\"sys_permission\" t where t.\"is_active\" = '1' AND t.\"permission_type\"='后台' order by t.\"sort\"")
|
||||
List<Permission> listBackAll();
|
||||
|
||||
@Select("select a.* from ( select p.* from \"ynrealname\".\"sys_permission\" p " +
|
||||
"inner join \"ynrealname\".\"sys_role_permission\" rp on p.ID = rp.\"permissionId\" " +
|
||||
"where rp.\"roleId\" = #{backRoleId} and p.IS_ACTIVE = '1' " +
|
||||
"inner join \"ynrealname\".\"sys_role_permission\" rp on p.\"id\" = rp.\"permissionId\" " +
|
||||
"where rp.\"roleId\" = #{backRoleId} and p.\"is_active\" = '1' " +
|
||||
"and rp.\"is_active\" = 1 AND p.\"permission_type\"='后台' " +
|
||||
"order by p.SORT ) a inner join \"ynrealname\".\"sys_permission\" p on p.ID = a.\"parentId\" " +
|
||||
"and p.IS_ACTIVE = '1' union " +
|
||||
"order by p.\"sort\" ) a inner join \"ynrealname\".\"sys_permission\" p on p.\"id\" = a.\"parentId\" " +
|
||||
"and p.\"is_active\" = '1' union " +
|
||||
"select * from ( select p.* from \"ynrealname\".\"sys_permission\" p " +
|
||||
"INNER JOIN \"ynrealname\".\"sys_role_permission\" rp ON p.ID = rp.\"permissionId\" " +
|
||||
"WHERE rp.\"roleId\" = #{backRoleId} AND p.IS_ACTIVE = '1' " +
|
||||
"INNER JOIN \"ynrealname\".\"sys_role_permission\" rp ON p.\"id\" = rp.\"permissionId\" " +
|
||||
"WHERE rp.\"roleId\" = #{backRoleId} AND p.\"is_active\" = '1' " +
|
||||
"AND rp.\"is_active\" = '1' AND p.\"permission_type\" = '后台' " +
|
||||
"and p.\"parentId\" = 0 )b")
|
||||
List<Permission> listByBack(Long backRoleId);
|
||||
|
||||
@Select("select p.* from \"ynrealname\".\"sys_permission\" p inner join \"ynrealname\".\"sys_role_permission\" rp on p.ID = rp.\"permissionId\" where rp.\"roleId\" = #{appRoleId} and p.IS_ACTIVE = '1' and rp.\"is_active\" = 1 AND p.\"permission_type\"='APP' order by p.SORT")
|
||||
@Select("select p.* from \"ynrealname\".\"sys_permission\" p inner join \"ynrealname\".\"sys_role_permission\" rp on p.\"id\" = rp.\"permissionId\" where rp.\"roleId\" = #{appRoleId} and p.\"is_active\" = '1' and rp.\"is_active\" = 1 AND p.\"permission_type\"='APP' order by p.\"sort\"")
|
||||
List<Permission> listByBackApp(Long appRoleId);
|
||||
|
||||
@Select("select getPermissionChildList(#{id})")
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public interface ProjectDao {
|
|||
|
||||
String getEinTime(ProjectBean bean);
|
||||
|
||||
@Select("select t.value as val,type,id as k from t_dict t where t.type = #{type} and is_active='1'")
|
||||
@Select("select t.\"value\" as val,\"type\",\"id\" as k from \"ynrealname\".\"t_dict\" t where t.\"type\" = #{type} and \"is_active\"='1'")
|
||||
List<Dict> listByType(String type);
|
||||
|
||||
ProjectBean getOrg(String companyId);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ import java.util.Map;
|
|||
@Mapper
|
||||
public interface RoleDao {
|
||||
|
||||
@Options(useGeneratedKeys = true, keyProperty = "id")
|
||||
@Insert("insert into sys_role(name, company_id, description, type, level, status) values(#{name}, #{companyId}, #{description}, #{type}, #{level}, #{status})")
|
||||
@SelectKey(statement = "SELECT IDENTITY()", keyProperty = "id", before = false, resultType = Long.class)
|
||||
@Insert("insert into \"ynrealname\".\"sys_role\"(\"name\", \"company_id\", \"description\", \"type\", \"level\", \"status\") values(#{name}, #{companyId}, #{description}, #{type}, #{level}, #{status})")
|
||||
int save(Role role);
|
||||
|
||||
int count(@Param("params") Map<String, Object> params);
|
||||
|
|
@ -20,26 +20,26 @@ public interface RoleDao {
|
|||
|
||||
Role getById(Long id);
|
||||
|
||||
@Select("select * from sys_role t where t.name = #{name} and t.company_id = #{companyId} and t.is_active = '1'")
|
||||
@Select("select * from \"ynrealname\".\"sys_role\" t where t.\"name\" = #{name} and t.\"company_id\" = #{companyId} and t.\"is_active\" = '1'")
|
||||
Role getRole(@Param("companyId") String companyId,@Param("name")String name);
|
||||
|
||||
@Update("update sys_role set name = #{name}, company_id = #{companyId}, description = #{description}, type = #{type}, level = #{level}, status = #{status} where id = #{id}")
|
||||
@Update("update \"ynrealname\".\"sys_role\" set \"name\" = #{name}, \"company_id\" = #{companyId}, \"description\" = #{description}, \"type\" = #{type}, \"level\" = #{level}, \"status\" = #{status} where \"id\" = #{id}")
|
||||
int update(Role role);
|
||||
|
||||
@Select("select * from sys_role r inner join sys_role_user ru on r.id = ru.roleId where ru.userId = #{userId}")
|
||||
@Select("select * from \"ynrealname\".\"sys_role\" r inner join \"ynrealname\".\"sys_role_user\" ru on r.\"id\" = ru.\"roleId\" where ru.\"userId\" = #{userId}")
|
||||
List<Role> listByUserId(Long userId);
|
||||
|
||||
@Delete("delete from sys_role_permission where roleId = #{roleId}")
|
||||
@Delete("delete from \"ynrealname\".\"sys_role_permission\" where \"roleId\" = #{roleId}")
|
||||
int deleteRolePermission(Long roleId);
|
||||
|
||||
int saveRolePermission(@Param("roleId") Long roleId, @Param("permissionIds") List<Long> permissionIds);
|
||||
|
||||
@Update("update sys_role set is_active = '0' where id = #{id}")
|
||||
@Update("update \"ynrealname\".\"sys_role\" set \"is_active\" = '0' where \"id\" = #{id}")
|
||||
int delete(Long id);
|
||||
|
||||
@Delete("delete from sys_role_user where roleId = #{roleId}")
|
||||
@Delete("delete from \"ynrealname\".\"sys_role_user\" where \"roleId\" = #{roleId}")
|
||||
int deleteRoleUser(Long roleId);
|
||||
|
||||
@Update("update sys_role set status = #{status} where id = #{id}")
|
||||
@Update("update \"ynrealname\".\"sys_role\" set \"status\" = #{status} where \"id\" = #{id}")
|
||||
int updateStatus(Role o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,22 +13,22 @@ public interface SubCompanyDao {
|
|||
|
||||
List<SubCompanyBean> list(@Param("params")Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
|
||||
|
||||
@Select("SELECT id,NAME AS subCompanyName FROM pm_dept where name = #{companyName} and is_active = '1'")
|
||||
@Select("SELECT \"id\",\"name\" AS subCompanyName FROM \"ynrealname\".\"pm_dept\" where \"name\" = #{companyName} and \"is_active\" = '1'")
|
||||
SubCompanyBean getCompanyByName(String companyName);
|
||||
|
||||
@Options(useGeneratedKeys = true, keyProperty = "id")
|
||||
@Insert("INSERT INTO `pm_dept`(`NAME`, `abbreviation`, `company_id`, `status`, `IS_ACTIVE`) VALUES (#{subCompanyName}, #{abbreviation}, #{companyId}, '1', '1')")
|
||||
@SelectKey(statement = "SELECT IDENTITY()", keyProperty = "id", before = false, resultType = Long.class)
|
||||
@Insert("INSERT INTO \"ynrealname\".\"pm_dept\"(\"name\", \"abbreviation\", \"company_id\", \"status\", \"is_active\") VALUES (#{subCompanyName}, #{abbreviation}, #{companyId}, '1', '1')")
|
||||
int saveCompany(SubCompanyBean o);
|
||||
|
||||
@Select("select id,NAME AS subCompanyName,company_id as companyId,abbreviation from `pm_dept` where id = #{id}")
|
||||
@Select("select \"id\",\"name\" AS subCompanyName,\"company_id\" as companyId,\"abbreviation\" from \"ynrealname\".\"pm_dept\" where \"id\" = #{id}")
|
||||
SubCompanyBean getCompanyById(Long id);
|
||||
|
||||
int updateCompany(SubCompanyBean o);
|
||||
|
||||
@Update("update pm_dept set is_active = '0' where id = #{id}")
|
||||
@Update("update \"ynrealname\".\"pm_dept\" set \"is_active\" = '0' where \"id\" = #{id}")
|
||||
int deleteCompany(Long id);
|
||||
|
||||
@Update("update pm_dept set status = #{status} where id = #{id}")
|
||||
@Update("update \"ynrealname\".\"pm_dept\" set \"status\" = #{status} where \"id\" = #{id}")
|
||||
int updateCompanyStatus(SubCompanyBean o);
|
||||
|
||||
int saveSubCompanyWithOrg(SubCompanyBean o);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public interface UserDao {
|
|||
|
||||
UserBean getById(Long id);
|
||||
|
||||
@Select("select t.id as userId,t.* from \"ynrealname\".\"sys_user\" t where t.\"username\" = #{username}")
|
||||
@Select("select t.\"id\" as userId,t.* from \"ynrealname\".\"sys_user\" t where t.\"username\" = #{username}")
|
||||
SysUser getUser(String username);
|
||||
|
||||
@Update("update \"ynrealname\".\"sys_user\" t set t.\"password\" = #{password} where t.\"id\" = #{id}")
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<if test="params.keyWord != null and params.keyWord != ''">
|
||||
and (
|
||||
t."name" like concat('%', #{params.keyWord}, '%') or
|
||||
pc.NAME like concat('%', #{params.keyWord}, '%') or
|
||||
pc."name" like concat('%', #{params.keyWord}, '%') or
|
||||
t."description" like concat('%', #{params.keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
|
|
@ -19,14 +19,14 @@
|
|||
|
||||
<select id="count" resultType="int">
|
||||
select count(1) from "ynrealname"."sys_role" t
|
||||
LEFT JOIN "ynrealname"."pm_company" pc ON t."company_id" = pc.ID
|
||||
LEFT JOIN "ynrealname"."pm_company" pc ON t."company_id" = pc."id"
|
||||
<include refid="where" />
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.bonus.system.api.model.Role">
|
||||
SELECT
|
||||
t."id",
|
||||
pc.NAME AS companyName,
|
||||
pc."name" AS companyName,
|
||||
t."name",
|
||||
t."description",
|
||||
CONCAT(
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
t."updateTime" as changeTime
|
||||
FROM
|
||||
"ynrealname"."sys_role" t
|
||||
LEFT JOIN "ynrealname"."pm_company" pc ON t."company_id" = pc.ID and pc.IS_ACTIVE = '1'
|
||||
LEFT JOIN "ynrealname"."pm_company" pc ON t."company_id" = pc."id" and pc."is_active" = '1'
|
||||
<include refid="where" />
|
||||
order by t."level" ASC
|
||||
<if test="offset != null and offset >= 0 and limit != null and limit >= 0">
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
SELECT
|
||||
t."id",
|
||||
t."company_id" as companyId,
|
||||
pc.NAME AS companyName,
|
||||
pc."name" AS companyName,
|
||||
t."name",
|
||||
t."description",
|
||||
t."type",
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
t."updateTime" as changeTime
|
||||
FROM
|
||||
"ynrealname"."sys_role" t
|
||||
LEFT JOIN "ynrealname"."pm_company" pc ON t."company_id" = pc.ID
|
||||
LEFT JOIN "ynrealname"."pm_company" pc ON t."company_id" = pc."id"
|
||||
where t."id" = #{id}
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
select count(1)
|
||||
FROM
|
||||
"ynrealname"."sys_user" t
|
||||
LEFT JOIN "ynrealname"."pm_organization" po ON t."org_id" = po.ID
|
||||
LEFT JOIN "ynrealname"."pm_organization" po ON t."org_id" = po."id"
|
||||
LEFT JOIN "ynrealname"."sys_role_user" sru ON sru."userId" = t."id" and sru."is_active" = '1'
|
||||
LEFT JOIN "ynrealname"."sys_role" sr ON sr."id" = sru."roleId"
|
||||
LEFT JOIN "ynrealname"."bm_project" bp ON bp."id" = t."pro_id"
|
||||
|
|
@ -21,10 +21,10 @@
|
|||
and t."phone" like concat('%', #{params.phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.orgId != null and params.orgId != '' and params.roleLevel < 3">
|
||||
AND po.ID in (${params.orgAll})
|
||||
AND po."id" in (${params.orgAll})
|
||||
</if>
|
||||
<if test="params.orgId != null and params.orgId != '' and params.roleLevel >= 3">
|
||||
AND po.ID = #{params.orgId}
|
||||
AND po."id" = #{params.orgId}
|
||||
</if>
|
||||
<if test="params.keyWord != null and params.keyWord != ''">
|
||||
and (
|
||||
|
|
@ -43,8 +43,8 @@
|
|||
t."id_number" AS idNumber,
|
||||
t."phone" AS phonenumber,
|
||||
CASE
|
||||
WHEN sr."type" LIKE '%3%' THEN po2.NAME
|
||||
ELSE po.NAME
|
||||
WHEN sr."type" LIKE '%3%' THEN po2."name"
|
||||
ELSE po."name"
|
||||
END AS orgName,
|
||||
sr."name" AS roleName,
|
||||
CASE
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
t."is_push"
|
||||
FROM
|
||||
"ynrealname"."sys_user" t
|
||||
LEFT JOIN "ynrealname"."pm_organization" po ON t."org_id" = po.ID
|
||||
LEFT JOIN "ynrealname"."pm_organization" po ON t."org_id" = po."id"
|
||||
LEFT JOIN "ynrealname"."sys_role_user" sru ON sru."userId" = t."id"
|
||||
AND sru."is_active" = '1'
|
||||
LEFT JOIN "ynrealname"."sys_role" sr ON sr."id" = sru."roleId"
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
LEFT JOIN "ynrealname"."bm_sub_relation" bsr ON bsr."v" = btur."team_id" and bsr."is_active" = '1' and bsr."type" = '3'
|
||||
LEFT JOIN "ynrealname"."bm_sub_contract" bsc ON bsc."id" = bsr."sub_contract_id" and bsc."is_active" = '1'
|
||||
LEFT JOIN "ynrealname"."bm_project" bp ON bp."id" = bsc."pro_id" and bp."is_active" = '1'
|
||||
LEFT JOIN "ynrealname"."pm_organization" po2 ON bp."company_id" = po2.ID
|
||||
LEFT JOIN "ynrealname"."pm_organization" po2 ON bp."company_id" = po2."id"
|
||||
LEFT JOIN ( SELECT "id_number", "project_id", "is_furlough_person" FROM "ynrealname"."bm_worker_ein_history" WHERE ( "is_furlough_person" = '1' OR "exit_status" != 1 ) AND "is_active" = '1' FETCH FIRST 1 ROWS ONLY) bweh ON bweh."id_number" = t."id_number"
|
||||
LEFT JOIN "ynrealname"."bm_project" bp2 ON bp2."id" = bweh."project_id"
|
||||
<where>
|
||||
|
|
@ -78,10 +78,10 @@
|
|||
and t."phone" like concat('%', #{params.phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.orgId != null and params.orgId != '' and params.roleLevel < 3">
|
||||
AND po.ID in (${params.orgAll})
|
||||
AND po."id" in (${params.orgAll})
|
||||
</if>
|
||||
<if test="params.orgId != null and params.orgId != '' and params.roleLevel >= 3">
|
||||
AND po.ID = #{params.orgId}
|
||||
AND po."id" = #{params.orgId}
|
||||
</if>
|
||||
<if test="params.keyWord != null and params.keyWord != ''">
|
||||
and (
|
||||
|
|
@ -149,13 +149,13 @@
|
|||
END as isBlacklist,
|
||||
role."type" as auth
|
||||
FROM
|
||||
( SELECT "id", "username", "phone", ID_NUMBER FROM "ynrealname"."sys_user"
|
||||
( SELECT "id", "username", "phone", "id_number" FROM "ynrealname"."sys_user"
|
||||
WHERE "is_push" != 1 AND "is_active" = '1' AND "phone" is not null
|
||||
<if test="id != null and id != ''">
|
||||
and "id" = #{id}
|
||||
</if>
|
||||
FETCH FIRST 30 ROWS ONLY ) "user"
|
||||
LEFT JOIN "ynrealname"."bm_blacklist_worker" blaceUser ON "user".ID_NUMBER = blaceUser.ID_NUMBER
|
||||
LEFT JOIN "ynrealname"."bm_blacklist_worker" blaceUser ON "user"."id_number" = blaceUser."id_number"
|
||||
LEFT JOIN "ynrealname"."sys_role_user" roleUser ON "user"."id" = roleUser."userId"
|
||||
AND roleUser."is_active" = '1'
|
||||
LEFT JOIN "ynrealname"."sys_role" role ON "role"."id" = roleUser."roleId"
|
||||
|
|
@ -259,12 +259,12 @@
|
|||
where t."id" = #{id}
|
||||
</update>
|
||||
<update id="pwdChange">
|
||||
UPDATE "ynrealname"."sys_user" SET "password" = #{passWord} WHERE "phone" = #{phone} and IS_ACTIVE='1'
|
||||
UPDATE "ynrealname"."sys_user" SET "password" = #{passWord} WHERE "phone" = #{phone} and "is_active"='1'
|
||||
</update>
|
||||
|
||||
<update id="updateUserPushStatus">
|
||||
<foreach collection="list" item="user" separator=";">
|
||||
UPDATE "ynrealname"."sys_user" SET "is_push"= #{user.status} WHERE "phone" = #{user.phone} and IS_ACTIVE = #{user.isActive}
|
||||
UPDATE "ynrealname"."sys_user" SET "is_push"= #{user.status} WHERE "phone" = #{user.phone} and "is_active" = #{user.isActive}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -249,8 +249,8 @@
|
|||
bbl."name" LIKE concat('%', #{params.keyWord}, '%')
|
||||
or bbl."id_number" LIKE concat('%', #{params.keyWord}, '%')
|
||||
or bbl."pro_name" LIKE concat('%', #{params.keyWord}, '%')
|
||||
or bbl."sub_name" LIKE concat('%', #{params.keyWord}, '%')
|
||||
or bbl."event" LIKE concat('%', #{params.keyWord}, '%')
|
||||
or bbl."sub_name" LIKE concat('%', #{params.subName}, '%')
|
||||
or bbl."event" LIKE concat('%', #{params.event}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test='params.status != null and params.status !=""'>
|
||||
|
|
@ -274,10 +274,10 @@
|
|||
AND
|
||||
(
|
||||
bbl."name" LIKE concat('%', #{params.keyWord}, '%')
|
||||
or bbl."id_number" LIKE concat('%', #{params.keyWord}, '%')
|
||||
or bbl."pro_name" LIKE concat('%', #{params.keyWord}, '%')
|
||||
or bbl."sub_name" LIKE concat('%', #{params.keyWord}, '%')
|
||||
or bbl."event" LIKE concat('%', #{params.keyWord}, '%')
|
||||
or bbl."id_number" LIKE concat('%', #{params.idNumber}, '%')
|
||||
or bbl."pro_name" LIKE concat('%', #{params.proName}, '%')
|
||||
or bbl."sub_name" LIKE concat('%', #{params.subName}, '%')
|
||||
or bbl."event" LIKE concat('%', #{params.event}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test='params.status != null and params.status !=""'>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ import java.util.List;
|
|||
@Mapper
|
||||
public interface DictDao {
|
||||
|
||||
@Select("select t.value as val,type,id as k from t_dict t where t.type = #{type} and t.is_active = '1'")
|
||||
@Select("select t.\"value\" as val, t.\"type\", t.\"id\" as k from \"ynrealname\".\"t_dict\" t where t.\"type\" = #{type} and t.\"is_active\" = '1'")
|
||||
List<Dict> listByType(String type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ public interface PermissionDao {
|
|||
@Select("SELECT" +
|
||||
"\tDISTINCT p.*\n" +
|
||||
"FROM \"ynrealname\".\"sys_permission\" p\n" +
|
||||
"INNER JOIN \"ynrealname\".\"sys_role_permission\" rp ON p.ID = rp.\"permissionId\" AND rp.\"is_active\" = 1\n" +
|
||||
"INNER JOIN \"ynrealname\".\"sys_role_permission\" rp ON p.\"id\" = rp.\"permissionId\" AND rp.\"is_active\" = 1\n" +
|
||||
"INNER JOIN \"ynrealname\".\"sys_role_user\" ru ON ru.\"roleId\" = rp.\"roleId\" AND ru.\"is_active\" = 1\n" +
|
||||
"WHERE ru.\"userId\" = #{userId} AND ru.\"is_active\" = 1 AND p.is_active = 1\n" +
|
||||
"ORDER BY p.sort")
|
||||
"WHERE ru.\"userId\" = #{userId} AND ru.\"is_active\" = 1 AND p.\"is_active\" = 1\n" +
|
||||
"ORDER BY p.\"sort\"")
|
||||
List<Permission> listByUserId(Long userId);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
<select id="getCompany" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
SELECT "id","name" FROM "ynrealname"."pm_company"
|
||||
WHERE IS_ACTIVE = '1'
|
||||
WHERE "is_active" = '1'
|
||||
<if test="companyId != null and companyId != ''">
|
||||
AND "id" = #{companyId}
|
||||
</if>
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
WHERE bp."is_active" = '1'
|
||||
<if test="companyId != null and companyId != ''">
|
||||
and bp."company_id" = (
|
||||
SELECT "id" FROM "ynrealname"."pm_organization" WHERE "is_active" = '1' and PARENT_ID = '0' and "foreign_id" = #{companyId})
|
||||
SELECT "id" FROM "ynrealname"."pm_organization" WHERE "is_active" = '1' and "parent_id" = '0' and "foreign_id" = #{companyId})
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
|
@ -43,19 +43,19 @@
|
|||
|
||||
<select id="getCompanyAndSubCompany" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
SELECT
|
||||
ID,
|
||||
NAME,
|
||||
"id",
|
||||
"name",
|
||||
CASE WHEN "company_id" = "foreign_id" THEN 1 ELSE 2 END as type
|
||||
FROM
|
||||
"ynrealname"."pm_organization"
|
||||
WHERE
|
||||
IS_ACTIVE = '1'
|
||||
"is_active" = '1'
|
||||
AND "foreign_id" IS NOT NULL
|
||||
<if test="orgId != null and orgId != '' and roleLevel < 3 and roleLevel > 1">
|
||||
AND INSTR(ID, getParentList(#{orgId})) > 0
|
||||
AND INSTR("id", getParentList(#{orgId})) > 0
|
||||
</if>
|
||||
<if test="orgId != null and orgId != '' and roleLevel >= 3">
|
||||
AND INSTR(ID, getParentList(#{orgId})) > 0
|
||||
AND INSTR("id", getParentList(#{orgId})) > 0
|
||||
OFFSET 1 ROWS FETCH NEXT 1 ROWS ONLY
|
||||
</if>
|
||||
</select>
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
<select id="getPrincipal" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
SELECT
|
||||
su."id",
|
||||
su."username" AS NAME,
|
||||
su."username" AS "name",
|
||||
COUNT(DISTINCT bp."id") as proNum,
|
||||
<![CDATA[ NVL(WM_CONCAT(bp."name"||'<br/>') ,'无')as proName ]]>
|
||||
FROM
|
||||
|
|
@ -106,16 +106,16 @@
|
|||
SELECT bp."id",bp."name"
|
||||
FROM "ynrealname"."pm_organization" pmo
|
||||
LEFT JOIN "ynrealname"."bm_project" bp ON pmo."id" = bp."company_id" AND bp."is_active" = '1'
|
||||
WHERE pmo.ID = #{orgId}
|
||||
WHERE pmo."id" = #{orgId}
|
||||
<if test="type == 1">
|
||||
AND bp."pro_status" IN (0,2,3)
|
||||
</if>
|
||||
UNION ALL
|
||||
SELECT bp."id" ,bp."name"
|
||||
FROM "ynrealname"."pm_organization" pmo
|
||||
LEFT JOIN "ynrealname"."pm_organization" pmo2 ON pmo."id" = pmo2.PARENT_ID AND pmo2.IS_ACTIVE = '1'
|
||||
LEFT JOIN "ynrealname"."pm_organization" pmo2 ON pmo."id" = pmo2."parent_id" AND pmo2."is_active" = '1'
|
||||
LEFT JOIN "ynrealname"."bm_project" bp ON pmo2."id" = bp."company_id" AND bp."is_active" = '1'
|
||||
WHERE pmo.ID = 1 AND NVL(bp."name",'1') = bp."name"
|
||||
WHERE pmo."id" = 1 AND NVL(bp."name",'1') = bp."name"
|
||||
<if test="type == 1">
|
||||
AND bp."pro_status" IN (0,2,3)
|
||||
</if>
|
||||
|
|
@ -160,7 +160,7 @@
|
|||
<select id="getPlanAuditor" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
SELECT
|
||||
su."id",
|
||||
su."username" AS name
|
||||
su."username" AS "name"
|
||||
FROM
|
||||
"ynrealname"."sys_user" su
|
||||
LEFT JOIN "ynrealname"."sys_role_user" sru ON sru."userId" = su."id"
|
||||
|
|
@ -193,7 +193,7 @@
|
|||
<select id="getCompanyPlanAuditor" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
SELECT
|
||||
t."id",
|
||||
t."username" AS name
|
||||
t."username" AS "name"
|
||||
FROM
|
||||
"ynrealname"."sys_user" t
|
||||
LEFT JOIN "ynrealname"."sys_role_user" sru ON sru."roleId" = t."id"
|
||||
|
|
@ -238,9 +238,9 @@
|
|||
FROM
|
||||
"ynrealname"."pm_organization"
|
||||
WHERE
|
||||
PARENT_ID = '1'
|
||||
"parent_id" = '1'
|
||||
AND "foreign_id" IS NOT NULL
|
||||
AND IS_ACTIVE = '1'
|
||||
AND "is_active" = '1'
|
||||
<if test="orgId != null and orgId != '' ">
|
||||
and "id" = #{orgId}
|
||||
</if>
|
||||
|
|
@ -250,7 +250,7 @@
|
|||
<select id="getTeamByProId" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
SELECT
|
||||
bst."id",
|
||||
bst."team_name" as name
|
||||
bst."team_name" as "name"
|
||||
FROM
|
||||
"ynrealname"."bm_sub_contract" bsc
|
||||
LEFT JOIN "ynrealname"."bm_sub_relation" bsr ON bsr."sub_contract_id" = bsc."id"
|
||||
|
|
@ -292,7 +292,7 @@
|
|||
|
||||
<select id="getCertificateSub" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
SELECT
|
||||
DISTINCT CASE WHEN (bsct."name" IS NULL OR bsct."name" = '') THEN bsc."name" ELSE bsct."name" END AS name
|
||||
DISTINCT CASE WHEN (bsct."name" IS NULL OR bsct."name" = '') THEN bsc."name" ELSE bsct."name" END AS "name"
|
||||
FROM
|
||||
"ynrealname"."bm_subcontractor" bs
|
||||
LEFT JOIN "ynrealname"."bm_subcontractor_certificate" bsc ON bsc."sub_id" = bs."id" AND bsc."is_active" = '1'
|
||||
|
|
@ -334,7 +334,7 @@
|
|||
<if test="level != null and level != ''">
|
||||
and sr."level" = #{level}
|
||||
</if>
|
||||
order by sr."id" DESC
|
||||
order by sr."id" DESC
|
||||
</select>
|
||||
<select id="getProBySubId" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
SELECT
|
||||
|
|
@ -351,17 +351,17 @@
|
|||
</select>
|
||||
<select id="getSubCompanyBySonId" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
WITH RECURSIVE org_tree("id", "parent_id", "level") AS (
|
||||
SELECT ID, PARENT_ID, 1 as "level"
|
||||
SELECT "id", "parent_id", 1 as "level"
|
||||
FROM "ynrealname"."pm_organization"
|
||||
WHERE ID = #{orgId}
|
||||
WHERE "id" = #{orgId}
|
||||
UNION ALL
|
||||
SELECT p.ID, p.PARENT_ID, ot."level" + 1
|
||||
SELECT p."id", p."parent_id", ot."level" + 1
|
||||
FROM "ynrealname"."pm_organization" p
|
||||
INNER JOIN org_tree ot ON p.ID = ot."parent_id"
|
||||
WHERE p.PARENT_ID > 0
|
||||
INNER JOIN org_tree ot ON p."id" = ot."parent_id"
|
||||
WHERE p."parent_id" > 0
|
||||
)
|
||||
SELECT ot."id" as orgId,
|
||||
(SELECT NAME FROM "ynrealname"."pm_organization" WHERE ID = ot."id" AND IS_ACTIVE = '1') AS orgName,
|
||||
(SELECT "name" FROM "ynrealname"."pm_organization" WHERE "id" = ot."id" AND "is_active" = '1') AS orgName,
|
||||
ot."parent_id" as parentId,
|
||||
ot."level"
|
||||
FROM org_tree ot
|
||||
|
|
@ -371,14 +371,14 @@
|
|||
</select>
|
||||
|
||||
<select id="getCerSub" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
SELECT "id","sub_name" as name FROM "ynrealname"."bm_subcontractor" where "is_active" = '1'
|
||||
SELECT "id","sub_name" as "name" FROM "ynrealname"."bm_subcontractor" where "is_active" = '1'
|
||||
<if test="subId != null and subId != ''">
|
||||
and "id" = #{subId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getAttendanceMachineByProId" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
select bam."id", bam."attendance_machine_id" as name
|
||||
select bam."id", bam."attendance_machine_id" as "name"
|
||||
from "ynrealname"."bm_attendance_machine" bam
|
||||
left join "ynrealname"."bm_attendance_machine_pro_relation" bamr on bamr."attendance_machine_id" = bam."id" and bamr."is_active" = 1
|
||||
left join "ynrealname"."bm_project" bp on bp."id" = bamr."pro_id"
|
||||
|
|
@ -390,17 +390,17 @@
|
|||
|
||||
<select id="getTwoComById" resultType="java.lang.String">
|
||||
WITH RECURSIVE org_tree("id", "parent_id", "level") AS (
|
||||
SELECT ID, PARENT_ID, 1 as "level"
|
||||
SELECT "id", "parent_id", 1 as "level"
|
||||
FROM "ynrealname"."pm_organization"
|
||||
WHERE ID = #{orgId}
|
||||
WHERE "id" = #{orgId}
|
||||
UNION ALL
|
||||
SELECT p.ID, p.PARENT_ID, ot."level" + 1
|
||||
SELECT p."id", p."parent_id", ot."level" + 1
|
||||
FROM "ynrealname"."pm_organization" p
|
||||
INNER JOIN org_tree ot ON p.ID = ot."parent_id"
|
||||
WHERE p.PARENT_ID > 0
|
||||
INNER JOIN org_tree ot ON p."id" = ot."parent_id"
|
||||
WHERE p."parent_id" > 0
|
||||
)
|
||||
SELECT ot."id" as orgId,
|
||||
(SELECT NAME FROM "ynrealname"."pm_organization" WHERE ID = ot."id" AND IS_ACTIVE = '1') AS orgName,
|
||||
(SELECT "name" FROM "ynrealname"."pm_organization" WHERE "id" = ot."id" AND "is_active" = '1') AS orgName,
|
||||
ot."parent_id" as parentId,
|
||||
ot."level"
|
||||
FROM org_tree ot
|
||||
|
|
@ -442,6 +442,6 @@
|
|||
WHERE eqb."is_active" = '1'
|
||||
</select>
|
||||
<select id="getTDict" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
select t."value" as name,"id" as id from "ynrealname"."t_dict" t where t."type" = #{type} and t."is_active" = '1'
|
||||
select t."value" as "name","id" as "id" from "ynrealname"."t_dict" t where t."type" = #{type} and t."is_active" = '1'
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -9,9 +9,9 @@
|
|||
t."id_number" as idNumber,
|
||||
t."phone" as phonenumber,
|
||||
po."company_id" as companyId,
|
||||
po."NAME" as companyName,
|
||||
po."name" as companyName,
|
||||
t."org_id" as orgId,
|
||||
po."PARENT_ID" as parentId,
|
||||
po."parent_id" as parentId,
|
||||
t."pro_id" as proId,
|
||||
t."sub_id" as subId,
|
||||
sru."roleId",
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
t."password",
|
||||
btur."team_id" as teamId
|
||||
FROM "ynrealname"."sys_user" t
|
||||
LEFT JOIN "ynrealname"."pm_organization" po on po."ID" = t."org_id" and po."IS_ACTIVE" = 1
|
||||
LEFT JOIN "ynrealname"."pm_organization" po on po."id" = t."org_id" and po."is_active" = 1
|
||||
left join "ynrealname"."sys_role_user" sru on sru."userId" = t."id" and sru."is_active" = 1
|
||||
left join "ynrealname"."sys_role" sr on sr."id" = sru."roleId" and sr."is_active" = 1
|
||||
left join "ynrealname"."bm_team_user_relation" btur on btur."id_number" = t."id_number" and btur."is_active" = 1
|
||||
|
|
@ -31,33 +31,33 @@
|
|||
<select id="selectProOrgByTeamId" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select bsc."pro_id" as proId,
|
||||
po."company_id" as companyId,
|
||||
po.NAME as companyName,
|
||||
po."name" as companyName,
|
||||
bp."company_id" as orgId
|
||||
from "ynrealname"."bm_sub_relation" bsr
|
||||
left join "ynrealname"."bm_sub_contract" bsc on bsc."id" = bsr."sub_contract_id" and bsc."is_active" = 1
|
||||
left join "ynrealname"."bm_project" bp on bp."id" = bsc."pro_id" and bp."is_active" = 1
|
||||
LEFT JOIN "ynrealname"."pm_organization" po on po.ID = bp."company_id" and po.IS_ACTIVE = 1
|
||||
LEFT JOIN "ynrealname"."pm_organization" po on po."id" = bp."company_id" and po."is_active" = 1
|
||||
where bsr."is_active" = 1 and bsr."type" = 3 and bsr."value" = #{teamId}
|
||||
</select>
|
||||
|
||||
<select id="getSubCompany" resultType="com.bonus.system.api.domain.SelectBean">
|
||||
WITH RECURSIVE org_tree (orgId, orgName, parentId, level) AS (
|
||||
SELECT
|
||||
ID,
|
||||
NAME,
|
||||
PARENT_ID,
|
||||
"id",
|
||||
"name",
|
||||
"parent_id",
|
||||
1
|
||||
FROM "ynrealname"."pm_organization"
|
||||
WHERE ID = 2 AND IS_ACTIVE = '1'
|
||||
WHERE "id" = 2 AND "is_active" = '1'
|
||||
UNION ALL
|
||||
SELECT
|
||||
p.ID,
|
||||
p.NAME,
|
||||
p.PARENT_ID,
|
||||
p."id",
|
||||
p."name",
|
||||
p."parent_id",
|
||||
t.level + 1
|
||||
FROM "ynrealname"."pm_organization" p
|
||||
INNER JOIN org_tree t ON p.ID = t.parentId
|
||||
WHERE p.IS_ACTIVE = '1' AND p.PARENT_ID > 0
|
||||
INNER JOIN org_tree t ON p."id" = t.parentId
|
||||
WHERE p."is_active" = '1' AND p."parent_id" > 0
|
||||
)
|
||||
SELECT orgId, orgName, parentId, level
|
||||
FROM org_tree
|
||||
|
|
|
|||
Loading…
Reference in New Issue