Merge pull request 'lvleigang' (#3) from lvleigang into dev
Reviewed-on: http://192.168.2.237:3000/root/kangarooDataCenterV3/pulls/3
This commit is contained in:
commit
c3472db59b
12
README.md
12
README.md
|
@ -1,3 +1,13 @@
|
|||
# kangarooDataCenterV3
|
||||
|
||||
中台后端kangarooDataCenterV3
|
||||
中台后端kangarooDataCenterV3
|
||||
|
||||
标准方法名
|
||||
|
||||
分页查询 queryEntityPage
|
||||
查询全部 queryEntity
|
||||
保存 saveEntity
|
||||
获取单个对象 getEntity
|
||||
修改 updateEntity
|
||||
删除 deleteEntity
|
||||
启用停用 enableDisableEntity
|
|
@ -173,10 +173,10 @@ public interface IBaseDao<E extends Serializable, PK extends Serializable> {
|
|||
|
||||
/**
|
||||
* 获取数据条数
|
||||
* @param paramObject 条件参数
|
||||
* @param paramE 条件参数
|
||||
* @return
|
||||
*/
|
||||
Integer getCount(Object paramObject);
|
||||
Integer getCount(E paramE);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
|
|
|
@ -284,10 +284,8 @@ public abstract class MybatisGenericDao<E extends Serializable, PK extends Seria
|
|||
}
|
||||
|
||||
@Override
|
||||
public Integer getCount(Object parameterObject) {
|
||||
|
||||
Integer totalCount = this.sqlSession.selectOne(getSqlIdPrifx() + "entity_count", parameterObject);
|
||||
|
||||
public Integer getCount(E paramE) {
|
||||
Integer totalCount = this.sqlSession.selectOne(getSqlIdPrifx() + "entity_count", paramE);
|
||||
return totalCount;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,6 @@ public class BaseEntity implements Serializable {
|
|||
* 创建人ID
|
||||
*/
|
||||
private String create_user_id;
|
||||
//下级用户id集合
|
||||
private List<String> subUserIdList;
|
||||
/**
|
||||
* 创建时间ID
|
||||
*/
|
||||
|
@ -46,22 +44,18 @@ public class BaseEntity implements Serializable {
|
|||
* 修改人ID
|
||||
*/
|
||||
private String modify_user_id;
|
||||
/**
|
||||
* 创建人名称
|
||||
*/
|
||||
private String createUserName;
|
||||
/**
|
||||
* 所属组织机构
|
||||
*/
|
||||
private String org_id;
|
||||
/**
|
||||
* 企业会员ID
|
||||
*/
|
||||
private String company_org_id;
|
||||
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String sts;
|
||||
|
||||
//==========分页用==============
|
||||
private Long start;
|
||||
private Long limit;
|
||||
|
@ -72,8 +66,6 @@ public class BaseEntity implements Serializable {
|
|||
private Long rows;
|
||||
private Long page;
|
||||
//==========分页用==============
|
||||
//账套名
|
||||
private String acc_name;
|
||||
//区分数据库类型
|
||||
private String dialect_type;
|
||||
private Integer pageNum;
|
||||
|
@ -109,14 +101,6 @@ public class BaseEntity implements Serializable {
|
|||
this.create_user_id = create_user_id;
|
||||
}
|
||||
|
||||
public List<String> getSubUserIdList() {
|
||||
return subUserIdList;
|
||||
}
|
||||
|
||||
public void setSubUserIdList(List<String> subUserIdList) {
|
||||
this.subUserIdList = subUserIdList;
|
||||
}
|
||||
|
||||
public Date getCreate_time() {
|
||||
return create_time;
|
||||
}
|
||||
|
@ -141,14 +125,6 @@ public class BaseEntity implements Serializable {
|
|||
this.modify_user_id = modify_user_id;
|
||||
}
|
||||
|
||||
public String getCreateUserName() {
|
||||
return createUserName;
|
||||
}
|
||||
|
||||
public void setCreateUserName(String createUserName) {
|
||||
this.createUserName = createUserName;
|
||||
}
|
||||
|
||||
public String getOrg_id() {
|
||||
return org_id;
|
||||
}
|
||||
|
@ -157,14 +133,6 @@ public class BaseEntity implements Serializable {
|
|||
this.org_id = org_id;
|
||||
}
|
||||
|
||||
public String getCompany_org_id() {
|
||||
return company_org_id;
|
||||
}
|
||||
|
||||
public void setCompany_org_id(String company_org_id) {
|
||||
this.company_org_id = company_org_id;
|
||||
}
|
||||
|
||||
public String getSts() {
|
||||
return sts;
|
||||
}
|
||||
|
@ -237,14 +205,6 @@ public class BaseEntity implements Serializable {
|
|||
this.page = page;
|
||||
}
|
||||
|
||||
public String getAcc_name() {
|
||||
return acc_name;
|
||||
}
|
||||
|
||||
public void setAcc_name(String acc_name) {
|
||||
this.acc_name = acc_name;
|
||||
}
|
||||
|
||||
public String getDialect_type() {
|
||||
return dialect_type;
|
||||
}
|
||||
|
@ -282,4 +242,35 @@ public class BaseEntity implements Serializable {
|
|||
this.dataSourceCode = "master";
|
||||
}
|
||||
|
||||
public Long getSorts() {
|
||||
return sorts;
|
||||
}
|
||||
|
||||
public void setSorts(Long sorts) {
|
||||
this.sorts = sorts;
|
||||
}
|
||||
|
||||
public String getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(String companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public void setCreate() {
|
||||
this.setId(UUIDUtils.getUUID());
|
||||
this.setSts("Y");
|
||||
this.setCreate_user_id(StpUtil.getLoginIdAsString());
|
||||
this.setModify_user_id(StpUtil.getLoginIdAsString());
|
||||
this.setCreate_time(new Date());
|
||||
this.setModify_time(new Date());
|
||||
this.setOrg_id("0");
|
||||
this.setCompanyId("0");
|
||||
}
|
||||
//修改信息
|
||||
public void setUpdate() {
|
||||
this.setModify_user_id(StpUtil.getLoginIdAsString());
|
||||
this.setModify_time(new Date());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,12 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysButtonConfigEntity-result">
|
||||
select
|
||||
<include refid="SysButtonConfigEntity_Base_Column_List" />
|
||||
from sys_button_config where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysButtonConfigEntity-result" parameterType = "com.hzya.frame.sys.buttonConfig.entity.SysButtonConfigEntity">
|
||||
select
|
||||
|
@ -93,8 +99,6 @@
|
|||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
|
@ -156,7 +160,7 @@
|
|||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.buttonConfig.entity.SysButtonConfigEntity" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.buttonConfig.entity.SysButtonConfigEntity" >
|
||||
insert into sys_button_config(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
|
@ -176,7 +180,6 @@
|
|||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="companyId != null and companyId != ''"> company_id , </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
|
@ -198,13 +201,12 @@
|
|||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_button_config a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_button_config(code, name_ch, name_en, menu_id, ico_name, styles, btn_function, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
|
@ -212,7 +214,7 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_button_config(code, name_ch, name_en, menu_id, ico_name, styles, btn_function, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
|
|
|
@ -128,8 +128,6 @@
|
|||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
|
@ -282,8 +280,8 @@
|
|||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity" keyProperty="id"
|
||||
useGeneratedKeys="true">
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.dataSource.entity.SysDataSourceEntity"
|
||||
>
|
||||
insert into sys_data_source(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
|
@ -335,7 +333,7 @@
|
|||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_data_source(source_code, source_name, source_ip, source_port, db_name, source_type, login_name,
|
||||
password, service_name, use_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
|
||||
sts)
|
||||
|
@ -346,7 +344,7 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_data_source(source_code, source_name, source_ip, source_port, db_name, source_type, login_name,
|
||||
password, service_name, use_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id)
|
||||
values
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
package com.hzya.frame.sys.menuConfig.entity;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description: 菜单表
|
||||
* @tableName:
|
||||
* @entityName: Module
|
||||
* @author: llg
|
||||
* @history: 1.0
|
||||
*/
|
||||
public class ModuleVo {
|
||||
|
||||
/** 主键ID */
|
||||
private String id;
|
||||
/** 路由地址 */
|
||||
private String path;
|
||||
/** 名称 */
|
||||
private String name;
|
||||
/** 一级Layout 二级 ParntView 三级component */
|
||||
private String component;
|
||||
/** 隐藏 */
|
||||
private boolean hidden;
|
||||
/** redirevt */
|
||||
private String redirect;
|
||||
/** 标题 */
|
||||
private String label;
|
||||
/** alwaysShow */
|
||||
private boolean alwaysShow;
|
||||
/** alwaysShow */
|
||||
private JSONObject meta;
|
||||
//下级菜单
|
||||
private List<ModuleVo> children;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getComponent() {
|
||||
return component;
|
||||
}
|
||||
|
||||
public void setComponent(String component) {
|
||||
this.component = component;
|
||||
}
|
||||
|
||||
public boolean isHidden() {
|
||||
return hidden;
|
||||
}
|
||||
|
||||
public void setHidden(boolean hidden) {
|
||||
this.hidden = hidden;
|
||||
}
|
||||
|
||||
public String getRedirect() {
|
||||
return redirect;
|
||||
}
|
||||
|
||||
public void setRedirect(String redirect) {
|
||||
this.redirect = redirect;
|
||||
}
|
||||
|
||||
public boolean isAlwaysShow() {
|
||||
return alwaysShow;
|
||||
}
|
||||
|
||||
public void setAlwaysShow(boolean alwaysShow) {
|
||||
this.alwaysShow = alwaysShow;
|
||||
}
|
||||
|
||||
public JSONObject getMeta() {
|
||||
return meta;
|
||||
}
|
||||
|
||||
public void setMeta(JSONObject meta) {
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
public List<ModuleVo> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<ModuleVo> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
}
|
|
@ -47,6 +47,12 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysMenuConfigEntity-result">
|
||||
select
|
||||
<include refid="SysMenuConfigEntity_Base_Column_List" />
|
||||
from sys_menu_config where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysMenuConfigEntity-result"
|
||||
parameterType="com.hzya.frame.sys.menuConfig.entity.SysMenuConfigEntity">
|
||||
|
@ -107,8 +113,6 @@
|
|||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
|
@ -186,8 +190,8 @@
|
|||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.menuConfig.entity.SysMenuConfigEntity" keyProperty="id"
|
||||
useGeneratedKeys="true">
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.menuConfig.entity.SysMenuConfigEntity"
|
||||
>
|
||||
insert into sys_menu_config(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
|
@ -210,7 +214,6 @@
|
|||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
|
@ -235,15 +238,12 @@
|
|||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_menu_config a WHERE a.sts
|
||||
= 'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_menu_config(parent_menu_id, menu_entity, depth, menu_name, menu_english_name, menu_icon, route,
|
||||
menu_page, remark, visibles, show_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts,
|
||||
org_id, company_id, sts)
|
||||
|
@ -254,7 +254,7 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_menu_config(parent_menu_id, menu_entity, depth, menu_name, menu_english_name, menu_icon, route,
|
||||
menu_page, remark, visibles, show_type, sorts, create_user_id, create_time, modify_user_id, modify_time, sts,
|
||||
org_id, company_id)
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.hzya.frame.sys.menuConfig.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.menuConfig.entity.SysMenuConfigEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* 系统菜单表(SysMenuConfig)表服务接口
|
||||
|
@ -10,4 +12,13 @@ import com.hzya.frame.basedao.service.IBaseService;
|
|||
* @since 2024-03-26 15:23:53
|
||||
*/
|
||||
public interface ISysMenuConfigService extends IBaseService<SysMenuConfigEntity, String> {
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 根据用户id查询菜单树
|
||||
* @Date 9:40 上午 2022/12/7
|
||||
**/
|
||||
JsonResultEntity queryTree(JSONObject jsonObject);
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,7 @@
|
|||
package com.hzya.frame.sys.organ.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
|
@ -24,14 +25,6 @@ public class SysOrganEntity extends BaseEntity {
|
|||
* 组织机构父级ID
|
||||
*/
|
||||
private String parentOrganId;
|
||||
/**
|
||||
* 组织机构深度
|
||||
*/
|
||||
private Long depth;
|
||||
/**
|
||||
* 组织机构层级
|
||||
*/
|
||||
private String hierarchy;
|
||||
/**
|
||||
* 状态: 0启用 1 停用
|
||||
*/
|
||||
|
@ -53,6 +46,10 @@ public class SysOrganEntity extends BaseEntity {
|
|||
*/
|
||||
private String companyId;
|
||||
|
||||
/**
|
||||
* 子集
|
||||
*/
|
||||
private List<SysOrganEntity> children;
|
||||
|
||||
public String getOrganName() {
|
||||
return organName;
|
||||
|
@ -78,22 +75,6 @@ public class SysOrganEntity extends BaseEntity {
|
|||
this.parentOrganId = parentOrganId;
|
||||
}
|
||||
|
||||
public Long getDepth() {
|
||||
return depth;
|
||||
}
|
||||
|
||||
public void setDepth(Long depth) {
|
||||
this.depth = depth;
|
||||
}
|
||||
|
||||
public String getHierarchy() {
|
||||
return hierarchy;
|
||||
}
|
||||
|
||||
public void setHierarchy(String hierarchy) {
|
||||
this.hierarchy = hierarchy;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
@ -134,5 +115,12 @@ public class SysOrganEntity extends BaseEntity {
|
|||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public List<SysOrganEntity> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<SysOrganEntity> children) {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
<result property="organName" column="organ_name" jdbcType="VARCHAR"/>
|
||||
<result property="organCode" column="organ_code" jdbcType="VARCHAR"/>
|
||||
<result property="parentOrganId" column="parent_organ_id" jdbcType="VARCHAR"/>
|
||||
<result property="depth" column="depth" jdbcType="INTEGER"/>
|
||||
<result property="hierarchy" column="hierarchy" jdbcType="VARCHAR"/>
|
||||
<result property="state" column="state" jdbcType="VARCHAR"/>
|
||||
<result property="company" column="company" jdbcType="VARCHAR"/>
|
||||
<result property="managerId" column="manager_id" jdbcType="VARCHAR"/>
|
||||
|
@ -28,9 +26,7 @@
|
|||
,organ_name
|
||||
,organ_code
|
||||
,parent_organ_id
|
||||
,depth
|
||||
,hierarchy
|
||||
,state
|
||||
,state
|
||||
,company
|
||||
,manager_id
|
||||
,remark
|
||||
|
@ -43,6 +39,12 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysOrganEntity-result">
|
||||
select
|
||||
<include refid="SysOrganEntity_Base_Column_List" />
|
||||
from sys_organ where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysOrganEntity-result"
|
||||
parameterType="com.hzya.frame.sys.organ.entity.SysOrganEntity">
|
||||
|
@ -54,8 +56,6 @@
|
|||
<if test="organName != null and organName != ''">and organ_name = #{organName}</if>
|
||||
<if test="organCode != null and organCode != ''">and organ_code = #{organCode}</if>
|
||||
<if test="parentOrganId != null and parentOrganId != ''">and parent_organ_id = #{parentOrganId}</if>
|
||||
<if test="depth != null">and depth = #{depth}</if>
|
||||
<if test="hierarchy != null and hierarchy != ''">and hierarchy = #{hierarchy}</if>
|
||||
<if test="state != null and state != ''">and state = #{state}</if>
|
||||
<if test="company != null and company != ''">and company = #{company}</if>
|
||||
<if test="managerId != null and managerId != ''">and manager_id = #{managerId}</if>
|
||||
|
@ -82,8 +82,6 @@
|
|||
<if test="organName != null and organName != ''">and organ_name = #{organName}</if>
|
||||
<if test="organCode != null and organCode != ''">and organ_code = #{organCode}</if>
|
||||
<if test="parentOrganId != null and parentOrganId != ''">and parent_organ_id = #{parentOrganId}</if>
|
||||
<if test="depth != null">and depth = #{depth}</if>
|
||||
<if test="hierarchy != null and hierarchy != ''">and hierarchy = #{hierarchy}</if>
|
||||
<if test="state != null and state != ''">and state = #{state}</if>
|
||||
<if test="company != null and company != ''">and company = #{company}</if>
|
||||
<if test="managerId != null and managerId != ''">and manager_id = #{managerId}</if>
|
||||
|
@ -98,8 +96,6 @@
|
|||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
|
@ -115,8 +111,6 @@
|
|||
<if test="parentOrganId != null and parentOrganId != ''">and parent_organ_id like
|
||||
concat('%',#{parentOrganId},'%')
|
||||
</if>
|
||||
<if test="depth != null">and depth like concat('%',#{depth},'%')</if>
|
||||
<if test="hierarchy != null and hierarchy != ''">and hierarchy like concat('%',#{hierarchy},'%')</if>
|
||||
<if test="state != null and state != ''">and state like concat('%',#{state},'%')</if>
|
||||
<if test="company != null and company != ''">and company like concat('%',#{company},'%')</if>
|
||||
<if test="managerId != null and managerId != ''">and manager_id like concat('%',#{managerId},'%')</if>
|
||||
|
@ -150,8 +144,6 @@
|
|||
<if test="organName != null and organName != ''">or organ_name = #{organName}</if>
|
||||
<if test="organCode != null and organCode != ''">or organ_code = #{organCode}</if>
|
||||
<if test="parentOrganId != null and parentOrganId != ''">or parent_organ_id = #{parentOrganId}</if>
|
||||
<if test="depth != null">or depth = #{depth}</if>
|
||||
<if test="hierarchy != null and hierarchy != ''">or hierarchy = #{hierarchy}</if>
|
||||
<if test="state != null and state != ''">or state = #{state}</if>
|
||||
<if test="company != null and company != ''">or company = #{company}</if>
|
||||
<if test="managerId != null and managerId != ''">or manager_id = #{managerId}</if>
|
||||
|
@ -171,16 +163,14 @@
|
|||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.organ.entity.SysOrganEntity" keyProperty="id"
|
||||
useGeneratedKeys="true">
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.organ.entity.SysOrganEntity"
|
||||
>
|
||||
insert into sys_organ(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="organName != null and organName != ''">organ_name ,</if>
|
||||
<if test="organCode != null and organCode != ''">organ_code ,</if>
|
||||
<if test="parentOrganId != null and parentOrganId != ''">parent_organ_id ,</if>
|
||||
<if test="depth != null">depth ,</if>
|
||||
<if test="hierarchy != null and hierarchy != ''">hierarchy ,</if>
|
||||
<if test="state != null and state != ''">state ,</if>
|
||||
<if test="company != null and company != ''">company ,</if>
|
||||
<if test="managerId != null and managerId != ''">manager_id ,</if>
|
||||
|
@ -193,7 +183,6 @@
|
|||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
|
@ -202,8 +191,6 @@
|
|||
<if test="organName != null and organName != ''">#{organName} ,</if>
|
||||
<if test="organCode != null and organCode != ''">#{organCode} ,</if>
|
||||
<if test="parentOrganId != null and parentOrganId != ''">#{parentOrganId} ,</if>
|
||||
<if test="depth != null">#{depth} ,</if>
|
||||
<if test="hierarchy != null and hierarchy != ''">#{hierarchy} ,</if>
|
||||
<if test="state != null and state != ''">#{state} ,</if>
|
||||
<if test="company != null and company != ''">#{company} ,</if>
|
||||
<if test="managerId != null and managerId != ''">#{managerId} ,</if>
|
||||
|
@ -216,37 +203,32 @@
|
|||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_organ a WHERE a.sts = 'Y'
|
||||
),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_organ(organ_name, organ_code, parent_organ_id, depth, hierarchy, state, company, manager_id,
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_organ(organ_name, organ_code, parent_organ_id, state, company, manager_id,
|
||||
remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.organName},#{entity.organCode},#{entity.parentOrganId},#{entity.depth},#{entity.hierarchy},#{entity.state},#{entity.company},#{entity.managerId},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||
(#{entity.organName},#{entity.organCode},#{entity.parentOrganId},#{entity.state},#{entity.company},#{entity.managerId},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_organ(organ_name, organ_code, parent_organ_id, depth, hierarchy, state, company, manager_id,
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_organ(organ_name, organ_code, parent_organ_id, state, company, manager_id,
|
||||
remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.organName},#{entity.organCode},#{entity.parentOrganId},#{entity.depth},#{entity.hierarchy},#{entity.state},#{entity.company},#{entity.managerId},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
(#{entity.organName},#{entity.organCode},#{entity.parentOrganId},#{entity.state},#{entity.company},#{entity.managerId},#{entity.remark},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
organ_name = values(organ_name),
|
||||
organ_code = values(organ_code),
|
||||
parent_organ_id = values(parent_organ_id),
|
||||
depth = values(depth),
|
||||
hierarchy = values(hierarchy),
|
||||
state = values(state),
|
||||
company = values(company),
|
||||
manager_id = values(manager_id),
|
||||
|
@ -267,8 +249,6 @@
|
|||
<if test="organName != null and organName != ''">organ_name = #{organName},</if>
|
||||
<if test="organCode != null and organCode != ''">organ_code = #{organCode},</if>
|
||||
<if test="parentOrganId != null and parentOrganId != ''">parent_organ_id = #{parentOrganId},</if>
|
||||
<if test="depth != null">depth = #{depth},</if>
|
||||
<if test="hierarchy != null and hierarchy != ''">hierarchy = #{hierarchy},</if>
|
||||
<if test="state != null and state != ''">state = #{state},</if>
|
||||
<if test="company != null and company != ''">company = #{company},</if>
|
||||
<if test="managerId != null and managerId != ''">manager_id = #{managerId},</if>
|
||||
|
@ -297,8 +277,6 @@ where id = #{id}
|
|||
<if test="organName != null and organName != ''">and organ_name = #{organName}</if>
|
||||
<if test="organCode != null and organCode != ''">and organ_code = #{organCode}</if>
|
||||
<if test="parentOrganId != null and parentOrganId != ''">and parent_organ_id = #{parentOrganId}</if>
|
||||
<if test="depth != null">and depth = #{depth}</if>
|
||||
<if test="hierarchy != null and hierarchy != ''">and hierarchy = #{hierarchy}</if>
|
||||
<if test="state != null and state != ''">and state = #{state}</if>
|
||||
<if test="company != null and company != ''">and company = #{company}</if>
|
||||
<if test="managerId != null and managerId != ''">and manager_id = #{managerId}</if>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.hzya.frame.sys.organ.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.organ.entity.SysOrganEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* 组织机构表(Sys_Organ)(SysOrgan)表服务接口
|
||||
|
@ -10,4 +12,59 @@ import com.hzya.frame.basedao.service.IBaseService;
|
|||
* @since 2024-03-26 15:24:28
|
||||
*/
|
||||
public interface ISysOrganService extends IBaseService<SysOrganEntity, String> {
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询组织树
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity queryEntityTree(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 保存组织
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity saveEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 获取组织
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity getEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 修改组织
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity updateEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 删除组织
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity deleteEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 启用停用组织
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity enableDisableEntity(JSONObject jsonObject);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,17 @@
|
|||
package com.hzya.frame.sys.organ.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.organ.entity.SysOrganEntity;
|
||||
import com.hzya.frame.sys.organ.dao.ISysOrganDao;
|
||||
import com.hzya.frame.sys.organ.service.ISysOrganService;
|
||||
import com.hzya.frame.sys.person.dao.ISysPersonDao;
|
||||
import com.hzya.frame.sys.person.entity.SysPersonEntity;
|
||||
import com.hzya.frame.sys.role.entity.SysRoleEntity;
|
||||
import com.hzya.frame.sys.userCompany.dao.ISysUserCompanyDao;
|
||||
import com.hzya.frame.sys.userCompany.entity.SysUserCompanyEntity;
|
||||
import com.hzya.frame.sys.userRoles.entity.SysUserRolesEntity;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
@ -10,6 +19,9 @@ import javax.annotation.Resource;
|
|||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组织机构表(Sys_Organ)(SysOrgan)表服务实现类
|
||||
*
|
||||
|
@ -20,10 +32,229 @@ import com.hzya.frame.basedao.service.impl.BaseService;
|
|||
public class SysOrganServiceImpl extends BaseService<SysOrganEntity, String> implements ISysOrganService {
|
||||
|
||||
private ISysOrganDao sysOrganDao;
|
||||
|
||||
@Resource
|
||||
private ISysPersonDao sysPersonDao;
|
||||
@Resource
|
||||
private ISysUserCompanyDao sysUserCompanyDao;
|
||||
@Autowired
|
||||
public void setSysOrganDao(ISysOrganDao dao) {
|
||||
this.sysOrganDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询组织树
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryEntityTree(JSONObject jsonObject) {
|
||||
SysOrganEntity entity = getData("jsonStr", jsonObject, SysOrganEntity.class);
|
||||
if(entity == null ){
|
||||
entity = new SysOrganEntity();
|
||||
}
|
||||
List<SysOrganEntity> returnOrg = new ArrayList<>();
|
||||
//查询符合条件的组织数据
|
||||
List<SysOrganEntity> sysOrganEntityList = sysOrganDao.queryByLike(entity);
|
||||
if(sysOrganEntityList != null && sysOrganEntityList.size() > 0){
|
||||
for (int i = 0; i < sysOrganEntityList.size(); i++) {
|
||||
if("0".equals(sysOrganEntityList.get(i).getParentOrganId())){
|
||||
recursiveSetTree(sysOrganEntityList.get(i),sysOrganEntityList);
|
||||
returnOrg.add(sysOrganEntityList.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("查询组织树成功", returnOrg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 递归设置树
|
||||
* @Date 9:19 上午 2024/3/28
|
||||
* @param sysOrganEntity
|
||||
* @param sysOrganEntityList
|
||||
* @return void
|
||||
**/
|
||||
private void recursiveSetTree(SysOrganEntity sysOrganEntity, List<SysOrganEntity> sysOrganEntityList) {
|
||||
List<SysOrganEntity> children = new ArrayList<>();
|
||||
for (int i = 0; i < sysOrganEntityList.size(); i++) {
|
||||
if(sysOrganEntityList.get(i).getParentOrganId() != null && !"".equals(sysOrganEntityList.get(i).getParentOrganId())){
|
||||
if(sysOrganEntity.getId().equals(sysOrganEntityList.get(i).getParentOrganId())){
|
||||
children.add(sysOrganEntityList.get(i));
|
||||
recursiveSetTree(sysOrganEntity,sysOrganEntityList);
|
||||
}
|
||||
}
|
||||
}
|
||||
sysOrganEntity.setChildren(children);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 保存组织
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity saveEntity(JSONObject jsonObject) {
|
||||
SysOrganEntity entity = getData("jsonStr", jsonObject, SysOrganEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getOrganName() == null || "".equals(entity.getOrganName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入组织名称");
|
||||
}
|
||||
if (entity.getOrganCode() == null || "".equals(entity.getOrganCode())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入组织代码");
|
||||
}
|
||||
if (entity.getParentOrganId() == null || "".equals(entity.getParentOrganId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setCreate();
|
||||
//保存
|
||||
sysOrganDao.save(entity);
|
||||
return BaseResult.getSuccessMessageEntity("保存组织成功", entity);
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 获取组织
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity getEntity(JSONObject jsonObject) {
|
||||
SysOrganEntity entity = getData("jsonStr", jsonObject, SysOrganEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity = sysOrganDao.get(entity.getId());
|
||||
if(entity == null ){
|
||||
return BaseResult.getFailureMessageEntity("获取组织失败");
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("获取组织成功", entity);
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 修改组织
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity updateEntity(JSONObject jsonObject) {
|
||||
SysOrganEntity entity = getData("jsonStr", jsonObject, SysOrganEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getOrganName() == null || "".equals(entity.getOrganName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入组织名称");
|
||||
}
|
||||
if (entity.getOrganCode() == null || "".equals(entity.getOrganCode())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入组织代码");
|
||||
}
|
||||
if (entity.getParentOrganId() == null || "".equals(entity.getParentOrganId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity.setUpdate();
|
||||
//保存
|
||||
sysOrganDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("修改组织成功", entity);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 删除组织,只能删除最后一层
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity deleteEntity(JSONObject jsonObject) {
|
||||
SysOrganEntity entity = getData("jsonStr", jsonObject, SysOrganEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if(!checkOrgUse(entity)){
|
||||
return BaseResult.getFailureMessageEntity("当前组织已经使用,不允许删除");
|
||||
}
|
||||
entity.setUpdate();
|
||||
sysOrganDao.logicRemove(entity);
|
||||
return BaseResult.getSuccessMessageEntity("删除组织成功");
|
||||
}
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 校验组织是否使用 目前只校验(用户\人员)
|
||||
* @Date 3:27 下午 2024/3/27
|
||||
* @param entity
|
||||
* @return boolean
|
||||
**/
|
||||
private boolean checkOrgUse(SysOrganEntity entity) {
|
||||
SysPersonEntity sysPersonEntity = new SysPersonEntity();
|
||||
sysPersonEntity.setOrganId(entity.getId());
|
||||
if(sysPersonDao.getCount(sysPersonEntity) > 0){
|
||||
return false;
|
||||
}
|
||||
SysUserCompanyEntity sysUserCompanyEntity = new SysUserCompanyEntity();
|
||||
sysUserCompanyEntity.setUserCompanyId(entity.getId());
|
||||
if(sysUserCompanyDao.getCount(sysUserCompanyEntity) > 0){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 启用停用组织
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity enableDisableEntity(JSONObject jsonObject) {
|
||||
SysOrganEntity entity = getData("jsonStr", jsonObject, SysOrganEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getState() == null || "".equals(entity.getState())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
//0启用 1 停用
|
||||
if("0".equals(entity.getState())){
|
||||
entity.setUpdate();
|
||||
sysOrganDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("启用组织成功");
|
||||
}else {
|
||||
//人员修改为停用状态
|
||||
SysPersonEntity sysPersonEntity = new SysPersonEntity();
|
||||
sysPersonEntity.setOrganId(entity.getId());
|
||||
sysPersonEntity.setState(entity.getState());
|
||||
sysPersonEntity.setUpdate();
|
||||
sysPersonDao.update(sysPersonEntity);
|
||||
|
||||
//删除用户关联的公司
|
||||
SysUserCompanyEntity sysUserCompanyEntity = new SysUserCompanyEntity();
|
||||
sysUserCompanyEntity.setUserCompanyId(entity.getId());
|
||||
sysUserCompanyEntity.setUpdate();
|
||||
sysUserCompanyDao.logicRemoveMultiCondition(sysUserCompanyEntity);
|
||||
|
||||
entity.setUpdate();
|
||||
sysOrganDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("停用组织成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ public class SysPersonEntity extends BaseEntity {
|
|||
*/
|
||||
private Date leaveTime;
|
||||
/**
|
||||
* 人员状态1停用 0\空 启用
|
||||
* 人员状态0启用 1 停用
|
||||
*/
|
||||
private String state;
|
||||
/**
|
||||
|
|
|
@ -67,6 +67,13 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysPersonEntity-result">
|
||||
select
|
||||
<include refid="SysPersonEntity_Base_Column_List" />
|
||||
from sys_person where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysPersonEntity-result"
|
||||
parameterType="com.hzya.frame.sys.person.entity.SysPersonEntity">
|
||||
|
@ -146,8 +153,6 @@
|
|||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
|
@ -243,8 +248,8 @@
|
|||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.person.entity.SysPersonEntity" keyProperty="id"
|
||||
useGeneratedKeys="true">
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.person.entity.SysPersonEntity"
|
||||
>
|
||||
insert into sys_person(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
|
@ -277,7 +282,6 @@
|
|||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
|
@ -312,15 +316,12 @@
|
|||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_person a WHERE a.sts =
|
||||
'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_person(organ_id, person_code, person_name, sex, moible_phone, entry_time, email, degree_id,
|
||||
post_id, level_id, birth_day, tel_phone, hometown, id_card, address, leave_time, state, remark, dd_user_id,
|
||||
wx_user_id, head_image_id, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
|
||||
|
@ -332,7 +333,7 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_person(organ_id, person_code, person_name, sex, moible_phone, entry_time, email, degree_id,
|
||||
post_id, level_id, birth_day, tel_phone, hometown, id_card, address, leave_time, state, remark, dd_user_id,
|
||||
wx_user_id, head_image_id, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.hzya.frame.sys.person.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.person.entity.SysPersonEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* 人员表(SysPerson)表服务接口
|
||||
|
@ -10,4 +12,67 @@ import com.hzya.frame.basedao.service.IBaseService;
|
|||
* @since 2024-03-26 15:25:12
|
||||
*/
|
||||
public interface ISysPersonService extends IBaseService<SysPersonEntity, String> {
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询人员列表分页
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity queryEntityPage(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询人员列表
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity queryEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 保存人员
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity saveEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 获取人员
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity getEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 修改人员
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity updateEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 删除人员
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity deleteEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 启用停用人员
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity enableDisableEntity(JSONObject jsonObject);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,21 @@
|
|||
package com.hzya.frame.sys.person.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.sys.person.entity.SysPersonEntity;
|
||||
import com.hzya.frame.sys.person.dao.ISysPersonDao;
|
||||
import com.hzya.frame.sys.person.service.ISysPersonService;
|
||||
import com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity;
|
||||
import com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity;
|
||||
import com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity;
|
||||
import com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity;
|
||||
import com.hzya.frame.sys.role.entity.SysRoleEntity;
|
||||
import com.hzya.frame.sys.user.dao.ISysUserDao;
|
||||
import com.hzya.frame.sys.user.entity.SysUserEntity;
|
||||
import com.hzya.frame.sys.userRoles.entity.SysUserRolesEntity;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
|
@ -10,6 +23,8 @@ import javax.annotation.Resource;
|
|||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人员表(SysPerson)表服务实现类
|
||||
*
|
||||
|
@ -21,9 +36,207 @@ public class SysPersonServiceImpl extends BaseService<SysPersonEntity, String> i
|
|||
|
||||
private ISysPersonDao sysPersonDao;
|
||||
|
||||
@Resource
|
||||
private ISysUserDao sysUserDao;
|
||||
@Autowired
|
||||
public void setSysPersonDao(ISysPersonDao dao) {
|
||||
this.sysPersonDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询人员列表分页
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryEntityPage(JSONObject jsonObject) {
|
||||
SysPersonEntity entity = getData("jsonStr", jsonObject, SysPersonEntity.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||
}
|
||||
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
|
||||
List<SysPersonEntity> list = sysPersonDao.queryByLike(entity);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询人员列表
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryEntity(JSONObject jsonObject) {
|
||||
SysPersonEntity entity = getData("jsonStr", jsonObject, SysPersonEntity.class);
|
||||
if(entity == null ){
|
||||
entity = new SysPersonEntity();
|
||||
}
|
||||
List<SysPersonEntity> list = sysPersonDao.queryByLike(entity);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 保存人员
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity saveEntity(JSONObject jsonObject) {
|
||||
SysPersonEntity entity = getData("jsonStr", jsonObject, SysPersonEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getPersonName() == null || "".equals(entity.getPersonName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入人员名称");
|
||||
}
|
||||
if (entity.getPersonCode() == null || "".equals(entity.getPersonCode())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入工号");
|
||||
}
|
||||
if (entity.getMoiblePhone() == null || "".equals(entity.getMoiblePhone())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入手机号码");
|
||||
}
|
||||
entity.setCreate();
|
||||
//保存
|
||||
sysPersonDao.save(entity);
|
||||
return BaseResult.getSuccessMessageEntity("保存人员成功", entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 获取人员
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity getEntity(JSONObject jsonObject) {
|
||||
SysPersonEntity entity = getData("jsonStr", jsonObject, SysPersonEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity = sysPersonDao.get(entity.getId());
|
||||
if(entity == null ){
|
||||
return BaseResult.getFailureMessageEntity("获取人员失败");
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("获取人员成功", entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 修改人员
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity updateEntity(JSONObject jsonObject) {
|
||||
SysPersonEntity entity = getData("jsonStr", jsonObject, SysPersonEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getPersonName() == null || "".equals(entity.getPersonName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入人员名称");
|
||||
}
|
||||
if (entity.getPersonCode() == null || "".equals(entity.getPersonCode())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入工号");
|
||||
}
|
||||
if (entity.getMoiblePhone() == null || "".equals(entity.getMoiblePhone())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入手机号码");
|
||||
}
|
||||
entity.setUpdate();
|
||||
//保存
|
||||
sysPersonDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("修改人员成功", entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 删除人员
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity deleteEntity(JSONObject jsonObject) {
|
||||
SysPersonEntity entity = getData("jsonStr", jsonObject, SysPersonEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if(!checkUse(entity)){
|
||||
return BaseResult.getFailureMessageEntity("当前人员已经使用,不允许删除");
|
||||
}
|
||||
entity.setUpdate();
|
||||
sysPersonDao.logicRemove(entity);
|
||||
return BaseResult.getSuccessMessageEntity("删除人员成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 判断当前人员是否已经被使用
|
||||
* @Date 10:04 上午 2024/3/28
|
||||
* @param entity
|
||||
* @return boolean
|
||||
**/
|
||||
private boolean checkUse(SysPersonEntity entity) {
|
||||
SysUserEntity sysUserEntity = new SysUserEntity();
|
||||
sysUserEntity.setPersonId(entity.getId());
|
||||
if(sysUserDao.getCount(sysUserEntity) > 0){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 启用停用人员
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity enableDisableEntity(JSONObject jsonObject) {
|
||||
SysPersonEntity entity = getData("jsonStr", jsonObject, SysPersonEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getState() == null || "".equals(entity.getState())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
//0启用 1 停用
|
||||
if("0".equals(entity.getState())){
|
||||
entity.setUpdate();
|
||||
sysPersonDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("启用人员成功");
|
||||
}else {
|
||||
//删除用户角色表
|
||||
SysUserEntity sysUserEntity = new SysUserEntity();
|
||||
sysUserEntity.setPersonId(entity.getId());
|
||||
sysUserEntity.setState(entity.getState());
|
||||
sysUserEntity.setUpdate();
|
||||
sysUserDao.update(sysUserEntity);
|
||||
entity.setUpdate();
|
||||
sysPersonDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("停用人员成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.hzya.frame.sys.popedomData.dao;
|
||||
|
||||
import com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 数据权限(sys_popedom_data: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:25:51
|
||||
* @since 2024-03-27 15:45:31
|
||||
*/
|
||||
public interface ISysPopedomDataDao extends IBaseDao<SysPopedomDataEntity, String> {
|
||||
|
||||
|
|
|
@ -4,15 +4,14 @@ import com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity;
|
|||
import com.hzya.frame.sys.popedomData.dao.ISysPopedomDataDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
/**
|
||||
* 数据权限(SysPopedomData)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:25:52
|
||||
* @since 2024-03-27 15:45:32
|
||||
*/
|
||||
@Repository(value = "SysPopedomDataDaoImpl")
|
||||
public class SysPopedomDataDaoImpl extends MybatisGenericDao<SysPopedomDataEntity, String> implements ISysPopedomDataDao {
|
||||
|
||||
public class SysPopedomDataDaoImpl extends MybatisGenericDao<SysPopedomDataEntity, String> implements ISysPopedomDataDao{
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,38 +1,26 @@
|
|||
package com.hzya.frame.sys.popedomData.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 数据权限(SysPopedomData)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:25:52
|
||||
* @since 2024-03-27 15:45:33
|
||||
*/
|
||||
public class SysPopedomDataEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 权限赋予对象id
|
||||
*/
|
||||
private String objectId;
|
||||
private String billKindId;
|
||||
/**
|
||||
* 数据权限设置id
|
||||
*/
|
||||
private String dataSetId;
|
||||
/**
|
||||
* 数据权限id值集合
|
||||
*/
|
||||
private String popeList;
|
||||
/**
|
||||
* 权限分类(1、人员、2、部门、3、角色)
|
||||
*/
|
||||
private String kindId;
|
||||
/**
|
||||
* 公司id
|
||||
*/
|
||||
private String companyId;
|
||||
|
||||
/** 权限赋予对象id */
|
||||
private String objectId;
|
||||
private String billKindId;
|
||||
/** 数据权限设置id */
|
||||
private String dataSetId;
|
||||
/** 数据权限id值集合 */
|
||||
private String popeList;
|
||||
/** 权限分类(1、人员、2、角色) */
|
||||
private String kindId;
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
|
||||
|
||||
public String getObjectId() {
|
||||
|
|
|
@ -2,24 +2,24 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.sys.popedomData.dao.impl.SysPopedomDataDaoImpl">
|
||||
|
||||
<resultMap id="get-SysPopedomDataEntity-result" type="com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="objectId" column="object_id" jdbcType="VARCHAR"/>
|
||||
<result property="billKindId" column="bill_kind_id" jdbcType="VARCHAR"/>
|
||||
<result property="dataSetId" column="data_set_id" jdbcType="VARCHAR"/>
|
||||
<result property="popeList" column="pope_list" jdbcType="VARCHAR"/>
|
||||
<result property="kindId" column="kind_id" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<resultMap id="get-SysPopedomDataEntity-result" type="com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="objectId" column="object_id" jdbcType="VARCHAR"/>
|
||||
<result property="billKindId" column="bill_kind_id" jdbcType="VARCHAR"/>
|
||||
<result property="dataSetId" column="data_set_id" jdbcType="VARCHAR"/>
|
||||
<result property="popeList" column="pope_list" jdbcType="VARCHAR"/>
|
||||
<result property="kindId" column="kind_id" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="SysPopedomDataEntity_Base_Column_List">
|
||||
<sql id = "SysPopedomDataEntity_Base_Column_List">
|
||||
id
|
||||
,object_id
|
||||
,bill_kind_id
|
||||
|
@ -35,238 +35,222 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysPopedomDataEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysPopedomDataEntity-result">
|
||||
select
|
||||
<include refid="SysPopedomDataEntity_Base_Column_List"/>
|
||||
from sys_popedom_data
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="billKindId != null and billKindId != ''">and bill_kind_id = #{billKindId}</if>
|
||||
<if test="dataSetId != null and dataSetId != ''">and data_set_id = #{dataSetId}</if>
|
||||
<if test="popeList != null and popeList != ''">and pope_list = #{popeList}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
<include refid="SysPopedomDataEntity_Base_Column_List" />
|
||||
from sys_popedom_data where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer"
|
||||
parameterType="com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
select count(1) from sys_popedom_data
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="billKindId != null and billKindId != ''">and bill_kind_id = #{billKindId}</if>
|
||||
<if test="dataSetId != null and dataSetId != ''">and data_set_id = #{dataSetId}</if>
|
||||
<if test="popeList != null and popeList != ''">and pope_list = #{popeList}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysPopedomDataEntity-result" parameterType = "com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
select
|
||||
<include refid="SysPopedomDataEntity_Base_Column_List" />
|
||||
from sys_popedom_data
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
|
||||
<if test="billKindId != null and billKindId != ''"> and bill_kind_id = #{billKindId} </if>
|
||||
<if test="dataSetId != null and dataSetId != ''"> and data_set_id = #{dataSetId} </if>
|
||||
<if test="popeList != null and popeList != ''"> and pope_list = #{popeList} </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
select count(1) from sys_popedom_data
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
|
||||
<if test="billKindId != null and billKindId != ''"> and bill_kind_id = #{billKindId} </if>
|
||||
<if test="dataSetId != null and dataSetId != ''"> and data_set_id = #{dataSetId} </if>
|
||||
<if test="popeList != null and popeList != ''"> and pope_list = #{popeList} </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-SysPopedomDataEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
select
|
||||
<include refid="SysPopedomDataEntity_Base_Column_List"/>
|
||||
from sys_popedom_data
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id like concat('%',#{objectId},'%')</if>
|
||||
<if test="billKindId != null and billKindId != ''">and bill_kind_id like concat('%',#{billKindId},'%')</if>
|
||||
<if test="dataSetId != null and dataSetId != ''">and data_set_id like concat('%',#{dataSetId},'%')</if>
|
||||
<if test="popeList != null and popeList != ''">and pope_list like concat('%',#{popeList},'%')</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id like concat('%',#{kindId},'%')</if>
|
||||
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
|
||||
concat('%',#{create_user_id},'%')
|
||||
</if>
|
||||
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
|
||||
concat('%',#{modify_user_id},'%')
|
||||
</if>
|
||||
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
|
||||
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
||||
<select id="entity_list_like" resultMap="get-SysPopedomDataEntity-result" parameterType = "com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
select
|
||||
<include refid="SysPopedomDataEntity_Base_Column_List" />
|
||||
from sys_popedom_data
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id like concat('%',#{objectId},'%') </if>
|
||||
<if test="billKindId != null and billKindId != ''"> and bill_kind_id like concat('%',#{billKindId},'%') </if>
|
||||
<if test="dataSetId != null and dataSetId != ''"> and data_set_id like concat('%',#{dataSetId},'%') </if>
|
||||
<if test="popeList != null and popeList != ''"> and pope_list like concat('%',#{popeList},'%') </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id like concat('%',#{kindId},'%') </if>
|
||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="SysPopedomDataentity_list_or" resultMap="get-SysPopedomDataEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
select
|
||||
<include refid="SysPopedomDataEntity_Base_Column_List"/>
|
||||
from sys_popedom_data
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">or object_id = #{objectId}</if>
|
||||
<if test="billKindId != null and billKindId != ''">or bill_kind_id = #{billKindId}</if>
|
||||
<if test="dataSetId != null and dataSetId != ''">or data_set_id = #{dataSetId}</if>
|
||||
<if test="popeList != null and popeList != ''">or pope_list = #{popeList}</if>
|
||||
<if test="kindId != null and kindId != ''">or kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">or sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">or create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">or modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="SysPopedomDataentity_list_or" resultMap="get-SysPopedomDataEntity-result" parameterType = "com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
select
|
||||
<include refid="SysPopedomDataEntity_Base_Column_List" />
|
||||
from sys_popedom_data
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> or object_id = #{objectId} </if>
|
||||
<if test="billKindId != null and billKindId != ''"> or bill_kind_id = #{billKindId} </if>
|
||||
<if test="dataSetId != null and dataSetId != ''"> or data_set_id = #{dataSetId} </if>
|
||||
<if test="popeList != null and popeList != ''"> or pope_list = #{popeList} </if>
|
||||
<if test="kindId != null and kindId != ''"> or kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> or create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity"
|
||||
keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_popedom_data(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="objectId != null and objectId != ''">object_id ,</if>
|
||||
<if test="billKindId != null and billKindId != ''">bill_kind_id ,</if>
|
||||
<if test="dataSetId != null and dataSetId != ''">data_set_id ,</if>
|
||||
<if test="popeList != null and popeList != ''">pope_list ,</if>
|
||||
<if test="kindId != null and kindId != ''">kind_id ,</if>
|
||||
<if test="sorts != null">sorts ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
|
||||
<if test="create_time != null">create_time ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
|
||||
<if test="modify_time != null">modify_time ,</if>
|
||||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">#{id} ,</if>
|
||||
<if test="objectId != null and objectId != ''">#{objectId} ,</if>
|
||||
<if test="billKindId != null and billKindId != ''">#{billKindId} ,</if>
|
||||
<if test="dataSetId != null and dataSetId != ''">#{dataSetId} ,</if>
|
||||
<if test="popeList != null and popeList != ''">#{popeList} ,</if>
|
||||
<if test="kindId != null and kindId != ''">#{kindId} ,</if>
|
||||
<if test="sorts != null">#{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
|
||||
<if test="create_time != null">#{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
|
||||
<if test="modify_time != null">#{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_popedom_data a WHERE
|
||||
a.sts = 'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_popedom_data(object_id, bill_kind_id, data_set_id, pope_list, kind_id, sorts, create_user_id,
|
||||
create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.billKindId},#{entity.dataSetId},#{entity.popeList},#{entity.kindId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_popedom_data(object_id, bill_kind_id, data_set_id, pope_list, kind_id, sorts, create_user_id,
|
||||
create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.billKindId},#{entity.dataSetId},#{entity.popeList},#{entity.kindId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
object_id = values(object_id),
|
||||
bill_kind_id = values(bill_kind_id),
|
||||
data_set_id = values(data_set_id),
|
||||
pope_list = values(pope_list),
|
||||
kind_id = values(kind_id),
|
||||
sorts = values(sorts),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
update sys_popedom_data set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="objectId != null and objectId != ''">object_id = #{objectId},</if>
|
||||
<if test="billKindId != null and billKindId != ''">bill_kind_id = #{billKindId},</if>
|
||||
<if test="dataSetId != null and dataSetId != ''">data_set_id = #{dataSetId},</if>
|
||||
<if test="popeList != null and popeList != ''">pope_list = #{popeList},</if>
|
||||
<if test="kindId != null and kindId != ''">kind_id = #{kindId},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null">create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null">modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''">sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity" >
|
||||
insert into sys_popedom_data(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="objectId != null and objectId != ''"> object_id , </if>
|
||||
<if test="billKindId != null and billKindId != ''"> bill_kind_id , </if>
|
||||
<if test="dataSetId != null and dataSetId != ''"> data_set_id , </if>
|
||||
<if test="popeList != null and popeList != ''"> pope_list , </if>
|
||||
<if test="kindId != null and kindId != ''"> kind_id , </if>
|
||||
<if test="sorts != null"> sorts , </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
||||
<if test="create_time != null"> create_time , </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
|
||||
<if test="modify_time != null"> modify_time , </if>
|
||||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="companyId != null and companyId != ''"> company_id , </if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> #{id} ,</if>
|
||||
<if test="objectId != null and objectId != ''"> #{objectId} ,</if>
|
||||
<if test="billKindId != null and billKindId != ''"> #{billKindId} ,</if>
|
||||
<if test="dataSetId != null and dataSetId != ''"> #{dataSetId} ,</if>
|
||||
<if test="popeList != null and popeList != ''"> #{popeList} ,</if>
|
||||
<if test="kindId != null and kindId != ''"> #{kindId} ,</if>
|
||||
<if test="sorts != null"> #{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
||||
<if test="create_time != null"> #{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
|
||||
<if test="modify_time != null"> #{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_popedom_data(object_id, bill_kind_id, data_set_id, pope_list, kind_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.billKindId},#{entity.dataSetId},#{entity.popeList},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_popedom_data(object_id, bill_kind_id, data_set_id, pope_list, kind_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.billKindId},#{entity.dataSetId},#{entity.popeList},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
object_id = values(object_id),
|
||||
bill_kind_id = values(bill_kind_id),
|
||||
data_set_id = values(data_set_id),
|
||||
pope_list = values(pope_list),
|
||||
kind_id = values(kind_id),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity" >
|
||||
update sys_popedom_data set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="objectId != null and objectId != ''"> object_id = #{objectId},</if>
|
||||
<if test="billKindId != null and billKindId != ''"> bill_kind_id = #{billKindId},</if>
|
||||
<if test="dataSetId != null and dataSetId != ''"> data_set_id = #{dataSetId},</if>
|
||||
<if test="popeList != null and popeList != ''"> pope_list = #{popeList},</if>
|
||||
<if test="kindId != null and kindId != ''"> kind_id = #{kindId},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null"> create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null"> modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity" >
|
||||
update sys_popedom_data set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition"
|
||||
parameterType="com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity">
|
||||
update sys_popedom_data set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="billKindId != null and billKindId != ''">and bill_kind_id = #{billKindId}</if>
|
||||
<if test="dataSetId != null and dataSetId != ''">and data_set_id = #{dataSetId}</if>
|
||||
<if test="popeList != null and popeList != ''">and pope_list = #{popeList}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity" >
|
||||
update sys_popedom_data set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
|
||||
<if test="billKindId != null and billKindId != ''"> and bill_kind_id = #{billKindId} </if>
|
||||
<if test="dataSetId != null and dataSetId != ''"> and data_set_id = #{dataSetId} </if>
|
||||
<if test="popeList != null and popeList != ''"> and pope_list = #{popeList} </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from sys_popedom_data where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
|
|
@ -2,12 +2,11 @@ package com.hzya.frame.sys.popedomData.service;
|
|||
|
||||
import com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
|
||||
/**
|
||||
* 数据权限(SysPopedomData)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:25:52
|
||||
* @since 2024-03-27 15:45:34
|
||||
*/
|
||||
public interface ISysPopedomDataService extends IBaseService<SysPopedomDataEntity, String> {
|
||||
public interface ISysPopedomDataService extends IBaseService<SysPopedomDataEntity, String>{
|
||||
}
|
||||
|
|
|
@ -3,27 +3,24 @@ package com.hzya.frame.sys.popedomData.service.impl;
|
|||
import com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity;
|
||||
import com.hzya.frame.sys.popedomData.dao.ISysPopedomDataDao;
|
||||
import com.hzya.frame.sys.popedomData.service.ISysPopedomDataService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* 数据权限(SysPopedomData)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:25:52
|
||||
* @since 2024-03-27 15:45:34
|
||||
*/
|
||||
@Service(value = "sysPopedomDataService")
|
||||
public class SysPopedomDataServiceImpl extends BaseService<SysPopedomDataEntity, String> implements ISysPopedomDataService {
|
||||
|
||||
|
||||
private ISysPopedomDataDao sysPopedomDataDao;
|
||||
|
||||
|
||||
@Autowired
|
||||
public void setSysPopedomDataDao(ISysPopedomDataDao dao) {
|
||||
this.sysPopedomDataDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
public void setSysPopedomDataDao(ISysPopedomDataDao dao) {
|
||||
this.sysPopedomDataDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.hzya.frame.sys.popedomHome.dao;
|
||||
|
||||
import com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 首页权限(sys_popedom_home: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-27 15:47:12
|
||||
*/
|
||||
public interface ISysPopedomHomeDao extends IBaseDao<SysPopedomHomeEntity, String> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.hzya.frame.sys.popedomHome.dao.impl;
|
||||
|
||||
import com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity;
|
||||
import com.hzya.frame.sys.popedomHome.dao.ISysPopedomHomeDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
/**
|
||||
* 首页权限(SysPopedomHome)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-27 15:47:12
|
||||
*/
|
||||
@Repository(value = "SysPopedomHomeDaoImpl")
|
||||
public class SysPopedomHomeDaoImpl extends MybatisGenericDao<SysPopedomHomeEntity, String> implements ISysPopedomHomeDao {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.hzya.frame.sys.popedomHome.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 首页权限(SysPopedomHome)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-27 15:47:12
|
||||
*/
|
||||
public class SysPopedomHomeEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 权限赋予对象id
|
||||
*/
|
||||
private String objectId;
|
||||
/**
|
||||
* 首页ID
|
||||
*/
|
||||
private String homeId;
|
||||
/**
|
||||
* 权限类型(1、人员、2、角色)
|
||||
*/
|
||||
private String kindId;
|
||||
/**
|
||||
* 公司id
|
||||
*/
|
||||
private String companyId;
|
||||
|
||||
|
||||
public String getObjectId() {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(String objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public String getHomeId() {
|
||||
return homeId;
|
||||
}
|
||||
|
||||
public void setHomeId(String homeId) {
|
||||
this.homeId = homeId;
|
||||
}
|
||||
|
||||
public String getKindId() {
|
||||
return kindId;
|
||||
}
|
||||
|
||||
public void setKindId(String kindId) {
|
||||
this.kindId = kindId;
|
||||
}
|
||||
|
||||
public String getCompanyId() {
|
||||
return companyId;
|
||||
}
|
||||
|
||||
public void setCompanyId(String companyId) {
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,250 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.sys.popedomHome.dao.impl.SysPopedomHomeDaoImpl">
|
||||
|
||||
<resultMap id="get-SysPopedomHomeEntity-result" type="com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="objectId" column="object_id" jdbcType="VARCHAR"/>
|
||||
<result property="homeId" column="home_id" jdbcType="VARCHAR"/>
|
||||
<result property="kindId" column="kind_id" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="SysPopedomHomeEntity_Base_Column_List">
|
||||
id
|
||||
,object_id
|
||||
,home_id
|
||||
,kind_id
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
,modify_user_id
|
||||
,modify_time
|
||||
,sts
|
||||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysPopedomHomeEntity-result">
|
||||
select
|
||||
<include refid="SysPopedomHomeEntity_Base_Column_List" />
|
||||
from sys_popedom_home where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysPopedomHomeEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity">
|
||||
select
|
||||
<include refid="SysPopedomHomeEntity_Base_Column_List"/>
|
||||
from sys_popedom_home
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="homeId != null and homeId != ''">and home_id = #{homeId}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer"
|
||||
parameterType="com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity">
|
||||
select count(1) from sys_popedom_home
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="homeId != null and homeId != ''">and home_id = #{homeId}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-SysPopedomHomeEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity">
|
||||
select
|
||||
<include refid="SysPopedomHomeEntity_Base_Column_List"/>
|
||||
from sys_popedom_home
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id like concat('%',#{objectId},'%')</if>
|
||||
<if test="homeId != null and homeId != ''">and home_id like concat('%',#{homeId},'%')</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id like concat('%',#{kindId},'%')</if>
|
||||
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
|
||||
concat('%',#{create_user_id},'%')
|
||||
</if>
|
||||
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
|
||||
concat('%',#{modify_user_id},'%')
|
||||
</if>
|
||||
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
|
||||
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="SysPopedomHomeentity_list_or" resultMap="get-SysPopedomHomeEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity">
|
||||
select
|
||||
<include refid="SysPopedomHomeEntity_Base_Column_List"/>
|
||||
from sys_popedom_home
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">or object_id = #{objectId}</if>
|
||||
<if test="homeId != null and homeId != ''">or home_id = #{homeId}</if>
|
||||
<if test="kindId != null and kindId != ''">or kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">or sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">or create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">or modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity"
|
||||
>
|
||||
insert into sys_popedom_home(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="objectId != null and objectId != ''">object_id ,</if>
|
||||
<if test="homeId != null and homeId != ''">home_id ,</if>
|
||||
<if test="kindId != null and kindId != ''">kind_id ,</if>
|
||||
<if test="sorts != null">sorts ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
|
||||
<if test="create_time != null">create_time ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
|
||||
<if test="modify_time != null">modify_time ,</if>
|
||||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">#{id} ,</if>
|
||||
<if test="objectId != null and objectId != ''">#{objectId} ,</if>
|
||||
<if test="homeId != null and homeId != ''">#{homeId} ,</if>
|
||||
<if test="kindId != null and kindId != ''">#{kindId} ,</if>
|
||||
<if test="sorts != null">#{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
|
||||
<if test="create_time != null">#{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
|
||||
<if test="modify_time != null">#{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_popedom_home(object_id, home_id, kind_id, create_user_id, create_time, modify_user_id,
|
||||
modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.homeId},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_popedom_home(object_id, home_id, kind_id, create_user_id, create_time, modify_user_id,
|
||||
modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.homeId},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
object_id = values(object_id),
|
||||
home_id = values(home_id),
|
||||
kind_id = values(kind_id),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity">
|
||||
update sys_popedom_home set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="objectId != null and objectId != ''">object_id = #{objectId},</if>
|
||||
<if test="homeId != null and homeId != ''">home_id = #{homeId},</if>
|
||||
<if test="kindId != null and kindId != ''">kind_id = #{kindId},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null">create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null">modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''">sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity">
|
||||
update sys_popedom_home set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition"
|
||||
parameterType="com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity">
|
||||
update sys_popedom_home set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="homeId != null and homeId != ''">and home_id = #{homeId}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from sys_popedom_home where id = #{id}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.sys.popedomHome.service;
|
||||
|
||||
import com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
|
||||
/**
|
||||
* 首页权限(SysPopedomHome)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-27 15:47:13
|
||||
*/
|
||||
public interface ISysPopedomHomeService extends IBaseService<SysPopedomHomeEntity, String> {
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.hzya.frame.sys.popedomHome.service.impl;
|
||||
|
||||
import com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity;
|
||||
import com.hzya.frame.sys.popedomHome.dao.ISysPopedomHomeDao;
|
||||
import com.hzya.frame.sys.popedomHome.service.ISysPopedomHomeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* 首页权限(SysPopedomHome)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-27 15:47:13
|
||||
*/
|
||||
@Service(value = "sysPopedomHomeService")
|
||||
public class SysPopedomHomeServiceImpl extends BaseService<SysPopedomHomeEntity, String> implements ISysPopedomHomeService {
|
||||
|
||||
private ISysPopedomHomeDao sysPopedomHomeDao;
|
||||
|
||||
@Autowired
|
||||
public void setSysPopedomHomeDao(ISysPopedomHomeDao dao) {
|
||||
this.sysPopedomHomeDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
|
@ -1,13 +1,13 @@
|
|||
package com.hzya.frame.sys.popedomMenu.dao;
|
||||
|
||||
import com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 系统模块权限(sys_popedom_menu: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:26:30
|
||||
* @since 2024-03-27 15:47:29
|
||||
*/
|
||||
public interface ISysPopedomMenuDao extends IBaseDao<SysPopedomMenuEntity, String> {
|
||||
|
||||
|
|
|
@ -4,15 +4,14 @@ import com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity;
|
|||
import com.hzya.frame.sys.popedomMenu.dao.ISysPopedomMenuDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
/**
|
||||
* 系统模块权限(SysPopedomMenu)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:26:30
|
||||
* @since 2024-03-27 15:47:30
|
||||
*/
|
||||
@Repository(value = "SysPopedomMenuDaoImpl")
|
||||
public class SysPopedomMenuDaoImpl extends MybatisGenericDao<SysPopedomMenuEntity, String> implements ISysPopedomMenuDao {
|
||||
|
||||
public class SysPopedomMenuDaoImpl extends MybatisGenericDao<SysPopedomMenuEntity, String> implements ISysPopedomMenuDao{
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,33 +1,23 @@
|
|||
package com.hzya.frame.sys.popedomMenu.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 系统模块权限(SysPopedomMenu)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:26:30
|
||||
* @since 2024-03-27 15:47:30
|
||||
*/
|
||||
public class SysPopedomMenuEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 权限赋予对象id
|
||||
*/
|
||||
private String objectId;
|
||||
/**
|
||||
* 菜单id集
|
||||
*/
|
||||
private String menuIdList;
|
||||
/**
|
||||
* 权限类型(1、人员、2、部门、3、角色)
|
||||
*/
|
||||
private String kindId;
|
||||
/**
|
||||
* 公司id
|
||||
*/
|
||||
private String companyId;
|
||||
|
||||
/** 权限赋予对象id */
|
||||
private String objectId;
|
||||
/** 菜单id */
|
||||
private String menuId;
|
||||
/** 权限类型(1、人员、2、角色) */
|
||||
private String kindId;
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
|
||||
|
||||
public String getObjectId() {
|
||||
|
@ -38,12 +28,12 @@ public class SysPopedomMenuEntity extends BaseEntity {
|
|||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public String getMenuIdList() {
|
||||
return menuIdList;
|
||||
public String getMenuId() {
|
||||
return menuId;
|
||||
}
|
||||
|
||||
public void setMenuIdList(String menuIdList) {
|
||||
this.menuIdList = menuIdList;
|
||||
public void setMenuId(String menuId) {
|
||||
this.menuId = menuId;
|
||||
}
|
||||
|
||||
public String getKindId() {
|
||||
|
|
|
@ -2,25 +2,25 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.sys.popedomMenu.dao.impl.SysPopedomMenuDaoImpl">
|
||||
|
||||
<resultMap id="get-SysPopedomMenuEntity-result" type="com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="objectId" column="object_id" jdbcType="VARCHAR"/>
|
||||
<result property="menuIdList" column="menu_id_list" jdbcType="VARCHAR"/>
|
||||
<result property="kindId" column="kind_id" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<resultMap id="get-SysPopedomMenuEntity-result" type="com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="objectId" column="object_id" jdbcType="VARCHAR"/>
|
||||
<result property="menuId" column="menu_id" jdbcType="VARCHAR"/>
|
||||
<result property="kindId" column="kind_id" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="SysPopedomMenuEntity_Base_Column_List">
|
||||
<sql id = "SysPopedomMenuEntity_Base_Column_List">
|
||||
id
|
||||
,object_id
|
||||
,menu_id_list
|
||||
,menu_id
|
||||
,kind_id
|
||||
,sorts
|
||||
,create_user_id
|
||||
|
@ -31,220 +31,204 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysPopedomMenuEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysPopedomMenuEntity-result">
|
||||
select
|
||||
<include refid="SysPopedomMenuEntity_Base_Column_List"/>
|
||||
from sys_popedom_menu
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="menuIdList != null and menuIdList != ''">and menu_id_list = #{menuIdList}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
<include refid="SysPopedomMenuEntity_Base_Column_List" />
|
||||
from sys_popedom_menu where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer"
|
||||
parameterType="com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
select count(1) from sys_popedom_menu
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="menuIdList != null and menuIdList != ''">and menu_id_list = #{menuIdList}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysPopedomMenuEntity-result" parameterType = "com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
select
|
||||
<include refid="SysPopedomMenuEntity_Base_Column_List" />
|
||||
from sys_popedom_menu
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
|
||||
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
select count(1) from sys_popedom_menu
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
|
||||
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-SysPopedomMenuEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
select
|
||||
<include refid="SysPopedomMenuEntity_Base_Column_List"/>
|
||||
from sys_popedom_menu
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id like concat('%',#{objectId},'%')</if>
|
||||
<if test="menuIdList != null and menuIdList != ''">and menu_id_list like concat('%',#{menuIdList},'%')</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id like concat('%',#{kindId},'%')</if>
|
||||
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
|
||||
concat('%',#{create_user_id},'%')
|
||||
</if>
|
||||
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
|
||||
concat('%',#{modify_user_id},'%')
|
||||
</if>
|
||||
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
|
||||
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
||||
<select id="entity_list_like" resultMap="get-SysPopedomMenuEntity-result" parameterType = "com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
select
|
||||
<include refid="SysPopedomMenuEntity_Base_Column_List" />
|
||||
from sys_popedom_menu
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id like concat('%',#{objectId},'%') </if>
|
||||
<if test="menuId != null and menuId != ''"> and menu_id like concat('%',#{menuId},'%') </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id like concat('%',#{kindId},'%') </if>
|
||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="SysPopedomMenuentity_list_or" resultMap="get-SysPopedomMenuEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
select
|
||||
<include refid="SysPopedomMenuEntity_Base_Column_List"/>
|
||||
from sys_popedom_menu
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">or object_id = #{objectId}</if>
|
||||
<if test="menuIdList != null and menuIdList != ''">or menu_id_list = #{menuIdList}</if>
|
||||
<if test="kindId != null and kindId != ''">or kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">or sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">or create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">or modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="SysPopedomMenuentity_list_or" resultMap="get-SysPopedomMenuEntity-result" parameterType = "com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
select
|
||||
<include refid="SysPopedomMenuEntity_Base_Column_List" />
|
||||
from sys_popedom_menu
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> or object_id = #{objectId} </if>
|
||||
<if test="menuId != null and menuId != ''"> or menu_id = #{menuId} </if>
|
||||
<if test="kindId != null and kindId != ''"> or kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> or create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity"
|
||||
keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_popedom_menu(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="objectId != null and objectId != ''">object_id ,</if>
|
||||
<if test="menuIdList != null and menuIdList != ''">menu_id_list ,</if>
|
||||
<if test="kindId != null and kindId != ''">kind_id ,</if>
|
||||
<if test="sorts != null">sorts ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
|
||||
<if test="create_time != null">create_time ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
|
||||
<if test="modify_time != null">modify_time ,</if>
|
||||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">#{id} ,</if>
|
||||
<if test="objectId != null and objectId != ''">#{objectId} ,</if>
|
||||
<if test="menuIdList != null and menuIdList != ''">#{menuIdList} ,</if>
|
||||
<if test="kindId != null and kindId != ''">#{kindId} ,</if>
|
||||
<if test="sorts != null">#{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
|
||||
<if test="create_time != null">#{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
|
||||
<if test="modify_time != null">#{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_popedom_menu a WHERE
|
||||
a.sts = 'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_popedom_menu(object_id, menu_id_list, kind_id, sorts, create_user_id, create_time,
|
||||
modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.menuIdList},#{entity.kindId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_popedom_menu(object_id, menu_id_list, kind_id, sorts, create_user_id, create_time,
|
||||
modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.menuIdList},#{entity.kindId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
object_id = values(object_id),
|
||||
menu_id_list = values(menu_id_list),
|
||||
kind_id = values(kind_id),
|
||||
sorts = values(sorts),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
update sys_popedom_menu set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="objectId != null and objectId != ''">object_id = #{objectId},</if>
|
||||
<if test="menuIdList != null and menuIdList != ''">menu_id_list = #{menuIdList},</if>
|
||||
<if test="kindId != null and kindId != ''">kind_id = #{kindId},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null">create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null">modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''">sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity" >
|
||||
insert into sys_popedom_menu(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="objectId != null and objectId != ''"> object_id , </if>
|
||||
<if test="menuId != null and menuId != ''"> menu_id , </if>
|
||||
<if test="kindId != null and kindId != ''"> kind_id , </if>
|
||||
<if test="sorts != null"> sorts , </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
||||
<if test="create_time != null"> create_time , </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
|
||||
<if test="modify_time != null"> modify_time , </if>
|
||||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="companyId != null and companyId != ''"> company_id , </if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> #{id} ,</if>
|
||||
<if test="objectId != null and objectId != ''"> #{objectId} ,</if>
|
||||
<if test="menuId != null and menuId != ''"> #{menuId} ,</if>
|
||||
<if test="kindId != null and kindId != ''"> #{kindId} ,</if>
|
||||
<if test="sorts != null"> #{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
||||
<if test="create_time != null"> #{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
|
||||
<if test="modify_time != null"> #{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_popedom_menu(object_id, menu_id, kind_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.menuId},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_popedom_menu(object_id, menu_id, kind_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.menuId},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
object_id = values(object_id),
|
||||
menu_id = values(menu_id),
|
||||
kind_id = values(kind_id),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity" >
|
||||
update sys_popedom_menu set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="objectId != null and objectId != ''"> object_id = #{objectId},</if>
|
||||
<if test="menuId != null and menuId != ''"> menu_id = #{menuId},</if>
|
||||
<if test="kindId != null and kindId != ''"> kind_id = #{kindId},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null"> create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null"> modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity" >
|
||||
update sys_popedom_menu set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition"
|
||||
parameterType="com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity">
|
||||
update sys_popedom_menu set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="menuIdList != null and menuIdList != ''">and menu_id_list = #{menuIdList}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity" >
|
||||
update sys_popedom_menu set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
|
||||
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from sys_popedom_menu where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
|
|
@ -2,12 +2,11 @@ package com.hzya.frame.sys.popedomMenu.service;
|
|||
|
||||
import com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
|
||||
/**
|
||||
* 系统模块权限(SysPopedomMenu)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:26:30
|
||||
* @since 2024-03-27 15:47:32
|
||||
*/
|
||||
public interface ISysPopedomMenuService extends IBaseService<SysPopedomMenuEntity, String> {
|
||||
public interface ISysPopedomMenuService extends IBaseService<SysPopedomMenuEntity, String>{
|
||||
}
|
||||
|
|
|
@ -3,27 +3,24 @@ package com.hzya.frame.sys.popedomMenu.service.impl;
|
|||
import com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity;
|
||||
import com.hzya.frame.sys.popedomMenu.dao.ISysPopedomMenuDao;
|
||||
import com.hzya.frame.sys.popedomMenu.service.ISysPopedomMenuService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* 系统模块权限(SysPopedomMenu)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:26:31
|
||||
* @since 2024-03-27 15:47:33
|
||||
*/
|
||||
@Service(value = "sysPopedomMenuService")
|
||||
public class SysPopedomMenuServiceImpl extends BaseService<SysPopedomMenuEntity, String> implements ISysPopedomMenuService {
|
||||
|
||||
|
||||
private ISysPopedomMenuDao sysPopedomMenuDao;
|
||||
|
||||
|
||||
@Autowired
|
||||
public void setSysPopedomMenuDao(ISysPopedomMenuDao dao) {
|
||||
this.sysPopedomMenuDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
public void setSysPopedomMenuDao(ISysPopedomMenuDao dao) {
|
||||
this.sysPopedomMenuDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.hzya.frame.sys.popedomOperate.dao;
|
||||
|
||||
import com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
import com.hzya.frame.basedao.dao.IBaseDao;
|
||||
|
||||
/**
|
||||
* 操作权限(sys_popedom_operate: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:27:11
|
||||
* @since 2024-03-27 15:47:39
|
||||
*/
|
||||
public interface ISysPopedomOperateDao extends IBaseDao<SysPopedomOperateEntity, String> {
|
||||
|
||||
|
|
|
@ -4,15 +4,14 @@ import com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity;
|
|||
import com.hzya.frame.sys.popedomOperate.dao.ISysPopedomOperateDao;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
||||
|
||||
/**
|
||||
* 操作权限(SysPopedomOperate)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:27:11
|
||||
* @since 2024-03-27 15:47:40
|
||||
*/
|
||||
@Repository(value = "SysPopedomOperateDaoImpl")
|
||||
public class SysPopedomOperateDaoImpl extends MybatisGenericDao<SysPopedomOperateEntity, String> implements ISysPopedomOperateDao {
|
||||
|
||||
public class SysPopedomOperateDaoImpl extends MybatisGenericDao<SysPopedomOperateEntity, String> implements ISysPopedomOperateDao{
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,37 +1,25 @@
|
|||
package com.hzya.frame.sys.popedomOperate.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
|
||||
/**
|
||||
* 操作权限(SysPopedomOperate)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:27:11
|
||||
* @since 2024-03-27 15:47:41
|
||||
*/
|
||||
public class SysPopedomOperateEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 权限赋予对象id
|
||||
*/
|
||||
private String objectId;
|
||||
/**
|
||||
* 菜单id
|
||||
*/
|
||||
private String menuId;
|
||||
/**
|
||||
* 操作权限分类id集
|
||||
*/
|
||||
private String operateKindList;
|
||||
/**
|
||||
* 权限分类(1、人员、2、部门、3、角色)
|
||||
*/
|
||||
private String kindId;
|
||||
/**
|
||||
* 公司id
|
||||
*/
|
||||
private String companyId;
|
||||
|
||||
/** 权限赋予对象id */
|
||||
private String objectId;
|
||||
/** 菜单id */
|
||||
private String menuId;
|
||||
/** 操作权限分类id集 */
|
||||
private String operateKindList;
|
||||
/** 权限分类(1、人员、2、角色) */
|
||||
private String kindId;
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
|
||||
|
||||
public String getObjectId() {
|
||||
|
|
|
@ -2,24 +2,23 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hzya.frame.sys.popedomOperate.dao.impl.SysPopedomOperateDaoImpl">
|
||||
|
||||
<resultMap id="get-SysPopedomOperateEntity-result"
|
||||
type="com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="objectId" column="object_id" jdbcType="VARCHAR"/>
|
||||
<result property="menuId" column="menu_id" jdbcType="VARCHAR"/>
|
||||
<result property="operateKindList" column="operate_kind_list" jdbcType="VARCHAR"/>
|
||||
<result property="kindId" column="kind_id" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<resultMap id="get-SysPopedomOperateEntity-result" type="com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity" >
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="objectId" column="object_id" jdbcType="VARCHAR"/>
|
||||
<result property="menuId" column="menu_id" jdbcType="VARCHAR"/>
|
||||
<result property="operateKindList" column="operate_kind_list" jdbcType="VARCHAR"/>
|
||||
<result property="kindId" column="kind_id" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="modify_user_id" column="modify_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="modify_time" column="modify_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="sts" column="sts" jdbcType="VARCHAR"/>
|
||||
<result property="org_id" column="org_id" jdbcType="VARCHAR"/>
|
||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
<!-- 查询的字段-->
|
||||
<sql id="SysPopedomOperateEntity_Base_Column_List">
|
||||
<sql id = "SysPopedomOperateEntity_Base_Column_List">
|
||||
id
|
||||
,object_id
|
||||
,menu_id
|
||||
|
@ -34,231 +33,213 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysPopedomOperateEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysPopedomOperateEntity-result">
|
||||
select
|
||||
<include refid="SysPopedomOperateEntity_Base_Column_List"/>
|
||||
from sys_popedom_operate
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="menuId != null and menuId != ''">and menu_id = #{menuId}</if>
|
||||
<if test="operateKindList != null and operateKindList != ''">and operate_kind_list = #{operateKindList}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
<include refid="SysPopedomOperateEntity_Base_Column_List" />
|
||||
from sys_popedom_operate where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer"
|
||||
parameterType="com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
select count(1) from sys_popedom_operate
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="menuId != null and menuId != ''">and menu_id = #{menuId}</if>
|
||||
<if test="operateKindList != null and operateKindList != ''">and operate_kind_list = #{operateKindList}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysPopedomOperateEntity-result" parameterType = "com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
select
|
||||
<include refid="SysPopedomOperateEntity_Base_Column_List" />
|
||||
from sys_popedom_operate
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
|
||||
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
|
||||
<if test="operateKindList != null and operateKindList != ''"> and operate_kind_list = #{operateKindList} </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询符合条件的数量 -->
|
||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
select count(1) from sys_popedom_operate
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
|
||||
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
|
||||
<if test="operateKindList != null and operateKindList != ''"> and operate_kind_list = #{operateKindList} </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
<select id="entity_list_like" resultMap="get-SysPopedomOperateEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
select
|
||||
<include refid="SysPopedomOperateEntity_Base_Column_List"/>
|
||||
from sys_popedom_operate
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id like concat('%',#{objectId},'%')</if>
|
||||
<if test="menuId != null and menuId != ''">and menu_id like concat('%',#{menuId},'%')</if>
|
||||
<if test="operateKindList != null and operateKindList != ''">and operate_kind_list like
|
||||
concat('%',#{operateKindList},'%')
|
||||
</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id like concat('%',#{kindId},'%')</if>
|
||||
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
|
||||
concat('%',#{create_user_id},'%')
|
||||
</if>
|
||||
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
|
||||
concat('%',#{modify_user_id},'%')
|
||||
</if>
|
||||
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
|
||||
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
||||
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
||||
<select id="entity_list_like" resultMap="get-SysPopedomOperateEntity-result" parameterType = "com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
select
|
||||
<include refid="SysPopedomOperateEntity_Base_Column_List" />
|
||||
from sys_popedom_operate
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id like concat('%',#{objectId},'%') </if>
|
||||
<if test="menuId != null and menuId != ''"> and menu_id like concat('%',#{menuId},'%') </if>
|
||||
<if test="operateKindList != null and operateKindList != ''"> and operate_kind_list like concat('%',#{operateKindList},'%') </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id like concat('%',#{kindId},'%') </if>
|
||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
||||
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
|
||||
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
||||
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="SysPopedomOperateentity_list_or" resultMap="get-SysPopedomOperateEntity-result"
|
||||
parameterType="com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
select
|
||||
<include refid="SysPopedomOperateEntity_Base_Column_List"/>
|
||||
from sys_popedom_operate
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">or id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">or object_id = #{objectId}</if>
|
||||
<if test="menuId != null and menuId != ''">or menu_id = #{menuId}</if>
|
||||
<if test="operateKindList != null and operateKindList != ''">or operate_kind_list = #{operateKindList}</if>
|
||||
<if test="kindId != null and kindId != ''">or kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">or sorts = #{sorts}</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
|
||||
<if test="create_time != null">or create_time = #{create_time}</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
|
||||
<if test="modify_time != null">or modify_time = #{modify_time}</if>
|
||||
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
||||
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
||||
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
||||
<!-- 查询列表 字段采用or格式 -->
|
||||
<select id="SysPopedomOperateentity_list_or" resultMap="get-SysPopedomOperateEntity-result" parameterType = "com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
select
|
||||
<include refid="SysPopedomOperateEntity_Base_Column_List" />
|
||||
from sys_popedom_operate
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> or object_id = #{objectId} </if>
|
||||
<if test="menuId != null and menuId != ''"> or menu_id = #{menuId} </if>
|
||||
<if test="operateKindList != null and operateKindList != ''"> or operate_kind_list = #{operateKindList} </if>
|
||||
<if test="kindId != null and kindId != ''"> or kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> or create_time = #{create_time} </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
|
||||
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
|
||||
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
||||
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
||||
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity"
|
||||
keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_popedom_operate(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
<if test="objectId != null and objectId != ''">object_id ,</if>
|
||||
<if test="menuId != null and menuId != ''">menu_id ,</if>
|
||||
<if test="operateKindList != null and operateKindList != ''">operate_kind_list ,</if>
|
||||
<if test="kindId != null and kindId != ''">kind_id ,</if>
|
||||
<if test="sorts != null">sorts ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
|
||||
<if test="create_time != null">create_time ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
|
||||
<if test="modify_time != null">modify_time ,</if>
|
||||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">#{id} ,</if>
|
||||
<if test="objectId != null and objectId != ''">#{objectId} ,</if>
|
||||
<if test="menuId != null and menuId != ''">#{menuId} ,</if>
|
||||
<if test="operateKindList != null and operateKindList != ''">#{operateKindList} ,</if>
|
||||
<if test="kindId != null and kindId != ''">#{kindId} ,</if>
|
||||
<if test="sorts != null">#{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
|
||||
<if test="create_time != null">#{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
|
||||
<if test="modify_time != null">#{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_popedom_operate a WHERE
|
||||
a.sts = 'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_popedom_operate(object_id, menu_id, operate_kind_list, kind_id, sorts, create_user_id,
|
||||
create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.menuId},#{entity.operateKindList},#{entity.kindId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||
'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into sys_popedom_operate(object_id, menu_id, operate_kind_list, kind_id, sorts, create_user_id,
|
||||
create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.menuId},#{entity.operateKindList},#{entity.kindId},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
object_id = values(object_id),
|
||||
menu_id = values(menu_id),
|
||||
operate_kind_list = values(operate_kind_list),
|
||||
kind_id = values(kind_id),
|
||||
sorts = values(sorts),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id)
|
||||
</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType="com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
update sys_popedom_operate set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="objectId != null and objectId != ''">object_id = #{objectId},</if>
|
||||
<if test="menuId != null and menuId != ''">menu_id = #{menuId},</if>
|
||||
<if test="operateKindList != null and operateKindList != ''">operate_kind_list = #{operateKindList},</if>
|
||||
<if test="kindId != null and kindId != ''">kind_id = #{kindId},</if>
|
||||
<if test="sorts != null">sorts = #{sorts},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null">create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null">modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''">sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity" >
|
||||
insert into sys_popedom_operate(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="objectId != null and objectId != ''"> object_id , </if>
|
||||
<if test="menuId != null and menuId != ''"> menu_id , </if>
|
||||
<if test="operateKindList != null and operateKindList != ''"> operate_kind_list , </if>
|
||||
<if test="kindId != null and kindId != ''"> kind_id , </if>
|
||||
<if test="sorts != null"> sorts , </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
||||
<if test="create_time != null"> create_time , </if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
|
||||
<if test="modify_time != null"> modify_time , </if>
|
||||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="companyId != null and companyId != ''"> company_id , </if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> #{id} ,</if>
|
||||
<if test="objectId != null and objectId != ''"> #{objectId} ,</if>
|
||||
<if test="menuId != null and menuId != ''"> #{menuId} ,</if>
|
||||
<if test="operateKindList != null and operateKindList != ''"> #{operateKindList} ,</if>
|
||||
<if test="kindId != null and kindId != ''"> #{kindId} ,</if>
|
||||
<if test="sorts != null"> #{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
||||
<if test="create_time != null"> #{create_time} ,</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
|
||||
<if test="modify_time != null"> #{modify_time} ,</if>
|
||||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_popedom_operate(object_id, menu_id, operate_kind_list, kind_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.menuId},#{entity.operateKindList},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_popedom_operate(object_id, menu_id, operate_kind_list, kind_id, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.objectId},#{entity.menuId},#{entity.operateKindList},#{entity.kindId},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
object_id = values(object_id),
|
||||
menu_id = values(menu_id),
|
||||
operate_kind_list = values(operate_kind_list),
|
||||
kind_id = values(kind_id),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
modify_user_id = values(modify_user_id),
|
||||
modify_time = values(modify_time),
|
||||
sts = values(sts),
|
||||
org_id = values(org_id),
|
||||
company_id = values(company_id)</insert>
|
||||
<!--通过主键修改方法-->
|
||||
<update id="entity_update" parameterType = "com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity" >
|
||||
update sys_popedom_operate set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="objectId != null and objectId != ''"> object_id = #{objectId},</if>
|
||||
<if test="menuId != null and menuId != ''"> menu_id = #{menuId},</if>
|
||||
<if test="operateKindList != null and operateKindList != ''"> operate_kind_list = #{operateKindList},</if>
|
||||
<if test="kindId != null and kindId != ''"> kind_id = #{kindId},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null"> create_time = #{create_time},</if>
|
||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
|
||||
<if test="modify_time != null"> modify_time = #{modify_time},</if>
|
||||
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
||||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity" >
|
||||
update sys_popedom_operate set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition"
|
||||
parameterType="com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity">
|
||||
update sys_popedom_operate set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="objectId != null and objectId != ''">and object_id = #{objectId}</if>
|
||||
<if test="menuId != null and menuId != ''">and menu_id = #{menuId}</if>
|
||||
<if test="operateKindList != null and operateKindList != ''">and operate_kind_list = #{operateKindList}</if>
|
||||
<if test="kindId != null and kindId != ''">and kind_id = #{kindId}</if>
|
||||
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity" >
|
||||
update sys_popedom_operate set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
<trim prefix="where" prefixOverrides="and">
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="objectId != null and objectId != ''"> and object_id = #{objectId} </if>
|
||||
<if test="menuId != null and menuId != ''"> and menu_id = #{menuId} </if>
|
||||
<if test="operateKindList != null and operateKindList != ''"> and operate_kind_list = #{operateKindList} </if>
|
||||
<if test="kindId != null and kindId != ''"> and kind_id = #{kindId} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
</trim>
|
||||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from sys_popedom_operate where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
|
|
@ -2,12 +2,11 @@ package com.hzya.frame.sys.popedomOperate.service;
|
|||
|
||||
import com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
|
||||
/**
|
||||
* 操作权限(SysPopedomOperate)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:27:12
|
||||
* @since 2024-03-27 15:47:42
|
||||
*/
|
||||
public interface ISysPopedomOperateService extends IBaseService<SysPopedomOperateEntity, String> {
|
||||
public interface ISysPopedomOperateService extends IBaseService<SysPopedomOperateEntity, String>{
|
||||
}
|
||||
|
|
|
@ -3,27 +3,24 @@ package com.hzya.frame.sys.popedomOperate.service.impl;
|
|||
import com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity;
|
||||
import com.hzya.frame.sys.popedomOperate.dao.ISysPopedomOperateDao;
|
||||
import com.hzya.frame.sys.popedomOperate.service.ISysPopedomOperateService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
|
||||
/**
|
||||
* 操作权限(SysPopedomOperate)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:27:12
|
||||
* @since 2024-03-27 15:47:42
|
||||
*/
|
||||
@Service(value = "sysPopedomOperateService")
|
||||
public class SysPopedomOperateServiceImpl extends BaseService<SysPopedomOperateEntity, String> implements ISysPopedomOperateService {
|
||||
|
||||
|
||||
private ISysPopedomOperateDao sysPopedomOperateDao;
|
||||
|
||||
|
||||
@Autowired
|
||||
public void setSysPopedomOperateDao(ISysPopedomOperateDao dao) {
|
||||
this.sysPopedomOperateDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
public void setSysPopedomOperateDao(ISysPopedomOperateDao dao) {
|
||||
this.sysPopedomOperateDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import com.hzya.frame.basedao.dao.IBaseDao;
|
|||
* 角色表(sys_role: table)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:21:56
|
||||
* @since 2024-03-27 11:49:34
|
||||
*/
|
||||
public interface ISysRoleDao extends IBaseDao<SysRoleEntity, String> {
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.hzya.frame.basedao.dao.MybatisGenericDao;
|
|||
* 角色表(SysRole)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:21:57
|
||||
* @since 2024-03-27 11:49:36
|
||||
*/
|
||||
@Repository(value = "SysRoleDaoImpl")
|
||||
public class SysRoleDaoImpl extends MybatisGenericDao<SysRoleEntity, String> implements ISysRoleDao{
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package com.hzya.frame.sys.role.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.hzya.frame.uuid.UUIDUtils;
|
||||
import com.hzya.frame.web.entity.BaseEntity;
|
||||
/**
|
||||
* 角色表(SysRole)实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:22:01
|
||||
* @since 2024-03-27 11:49:36
|
||||
*/
|
||||
public class SysRoleEntity extends BaseEntity {
|
||||
|
||||
|
@ -16,8 +19,9 @@ public class SysRoleEntity extends BaseEntity {
|
|||
private String roleName;
|
||||
/** 角色说明 */
|
||||
private String description;
|
||||
/** 公司id */
|
||||
private String companyId;
|
||||
/** 状态: 0启用 1 停用 */
|
||||
private String enableState;
|
||||
|
||||
|
||||
|
||||
public String getRoleCode() {
|
||||
|
@ -44,13 +48,14 @@ public class SysRoleEntity extends BaseEntity {
|
|||
this.description = description;
|
||||
}
|
||||
|
||||
public String getCompanyId() {
|
||||
return companyId;
|
||||
public String getEnableState() {
|
||||
return enableState;
|
||||
}
|
||||
|
||||
public void setCompanyId(String companyId) {
|
||||
this.companyId = companyId;
|
||||
public void setEnableState(String enableState) {
|
||||
this.enableState = enableState;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<result property="roleCode" column="role_code" jdbcType="VARCHAR"/>
|
||||
<result property="roleName" column="role_name" jdbcType="VARCHAR"/>
|
||||
<result property="description" column="description" jdbcType="VARCHAR"/>
|
||||
<result property="enableState" column="enable_state" jdbcType="VARCHAR"/>
|
||||
<result property="sorts" column="sorts" jdbcType="INTEGER"/>
|
||||
<result property="create_user_id" column="create_user_id" jdbcType="VARCHAR"/>
|
||||
<result property="create_time" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
|
@ -22,6 +23,7 @@
|
|||
,role_code
|
||||
,role_name
|
||||
,description
|
||||
,enable_state
|
||||
,sorts
|
||||
,create_user_id
|
||||
,create_time
|
||||
|
@ -31,7 +33,15 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!-- 查询 采用==查询 -->
|
||||
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysRoleEntity-result">
|
||||
select
|
||||
<include refid="SysRoleEntity_Base_Column_List" />
|
||||
from sys_role where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysRoleEntity-result" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity">
|
||||
select
|
||||
<include refid="SysRoleEntity_Base_Column_List" />
|
||||
|
@ -41,6 +51,7 @@
|
|||
<if test="roleCode != null and roleCode != ''"> and role_code = #{roleCode} </if>
|
||||
<if test="roleName != null and roleName != ''"> and role_name = #{roleName} </if>
|
||||
<if test="description != null and description != ''"> and description = #{description} </if>
|
||||
<if test="enableState != null and enableState != ''"> and enable_state = #{enableState} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
|
@ -63,6 +74,7 @@
|
|||
<if test="roleCode != null and roleCode != ''"> and role_code = #{roleCode} </if>
|
||||
<if test="roleName != null and roleName != ''"> and role_name = #{roleName} </if>
|
||||
<if test="description != null and description != ''"> and description = #{description} </if>
|
||||
<if test="enableState != null and enableState != ''"> and enable_state = #{enableState} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
||||
|
@ -73,8 +85,6 @@
|
|||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
|
@ -87,6 +97,7 @@
|
|||
<if test="roleCode != null and roleCode != ''"> and role_code like concat('%',#{roleCode},'%') </if>
|
||||
<if test="roleName != null and roleName != ''"> and role_name like concat('%',#{roleName},'%') </if>
|
||||
<if test="description != null and description != ''"> and description like concat('%',#{description},'%') </if>
|
||||
<if test="enableState != null and enableState != ''"> and enable_state like concat('%',#{enableState},'%') </if>
|
||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
||||
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
||||
|
@ -111,6 +122,7 @@
|
|||
<if test="roleCode != null and roleCode != ''"> or role_code = #{roleCode} </if>
|
||||
<if test="roleName != null and roleName != ''"> or role_name = #{roleName} </if>
|
||||
<if test="description != null and description != ''"> or description = #{description} </if>
|
||||
<if test="enableState != null and enableState != ''"> or enable_state = #{enableState} </if>
|
||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
||||
<if test="create_time != null"> or create_time = #{create_time} </if>
|
||||
|
@ -126,13 +138,14 @@
|
|||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity" keyProperty="" useGeneratedKeys="true">
|
||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity" >
|
||||
insert into sys_role(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id , </if>
|
||||
<if test="roleCode != null and roleCode != ''"> role_code , </if>
|
||||
<if test="roleName != null and roleName != ''"> role_name , </if>
|
||||
<if test="description != null and description != ''"> description , </if>
|
||||
<if test="enableState != null and enableState != ''"> enable_state , </if>
|
||||
<if test="sorts != null"> sorts , </if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
||||
<if test="create_time != null"> create_time , </if>
|
||||
|
@ -141,7 +154,6 @@
|
|||
<if test="sts != null and sts != ''"> sts , </if>
|
||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
||||
<if test="companyId != null and companyId != ''"> company_id , </if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
|
@ -150,6 +162,7 @@
|
|||
<if test="roleCode != null and roleCode != ''"> #{roleCode} ,</if>
|
||||
<if test="roleName != null and roleName != ''"> #{roleName} ,</if>
|
||||
<if test="description != null and description != ''"> #{description} ,</if>
|
||||
<if test="enableState != null and enableState != ''"> #{enableState} ,</if>
|
||||
<if test="sorts != null"> #{sorts} ,</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
||||
<if test="create_time != null"> #{create_time} ,</if>
|
||||
|
@ -158,31 +171,30 @@
|
|||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_role a WHERE a.sts = 'Y' ),</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="" useGeneratedKeys="true">
|
||||
insert into sys_role(id, role_code, role_name, description, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_role(role_code, role_name, description, enable_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.id},#{entity.roleCode},#{entity.roleName},#{entity.description},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
|
||||
(#{entity.roleCode},#{entity.roleName},#{entity.description},#{entity.enableState},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="" useGeneratedKeys="true">
|
||||
insert into sys_role(id, role_code, role_name, description, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_role(role_code, role_name, description, enable_state, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
<foreach collection="entities" item="entity" separator=",">
|
||||
(#{entity.id},#{entity.roleCode},#{entity.roleName},#{entity.description},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
(#{entity.roleCode},#{entity.roleName},#{entity.description},#{entity.enableState},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||
</foreach>
|
||||
on duplicate key update
|
||||
id = values(id),
|
||||
role_code = values(role_code),
|
||||
role_name = values(role_name),
|
||||
description = values(description),
|
||||
enable_state = values(enable_state),
|
||||
sorts = values(sorts),
|
||||
create_user_id = values(create_user_id),
|
||||
create_time = values(create_time),
|
||||
|
@ -195,10 +207,10 @@
|
|||
<update id="entity_update" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity" >
|
||||
update sys_role set
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''"> id = #{id},</if>
|
||||
<if test="roleCode != null and roleCode != ''"> role_code = #{roleCode},</if>
|
||||
<if test="roleName != null and roleName != ''"> role_name = #{roleName},</if>
|
||||
<if test="description != null and description != ''"> description = #{description},</if>
|
||||
<if test="enableState != null and enableState != ''"> enable_state = #{enableState},</if>
|
||||
<if test="sorts != null"> sorts = #{sorts},</if>
|
||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
||||
<if test="create_time != null"> create_time = #{create_time},</if>
|
||||
|
@ -208,12 +220,12 @@ update sys_role set
|
|||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
||||
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
|
||||
</trim>
|
||||
where = #{}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 逻辑删除 -->
|
||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity" >
|
||||
update sys_role set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||
where = #{}
|
||||
where id = #{id}
|
||||
</update>
|
||||
<!-- 多条件逻辑删除 -->
|
||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity" >
|
||||
|
@ -223,6 +235,7 @@ update sys_role set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{m
|
|||
<if test="roleCode != null and roleCode != ''"> and role_code = #{roleCode} </if>
|
||||
<if test="roleName != null and roleName != ''"> and role_name = #{roleName} </if>
|
||||
<if test="description != null and description != ''"> and description = #{description} </if>
|
||||
<if test="enableState != null and enableState != ''"> and enable_state = #{enableState} </if>
|
||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
||||
|
@ -231,8 +244,9 @@ update sys_role set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{m
|
|||
</update>
|
||||
<!--通过主键删除-->
|
||||
<delete id="entity_delete">
|
||||
delete from sys_role where = #{}
|
||||
delete from sys_role where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
|
|
|
@ -1,12 +1,80 @@
|
|||
package com.hzya.frame.sys.role.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.hzya.frame.sys.role.entity.SysRoleEntity;
|
||||
import com.hzya.frame.basedao.service.IBaseService;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
|
||||
/**
|
||||
* 角色表(SysRole)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:22:05
|
||||
* @since 2024-03-27 11:49:39
|
||||
*/
|
||||
public interface ISysRoleService extends IBaseService<SysRoleEntity, String>{
|
||||
public interface ISysRoleService extends IBaseService<SysRoleEntity, String> {
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询角色列表分页
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity queryEntityPage(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 查询角色列表
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity queryEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 保存角色
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity saveEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 获取角色
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity getEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 修改角色
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity updateEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 删除角色
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity deleteEntity(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 启用停用角色
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
JsonResultEntity enableDisableEntity(JSONObject jsonObject);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,26 +1,267 @@
|
|||
package com.hzya.frame.sys.role.service.impl;
|
||||
|
||||
import com.hzya.frame.sys.role.entity.SysRoleEntity;
|
||||
import com.hzya.frame.sys.role.dao.ISysRoleDao;
|
||||
import com.hzya.frame.sys.role.service.ISysRoleService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import javax.annotation.Resource;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.hzya.frame.basedao.service.impl.BaseService;
|
||||
import com.hzya.frame.sys.popedomData.dao.ISysPopedomDataDao;
|
||||
import com.hzya.frame.sys.popedomData.entity.SysPopedomDataEntity;
|
||||
import com.hzya.frame.sys.popedomHome.dao.ISysPopedomHomeDao;
|
||||
import com.hzya.frame.sys.popedomHome.entity.SysPopedomHomeEntity;
|
||||
import com.hzya.frame.sys.popedomMenu.dao.ISysPopedomMenuDao;
|
||||
import com.hzya.frame.sys.popedomMenu.entity.SysPopedomMenuEntity;
|
||||
import com.hzya.frame.sys.popedomOperate.dao.ISysPopedomOperateDao;
|
||||
import com.hzya.frame.sys.popedomOperate.entity.SysPopedomOperateEntity;
|
||||
import com.hzya.frame.sys.role.dao.ISysRoleDao;
|
||||
import com.hzya.frame.sys.role.entity.SysRoleEntity;
|
||||
import com.hzya.frame.sys.role.service.ISysRoleService;
|
||||
import com.hzya.frame.sys.userRoles.dao.ISysUserRolesDao;
|
||||
import com.hzya.frame.sys.userRoles.entity.SysUserRolesEntity;
|
||||
import com.hzya.frame.web.entity.BaseResult;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 角色表(SysRole)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2024-03-26 15:22:08
|
||||
* @since 2024-03-27 11:49:39
|
||||
*/
|
||||
@Service(value = "sysRoleService")
|
||||
public class SysRoleServiceImpl extends BaseService<SysRoleEntity, String> implements ISysRoleService {
|
||||
|
||||
private ISysRoleDao sysRoleDao;
|
||||
|
||||
@Resource
|
||||
private ISysUserRolesDao sysUserRolesDao;
|
||||
@Resource
|
||||
private ISysPopedomDataDao sysPopedomDataDao;
|
||||
@Resource
|
||||
private ISysPopedomHomeDao sysPopedomHomeDao;
|
||||
@Resource
|
||||
private ISysPopedomMenuDao sysPopedomMenuDao;
|
||||
@Resource
|
||||
private ISysPopedomOperateDao sysPopedomOperateDao;
|
||||
@Autowired
|
||||
public void setSysRoleDao(ISysRoleDao dao) {
|
||||
this.sysRoleDao = dao;
|
||||
this.dao = dao;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 查询角色列表分页
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryEntityPage(JSONObject jsonObject) {
|
||||
SysRoleEntity entity = getData("jsonStr", jsonObject, SysRoleEntity.class);
|
||||
//判断分页
|
||||
if (entity == null || entity.getPageNum() == null || entity.getPageSize() == null) {
|
||||
return BaseResult.getFailureMessageEntity("分页查询参数不存在");
|
||||
}
|
||||
PageHelper.startPage(entity.getPageNum(), entity.getPageSize());
|
||||
List<SysRoleEntity> sysApplicationVos = sysRoleDao.queryByLike(entity);
|
||||
PageInfo pageInfo = new PageInfo(sysApplicationVos);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", pageInfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 查询角色列表
|
||||
* @Date 11:52 上午 2024/3/27
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity queryEntity(JSONObject jsonObject) {
|
||||
SysRoleEntity entity = getData("jsonStr", jsonObject, SysRoleEntity.class);
|
||||
if(entity == null ){
|
||||
entity = new SysRoleEntity();
|
||||
}
|
||||
List<SysRoleEntity> sysApplicationVos = sysRoleDao.queryByLike(entity);
|
||||
return BaseResult.getSuccessMessageEntity("查询数据成功", sysApplicationVos);
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 保存角色
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity saveEntity(JSONObject jsonObject) {
|
||||
SysRoleEntity entity = getData("jsonStr", jsonObject, SysRoleEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getRoleName() == null || "".equals(entity.getRoleName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入角色名称");
|
||||
}
|
||||
if (entity.getRoleCode() == null || "".equals(entity.getRoleCode())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入角色编码");
|
||||
}
|
||||
entity.setCreate();
|
||||
//保存
|
||||
sysRoleDao.save(entity);
|
||||
return BaseResult.getSuccessMessageEntity("保存角色成功", entity);
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 获取角色
|
||||
* @Date 2:36 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity getEntity(JSONObject jsonObject) {
|
||||
SysRoleEntity entity = getData("jsonStr", jsonObject, SysRoleEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
entity = sysRoleDao.get(entity.getId());
|
||||
if(entity == null ){
|
||||
return BaseResult.getFailureMessageEntity("获取角色失败");
|
||||
}
|
||||
return BaseResult.getSuccessMessageEntity("获取角色成功", entity);
|
||||
}
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 修改角色
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity updateEntity(JSONObject jsonObject) {
|
||||
SysRoleEntity entity = getData("jsonStr", jsonObject, SysRoleEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getRoleName() == null || "".equals(entity.getRoleName())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入角色名称");
|
||||
}
|
||||
if (entity.getRoleCode() == null || "".equals(entity.getRoleCode())) {
|
||||
return BaseResult.getFailureMessageEntity("请先输入角色编码");
|
||||
}
|
||||
entity.setUpdate();
|
||||
//保存
|
||||
sysRoleDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("修改角色成功", entity);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 删除角色
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity deleteEntity(JSONObject jsonObject) {
|
||||
SysRoleEntity entity = getData("jsonStr", jsonObject, SysRoleEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if(!checkRoleUse(entity)){
|
||||
return BaseResult.getFailureMessageEntity("当前角色已经使用,不允许删除");
|
||||
}
|
||||
entity.setUpdate();
|
||||
sysRoleDao.logicRemove(entity);
|
||||
return BaseResult.getSuccessMessageEntity("删除角色成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author lvleigang
|
||||
* @Description 校验角色是否使用 目前只校验(用户角色、角色权限配置下的)
|
||||
* @Date 3:27 下午 2024/3/27
|
||||
* @param entity
|
||||
* @return boolean
|
||||
**/
|
||||
private boolean checkRoleUse(SysRoleEntity entity) {
|
||||
SysUserRolesEntity sysUserRolesEntity = new SysUserRolesEntity();
|
||||
sysUserRolesEntity.setRoleId(entity.getId());
|
||||
if(sysUserRolesDao.getCount(sysUserRolesEntity) > 0){
|
||||
return false;
|
||||
}
|
||||
SysPopedomDataEntity sysPopedomDataEntity = new SysPopedomDataEntity();
|
||||
sysPopedomDataEntity.setObjectId(entity.getId());
|
||||
sysPopedomDataEntity.setKindId("2");
|
||||
if(sysPopedomDataDao.getCount(sysPopedomDataEntity) > 0){
|
||||
return false;
|
||||
}
|
||||
SysPopedomHomeEntity sysPopedomHomeEntity = new SysPopedomHomeEntity();
|
||||
sysPopedomHomeEntity.setObjectId(entity.getId());
|
||||
sysPopedomHomeEntity.setKindId("2");
|
||||
if(sysPopedomHomeDao.getCount(sysPopedomHomeEntity) > 0){
|
||||
return false;
|
||||
}
|
||||
SysPopedomMenuEntity sysPopedomMenuEntity = new SysPopedomMenuEntity();
|
||||
sysPopedomMenuEntity.setObjectId(entity.getId());
|
||||
sysPopedomMenuEntity.setKindId("2");
|
||||
if(sysPopedomMenuDao.getCount(sysPopedomMenuEntity) > 0){
|
||||
return false;
|
||||
}
|
||||
SysPopedomOperateEntity sysPopedomOperateEntity = new SysPopedomOperateEntity();
|
||||
sysPopedomOperateEntity.setObjectId(entity.getId());
|
||||
sysPopedomOperateEntity.setKindId("2");
|
||||
if(sysPopedomOperateDao.getCount(sysPopedomOperateEntity) > 0){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param jsonObject
|
||||
* @return com.hzya.frame.web.entity.JsonResultEntity
|
||||
* @Author lvleigang
|
||||
* @Description 启用停用角色
|
||||
* @Date 2:37 下午 2024/3/27
|
||||
**/
|
||||
@Override
|
||||
public JsonResultEntity enableDisableEntity(JSONObject jsonObject) {
|
||||
SysRoleEntity entity = getData("jsonStr", jsonObject, SysRoleEntity.class);
|
||||
if (entity == null) {
|
||||
return BaseResult.getFailureMessageEntity("参数不允许为空");
|
||||
}
|
||||
if (entity.getId() == null || "".equals(entity.getId())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
if (entity.getEnableState() == null || "".equals(entity.getEnableState())) {
|
||||
return BaseResult.getFailureMessageEntity("系统错误");
|
||||
}
|
||||
//0启用 1 停用
|
||||
if("0".equals(entity.getEnableState())){
|
||||
entity.setUpdate();
|
||||
sysRoleDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("启用角色成功");
|
||||
}else {
|
||||
//删除用户角色表
|
||||
SysUserRolesEntity sysUserRolesEntity = new SysUserRolesEntity();
|
||||
sysUserRolesEntity.setRoleId(entity.getId());
|
||||
sysUserRolesEntity.setUpdate();
|
||||
sysUserRolesDao.logicRemoveMultiCondition(sysUserRolesEntity);
|
||||
|
||||
entity.setUpdate();
|
||||
sysRoleDao.update(entity);
|
||||
return BaseResult.getSuccessMessageEntity("停用角色成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,12 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysUserEntity-result">
|
||||
select
|
||||
<include refid="SysUserEntity_Base_Column_List" />
|
||||
from sys_user where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysUserEntity-result"
|
||||
parameterType="com.hzya.frame.sys.user.entity.SysUserEntity">
|
||||
|
@ -98,8 +104,6 @@
|
|||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
|
@ -171,8 +175,8 @@
|
|||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.user.entity.SysUserEntity" keyProperty="id"
|
||||
useGeneratedKeys="true">
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.user.entity.SysUserEntity"
|
||||
>
|
||||
insert into sys_user(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
|
@ -193,7 +197,6 @@
|
|||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
|
@ -216,15 +219,12 @@
|
|||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_user a WHERE a.sts = 'Y'
|
||||
),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_user(person_id, login_code, password, salt, last_login_time, last_connection_time,
|
||||
last_login_ip, state, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
|
||||
company_id, sts)
|
||||
|
@ -235,7 +235,7 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_user(person_id, login_code, password, salt, last_login_time, last_connection_time,
|
||||
last_login_ip, state, remark, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id,
|
||||
company_id)
|
||||
|
|
|
@ -31,6 +31,12 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysUserCompanyEntity-result">
|
||||
select
|
||||
<include refid="SysUserCompanyEntity_Base_Column_List" />
|
||||
from sys_user_company where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysUserCompanyEntity-result"
|
||||
parameterType="com.hzya.frame.sys.userCompany.entity.SysUserCompanyEntity">
|
||||
|
@ -75,8 +81,6 @@
|
|||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
|
@ -137,7 +141,7 @@
|
|||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.userCompany.entity.SysUserCompanyEntity"
|
||||
keyProperty="id" useGeneratedKeys="true">
|
||||
>
|
||||
insert into sys_user_company(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
|
@ -152,7 +156,6 @@
|
|||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
|
@ -169,15 +172,12 @@
|
|||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_user_company a WHERE
|
||||
a.sts = 'Y' ),
|
||||
</if>
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_user_company(user_id, user_company_id, remark, sorts, create_user_id, create_time,
|
||||
modify_user_id, modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
|
@ -187,7 +187,7 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_user_company(user_id, user_company_id, remark, sorts, create_user_id, create_time,
|
||||
modify_user_id, modify_time, sts, org_id, company_id)
|
||||
values
|
||||
|
|
|
@ -31,6 +31,12 @@
|
|||
,org_id
|
||||
,company_id
|
||||
</sql>
|
||||
<!--通过ID获取数据 -->
|
||||
<select id="entity_get" resultMap="get-SysUserRolesEntity-result">
|
||||
select
|
||||
<include refid="SysUserRolesEntity_Base_Column_List" />
|
||||
from sys_user_roles where id = #{ id } and sts='Y'
|
||||
</select>
|
||||
<!-- 查询 采用==查询 -->
|
||||
<select id="entity_list_base" resultMap="get-SysUserRolesEntity-result"
|
||||
parameterType="com.hzya.frame.sys.userRoles.entity.SysUserRolesEntity">
|
||||
|
@ -75,8 +81,6 @@
|
|||
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||
and sts='Y'
|
||||
</trim>
|
||||
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||
</select>
|
||||
|
||||
<!-- 分页查询列表 采用like格式 -->
|
||||
|
@ -136,8 +140,8 @@
|
|||
</select>
|
||||
|
||||
<!--新增所有列-->
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.userRoles.entity.SysUserRolesEntity" keyProperty="id"
|
||||
useGeneratedKeys="true">
|
||||
<insert id="entity_insert" parameterType="com.hzya.frame.sys.userRoles.entity.SysUserRolesEntity"
|
||||
>
|
||||
insert into sys_user_roles(
|
||||
<trim suffix="" suffixOverrides=",">
|
||||
<if test="id != null and id != ''">id ,</if>
|
||||
|
@ -152,7 +156,6 @@
|
|||
<if test="sts != null and sts != ''">sts ,</if>
|
||||
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||
<if test="sorts == null ">sorts,</if>
|
||||
<if test="sts == null ">sts,</if>
|
||||
</trim>
|
||||
)values(
|
||||
|
@ -169,15 +172,13 @@
|
|||
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_user_roles a WHERE a.sts
|
||||
= 'Y' ),
|
||||
</if>
|
||||
|
||||
<if test="sts == null ">'Y',</if>
|
||||
</trim>
|
||||
)
|
||||
</insert>
|
||||
<!-- 批量新增 -->
|
||||
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertBatch" >
|
||||
insert into sys_user_roles(user_id, role_id, user_role_note, sorts, create_user_id, create_time, modify_user_id,
|
||||
modify_time, sts, org_id, company_id, sts)
|
||||
values
|
||||
|
@ -187,7 +188,7 @@
|
|||
</foreach>
|
||||
</insert>
|
||||
<!-- 批量新增或者修改-->
|
||||
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
||||
<insert id="entityInsertOrUpdateBatch" >
|
||||
insert into sys_user_roles(user_id, role_id, user_role_note, sorts, create_user_id, create_time, modify_user_id,
|
||||
modify_time, sts, org_id, company_id)
|
||||
values
|
||||
|
|
|
@ -18,39 +18,10 @@ public class ApplicationContextInitialized implements ApplicationContextInitiali
|
|||
@Override
|
||||
public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
|
||||
|
||||
logger.info("**************************系统已经启动开始初始化********************************");
|
||||
logger.info("**************************初始化数据源*****************************************");
|
||||
//
|
||||
//// SqlSession sqlSession = DataSourceUtil.getDefaultSqlSession();
|
||||
//// IExecSqlService execSqlService = configurableApplicationContext.getBean(IExecSqlService.class);
|
||||
//// try {
|
||||
//// List<HashMap<String, Object>> data = execSqlService.execSelectSql(" SELECT * from sys_user ", "322");
|
||||
//// System.out.println("dataSize" + data.size());
|
||||
//// } catch (Exception e) {
|
||||
//// e.printStackTrace();
|
||||
//// }
|
||||
//// System.out.println("sqlSession" + sqlSession);
|
||||
// String path = ApplicationContextInitialized.class.getClass().getResource("/").getPath();
|
||||
// System.out.println(path);
|
||||
//// path = path.substring(1, path.indexOf("classes"));
|
||||
// System.out.println(path);
|
||||
//
|
||||
// path += "cfgHome\\plugin\\A8YundaProjectToEsb\\spring\\spring-A8YundaProjectToEsb-manager.xml";
|
||||
// path = "cfgHome\\plugin\\A8YundaProjectToEsb\\spring\\spring-A8YundaProjectToEsb-manager.xml";
|
||||
//
|
||||
//// DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
|
||||
////
|
||||
//// XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory);
|
||||
////// FileSystemXmlApplicationContext fileSystemXmlApplicationContext = new FileSystemXmlApplicationContext();
|
||||
//// beanDefinitionReader.loadBeanDefinitions(path);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void closeApplication(ConfigurableApplicationContext configurableApplicationContext) {
|
||||
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -32,10 +32,6 @@ public class MyApplicationListener implements ApplicationListener<ApplicationRea
|
|||
private Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
@Resource
|
||||
private DataSource dataSource;
|
||||
@Resource
|
||||
private ISysDataSourceDao sysDataSourceDao;
|
||||
//@Resource
|
||||
//private IIntegrationTaskService iIntegrationTaskService;
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
|
||||
|
@ -48,11 +44,11 @@ public class MyApplicationListener implements ApplicationListener<ApplicationRea
|
|||
ds.setPrimary("master");
|
||||
ds.setStrict(true);
|
||||
logger.info("***初始化数据源成功!数据源编码:master ya251 *********");
|
||||
|
||||
//数据源初始化完成后,执行初始化定时任务
|
||||
initTask();
|
||||
}
|
||||
|
||||
|
||||
/****
|
||||
* @Content:创建数据源,返回DruidDataSource
|
||||
* @Author 👻👻👻👻👻👻👻👻 gjh
|
||||
|
|
Loading…
Reference in New Issue