Commit a60a378f by 陶光胜

Merge branch 'developer' into 'master'

Developer

See merge request !28
parents 5af57a7b 03933e66
package com.gic.auth.constant;
/**
* 权限管理:应用code
* @ClassName: AppMenuCodeConstants

* @Description: 

* @author guojuxing

* @date 2020/10/19 3:31 PM

*/
public class AppMenuCodeConstants {
/**
* 商品应用菜单code
*/
public static final String GOODS_APP = "goods_app";
/**
* gic权限页面code
*/
public static final String GOODS_GIC = "goods";
}
package com.gic.auth.constant;
/**
* 权限菜单平台类型
* @ClassName: MenuPlatformTypeEnum

* @Description: 

* @author guojuxing

* @date 2020/10/23 9:52 AM

*/
public enum MenuPlatformTypeEnum {
GIC(0, "gic"),
HAOBAN_PC(1, "好办后台"),
HAOBAN_APPLET(3, "好办小程序"),
HAOBAN_APP(2, "好办应用"),
HAOBAN_APPLET_APP(4, "好办小程序应用");
private Integer code;
private String message;
private MenuPlatformTypeEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public MenuPlatformTypeEnum setCode(Integer code) {
this.code = code;
return this;
}
public String getMessage() {
return message;
}
public MenuPlatformTypeEnum setMessage(String message) {
this.message = message;
return this;
}
}
......@@ -47,9 +47,9 @@ public class AccountGroupDTO implements Serializable{
private Integer enterpriseId;
/**
* 1:有效 0:无效
* 0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
* 排序
......@@ -95,12 +95,13 @@ public class AccountGroupDTO implements Serializable{
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public AccountGroupDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Integer getSort() {
......@@ -141,7 +142,7 @@ public class AccountGroupDTO implements Serializable{
"accountGroupId=" + accountGroupId +
", accountGroupName='" + accountGroupName + '\'' +
", enterpriseId=" + enterpriseId +
", status=" + status +
", deleteFlag=" + deleteFlag +
", sort=" + sort +
", createTime=" + createTime +
", updateTime=" + updateTime +
......
......@@ -34,9 +34,9 @@ public class AccountGroupRelDTO implements Serializable{
private Integer enterpriseId;
/**
* 1:有效 0:无效
* 0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
* 1:管理员 2:协作人
......@@ -86,14 +86,6 @@ public class AccountGroupRelDTO implements Serializable{
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getType() {
return type;
}
......@@ -118,6 +110,15 @@ public class AccountGroupRelDTO implements Serializable{
this.updateTime = updateTime;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public AccountGroupRelDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
@Override
public String toString() {
return "AccountGroupRelDTO{" +
......@@ -125,7 +126,7 @@ public class AccountGroupRelDTO implements Serializable{
", accountGroupId=" + accountGroupId +
", userId=" + userId +
", enterpriseId=" + enterpriseId +
", status=" + status +
", deleteFlag=" + deleteFlag +
", type=" + type +
", createTime=" + createTime +
", updateTime=" + updateTime +
......
......@@ -34,7 +34,7 @@ public class AuditedGroupUserRelDTO implements Serializable {
/**
*
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -79,12 +79,13 @@ public class AuditedGroupUserRelDTO implements Serializable {
this.userId = userId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public AuditedGroupUserRelDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -118,7 +119,7 @@ public class AuditedGroupUserRelDTO implements Serializable {
", enterpriseId=" + enterpriseId +
", auditedGroupId=" + auditedGroupId +
", userId=" + userId +
", status=" + status +
", status=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
", auditedGroupIdList=" + auditedGroupIdList +
......
......@@ -35,7 +35,7 @@ public class AuditorAuditedGroupRelDTO implements Serializable {
/**
*
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -80,12 +80,13 @@ public class AuditorAuditedGroupRelDTO implements Serializable {
this.auditedGroupId = auditedGroupId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public AuditorAuditedGroupRelDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -119,7 +120,7 @@ public class AuditorAuditedGroupRelDTO implements Serializable {
", enterpriseId=" + enterpriseId +
", auditorId=" + auditorId +
", auditedGroupId=" + auditedGroupId +
", status=" + status +
", status=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
", auditorIdList=" + auditorIdList +
......
......@@ -35,9 +35,9 @@ public class AuthCodeDTO implements Serializable {
private Integer relationId;
/**
* 1有效 0失效
* 0有效 1失效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -77,12 +77,13 @@ public class AuthCodeDTO implements Serializable {
this.relationId = relationId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public AuthCodeDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getExpirationTime() {
......@@ -100,7 +101,7 @@ public class AuthCodeDTO implements Serializable {
", authCode='" + authCode + '\'' +
", enterpriseId=" + enterpriseId +
", relationId=" + relationId +
", status=" + status +
", deleteFlag=" + deleteFlag +
", expirationTime=" + expirationTime +
'}';
}
......
......@@ -49,9 +49,9 @@ public class BusinessFrontResDTO implements Serializable{
private Integer enterpriseId;
/**
* 状态1:有效 0:无效
* 状态0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -119,12 +119,13 @@ public class BusinessFrontResDTO implements Serializable{
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public BusinessFrontResDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -153,7 +154,7 @@ public class BusinessFrontResDTO implements Serializable{
", pageName='" + pageName + '\'' +
", resourceDetail='" + resourceDetail + '\'' +
", enterpriseId=" + enterpriseId +
", status=" + status +
", deleteFlag=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
......
......@@ -83,9 +83,9 @@ public class CollaboratorDTO implements Serializable{
private String subAppIds;
/**
* 状态: 0:无效 1:youxiao
* 状态: 1:无效 0:youxiao
*/
private Integer status;
private Integer deleteFlag;
/**
* 创建时间
......@@ -167,12 +167,13 @@ public class CollaboratorDTO implements Serializable{
this.subAppIds = subAppIds;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public CollaboratorDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -253,7 +254,7 @@ public class CollaboratorDTO implements Serializable{
", creator='" + creator + '\'' +
", resourceIds='" + resourceIds + '\'' +
", subAppIds='" + subAppIds + '\'' +
", status=" + status +
", deleteFlag=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
", subAppIdList=" + subAppIdList +
......
......@@ -59,6 +59,8 @@ public class CollaboratorListDTO implements Serializable{
*/
private Integer status;
private Integer deleteFlag;
/**
* 创建时间
*/
......@@ -137,6 +139,15 @@ public class CollaboratorListDTO implements Serializable{
}
public Integer getStatus() {
if (deleteFlag == null) {
return 0;
}
if (deleteFlag == 1) {
return 0;
}
if (deleteFlag == 0) {
return 1;
}
return status;
}
......@@ -152,6 +163,15 @@ public class CollaboratorListDTO implements Serializable{
this.createTime = createTime;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public CollaboratorListDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
@Override
public String toString() {
return "CollaboratorListDTO{" +
......@@ -165,6 +185,7 @@ public class CollaboratorListDTO implements Serializable{
", appName='" + appName + '\'' +
", creator='" + creator + '\'' +
", status=" + status +
", deleteFlag=" + deleteFlag +
", createTime=" + createTime +
'}';
}
......
......@@ -43,9 +43,9 @@ public class MenuAuthDepartDTO implements Serializable{
private String positionName;
/**
* 1:有效 0:无效
* 0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
* 创建时间
......@@ -112,12 +112,12 @@ public class MenuAuthDepartDTO implements Serializable{
return this;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public MenuAuthDepartDTO setStatus(Integer status) {
this.status = status;
public MenuAuthDepartDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
......@@ -148,7 +148,7 @@ public class MenuAuthDepartDTO implements Serializable{
", departName='" + departName + '\'' +
", positionCode='" + positionCode + '\'' +
", positionName='" + positionName + '\'' +
", status=" + status +
", deleteFlag=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
......
......@@ -112,9 +112,9 @@ public class MenuDTO implements Serializable {
private Integer sort;
/**
* 0删除1有效
* 1删除0有效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -254,12 +254,13 @@ public class MenuDTO implements Serializable {
this.sort = sort;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public MenuDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Integer getLevel() {
......@@ -388,7 +389,7 @@ public class MenuDTO implements Serializable {
", target=" + target +
", iconUrl='" + iconUrl + '\'' +
", sort=" + sort +
", status=" + status +
", status=" + deleteFlag +
", level=" + level +
", isShow=" + isShow +
", menuCode='" + menuCode + '\'' +
......
......@@ -29,9 +29,9 @@ public class MenuItemDTO implements Serializable{
private Integer itemId;
/**
* 1:有效 0:无效
* 0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
* 创建时间
......@@ -67,12 +67,13 @@ public class MenuItemDTO implements Serializable{
this.itemId = itemId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public MenuItemDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -97,7 +98,7 @@ public class MenuItemDTO implements Serializable{
"menuItemId=" + menuItemId +
", menuId=" + menuId +
", itemId=" + itemId +
", status=" + status +
", deleteFlag=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
......
......@@ -42,9 +42,9 @@ public class MenuRoleDTO implements Serializable{
private Integer enterpriseId;
/**
* 状态1:有效 0:无效
* 状态0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -88,12 +88,13 @@ public class MenuRoleDTO implements Serializable{
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public MenuRoleDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -119,7 +120,7 @@ public class MenuRoleDTO implements Serializable{
", menuId=" + menuId +
", roleId=" + roleId +
", enterpriseId=" + enterpriseId +
", status=" + status +
", status=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
......
......@@ -29,9 +29,9 @@ public class OperationUserDTO implements Serializable{
private String phoneNumber;
/**
* 状态,1有效,0无效
* 状态,0有效,1无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -77,12 +77,13 @@ public class OperationUserDTO implements Serializable{
this.phoneNumber = phoneNumber;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public OperationUserDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -123,7 +124,7 @@ public class OperationUserDTO implements Serializable{
"operationUserId=" + operationUserId +
", operationUserName='" + operationUserName + '\'' +
", phoneNumber='" + phoneNumber + '\'' +
", status=" + status +
", status=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
", enterpriseId=" + enterpriseId +
......
......@@ -44,7 +44,7 @@ public class OrderAppResourceDTO implements Serializable {
/**
*
*/
private Integer status;
private Integer deleteFlag;
public Integer getOrderAppResourceId() {
return orderAppResourceId;
......@@ -94,12 +94,13 @@ public class OrderAppResourceDTO implements Serializable {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public OrderAppResourceDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
@Override
......@@ -111,7 +112,7 @@ public class OrderAppResourceDTO implements Serializable {
", content='" + content + '\'' +
", createTime=" + createTime +
", updateTime=" + updateTime +
", status=" + status +
", status=" + deleteFlag +
'}';
}
}
......@@ -41,9 +41,9 @@ public class RoleDTO implements Serializable{
private Integer enterpriseId;
/**
* 状态1:有效 0:无效
* 状态0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -84,12 +84,13 @@ public class RoleDTO implements Serializable{
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public RoleDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -122,7 +123,7 @@ public class RoleDTO implements Serializable{
"roleId=" + roleId +
", roleName='" + roleName + '\'' +
", enterpriseId=" + enterpriseId +
", status=" + status +
", status=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
", menuIds='" + menuIds + '\'' +
......
......@@ -36,7 +36,7 @@ public class UnionEnterpriseDTO implements Serializable {
/**
*
*/
private Integer status;
private Integer deleteFlag;
/**
* 授权状态,1授权中 2授权成功 3授权失败
......@@ -80,12 +80,13 @@ public class UnionEnterpriseDTO implements Serializable {
this.unionEnterpriseName = unionEnterpriseName;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public UnionEnterpriseDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Integer getAuthorizationStatus() {
......@@ -185,7 +186,7 @@ public class UnionEnterpriseDTO implements Serializable {
", unionCompanyName='" + unionCompanyName + '\'' +
", unionManagerName='" + unionManagerName + '\'' +
", unionManagerPhone='" + unionManagerPhone + '\'' +
", status=" + status +
", status=" + deleteFlag +
", authorizationStatus=" + authorizationStatus +
", authorizationTime=" + authorizationTime +
", enterpriseId=" + enterpriseId +
......
......@@ -68,9 +68,9 @@ public class UserDTO implements Serializable{
private Integer superAdmin;
/**
* 状态,1有效,0无效
* 状态,0有效,1无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -140,6 +140,11 @@ public class UserDTO implements Serializable{
*/
private String accountGroupIds;
/***
* 营销是否触达 1是0否
*/
private Integer markingFlag;
public Integer getUserId() {
return userId;
}
......@@ -180,12 +185,13 @@ public class UserDTO implements Serializable{
this.superAdmin = superAdmin;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public UserDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -320,6 +326,14 @@ public class UserDTO implements Serializable{
return this;
}
public Integer getMarkingFlag() {
return markingFlag;
}
public void setMarkingFlag(Integer markingFlag) {
this.markingFlag = markingFlag;
}
@Override
public String toString() {
return "UserDTO{" +
......@@ -330,7 +344,7 @@ public class UserDTO implements Serializable{
", passwordType=" + passwordType +
", confirmPassword='" + confirmPassword + '\'' +
", superAdmin=" + superAdmin +
", status=" + status +
", status=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
", enterpriseId=" + enterpriseId +
......
......@@ -43,9 +43,9 @@ public class UserResourceDTO implements Serializable{
private Integer enterpriseId;
/**
* 状态1:有效 0:无效
* 状态0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -89,12 +89,13 @@ public class UserResourceDTO implements Serializable{
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public UserResourceDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -120,7 +121,7 @@ public class UserResourceDTO implements Serializable{
", resourceId=" + resourceId +
", userId=" + userId +
", enterpriseId=" + enterpriseId +
", status=" + status +
", status=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
......
......@@ -42,9 +42,9 @@ public class UserRoleDTO implements Serializable{
private Integer enterpriseId;
/**
* 状态1:有效 0:无效
* 状态0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -88,12 +88,13 @@ public class UserRoleDTO implements Serializable{
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public UserRoleDTO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -119,7 +120,7 @@ public class UserRoleDTO implements Serializable{
", roleId=" + roleId +
", userId=" + userId +
", enterpriseId=" + enterpriseId +
", status=" + status +
", status=" + deleteFlag +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
......
......@@ -23,6 +23,8 @@ public class CollaboratorListQO extends PageQO{
private Integer status;
private Integer deleteFlag;
private Integer enterpriseId;
private Integer accountGroupId;
......@@ -76,4 +78,19 @@ public class CollaboratorListQO extends PageQO{
public void setCollaboratorIdList(List<Integer> collaboratorIdList) {
this.collaboratorIdList = collaboratorIdList;
}
public Integer getDeleteFlag() {
if (status != null) {
if (status == 1) {
return 0;
}
return 1;
}
return deleteFlag;
}
public CollaboratorListQO setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
}
......@@ -23,6 +23,7 @@ public class MenuListQO extends PageQO{
* 0:页面 1:权限项 2:操作项
*/
private Integer menuType;
private List<Integer> menuTypeList;
/**
* 层级
*/
......@@ -136,4 +137,13 @@ public class MenuListQO extends PageQO{
this.platformType = platformType;
return this;
}
public List<Integer> getMenuTypeList() {
return menuTypeList;
}
public MenuListQO setMenuTypeList(List<Integer> menuTypeList) {
this.menuTypeList = menuTypeList;
return this;
}
}
......@@ -55,7 +55,7 @@ public interface MenuApiService {
ServiceResponse<Set<String>> getAppIdSetByUserId(Integer userId);
/**
* 查询用户拥有的所有菜单路由权限,用于登录用户session用
* 查询用户没有权限的操作项(接口),用于登录用户session用
* @Title: listUserMenu

* @Description:

 * @author guojuxing
......@@ -194,6 +194,15 @@ public interface MenuApiService {
ServiceResponse<List<MenuDTO>> getAllMenuNotTree(String versionCode);
/**
* 查询gic平台所有的菜单数据,menu_type = 0 gic平台的菜单数据塞本地缓存
* @Title: setAllMenuToLocaleCache

* @Description:

* @author guojuxing 

* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>


*/
ServiceResponse<List<MenuDTO>> getAllMenu();
/**
* 运维处使用
* @param enterpriseId
* @return
......@@ -473,6 +482,14 @@ public interface MenuApiService {
ServiceResponse<MenuDTO> getMenuByMenuCode(String menuCode);
/**
* 获取已经购买的应用
* @param menuCode 权限菜单code
* @param enterpriseId
* @return
*/
ServiceResponse<MenuDTO> getHasBuyAppByMenuCode(String menuCode, Integer enterpriseId);
/**
* 同步测试菜单数据到生产
* @Title: syncProductMenu

* @Description:
......@@ -483,6 +500,25 @@ public interface MenuApiService {
ServiceResponse<Void> syncProductMenu(String menuCode);
/**
* gic菜单转到某一个应用下面
* @Title: switchGicMenuToApp

* @Description:

* @author guojuxing
* @param gicMenuCode
* @param appMenuCode 

* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>


*/
ServiceResponse<Void> switchGicMenuToApp(String gicMenuCode, String appMenuCode);
/**
* app菜单转到gic下面
* @param gicMenuCode
* @param appMenuCode
* @return
*/
ServiceResponse<Void> switchAppMenuToGic(String gicMenuCode, String appMenuCode);
/**
* test
* @Title: test
* @Description:
......
package com.gic.auth.config;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.context.annotation.Configuration;
/**
* 采集GIC系统操作日志
*
* @author leeon
* @date 2019年6月28日
*/
@Aspect
@Configuration
public class ParamAop {
private Logger logger = LogManager.getLogger(ParamAop.class);
/**
* 环绕通知
*
* @param joinPoint
* @return
* @throws Throwable
*/
@Around(value = "execution(* com.gic.*.service..*(..))")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
try {
// 当前方法
String currentMethodName = getMethodName(joinPoint);
// 当前方法参数列表
Object[] args = joinPoint.getArgs();
logger.info("请求方法:{}, 参数:{}", currentMethodName, args);
// 执行当前方法
return joinPoint.proceed();
} catch (Throwable throwable) {
logger.warn("拦截器错误", throwable);
throw throwable;
}
}
/**
* 获取当前方法
*
* @param joinPoint
* @return
* @throws
*/
private String getMethodName(ProceedingJoinPoint joinPoint) throws NoSuchMethodException {
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Object target = joinPoint.getTarget();
return target.getClass().getName() + "." + methodSignature.getName();
}
}
\ No newline at end of file
package com.gic.auth.constant;
/**
* 数据删除标志
* @ClassName: DeleteFlagConstants

* @Description: 

* @author guojuxing

* @date 2020/10/13 4:43 PM

*/
public class DeleteFlagConstants {
/**
* 数据正常状态
*/
public static final int NORMAL_STATUS = 0;
/**
* 数据删除状态
*/
public static final int DELETE_STATUS = 1;
}
......@@ -16,13 +16,7 @@ import java.util.List;
* @date 2020-09-10 9:38
*/
public interface TabAuditedGroupMapper {
/**
* 根据主键删除
*
* @param auditedGroupId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer auditedGroupId);
/**
* 插入一条记录
......
......@@ -16,13 +16,6 @@ import java.util.Map;
* @date 2020-09-10 9:38
*/
public interface TabAuditedGroupUserRelMapper {
/**
* 根据主键删除
*
* @param auditedGroupUserRelId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer auditedGroupUserRelId);
/**
* 插入一条记录
......@@ -133,4 +126,15 @@ public interface TabAuditedGroupUserRelMapper {
* @throws
*/
List<Integer> listAuditedGroupByUserId(@Param("enterpriseId") Integer enterpriseId, @Param("userId") Integer userId);
/**
* deleteByUserId
* @Title: deleteByUserId
* @Description:
* @author zhiwj
* @param userId
* @return void
* @throws
*/
void deleteByUserId(@Param("userId") Integer userId);
}
\ No newline at end of file
......@@ -15,13 +15,6 @@ import java.util.Map;
* @date 2020-09-10 9:39
*/
public interface TabAuditorAuditedGroupRelMapper {
/**
* 根据主键删除
*
* @param auditorAuditedGroupRelId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer auditorAuditedGroupRelId);
/**
* 插入一条记录
......
......@@ -14,13 +14,7 @@ import org.apache.ibatis.annotations.Param;
* @date 2020-09-10 9:39
*/
public interface TabAuditorMapper {
/**
* 根据主键删除
*
* @param auditorId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer auditorId);
/**
* 插入一条记录
......
......@@ -15,13 +15,7 @@ import java.util.Map;
* @date 2020-09-10 9:39
*/
public interface TabAuditorProjectItemRelMapper {
/**
* 根据主键删除
*
* @param auditorProjectItemRelId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer auditorProjectItemRelId);
/**
* 插入一条记录
......
......@@ -13,13 +13,7 @@ import java.util.List;
* @date 2020-09-10 9:39
*/
public interface TabSysAccountGroupMapper {
/**
* 根据主键删除
*
* @param accountGroupId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer accountGroupId);
/**
* 插入一条记录
......
......@@ -15,13 +15,6 @@ import java.util.List;
* @date 2020-09-10 9:39
*/
public interface TabSysAccountGroupRelMapper {
/**
* 根据主键删除
*
* @param accountGroupRelId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer accountGroupRelId);
/**
* 插入一条记录
......
......@@ -14,14 +14,6 @@ import java.util.List;
*/
public interface TabSysAuthCodeMapper {
/**
* 根据主键删除
*
* @param authCodeId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer authCodeId);
/**
* 插入一条记录
*
* @param record 实体对象
......
......@@ -13,13 +13,7 @@ import java.util.List;
* @date 2020-09-10 9:39
*/
public interface TabSysBusinessFrontResMapper {
/**
* 根据主键删除
*
* @param resourceId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer resourceId);
/**
* 插入一条记录
......
......@@ -15,13 +15,6 @@ import java.util.List;
* @date 2020-09-10 9:39
*/
public interface TabSysCollaboratorMapper {
/**
* 根据主键删除
*
* @param collaboratorId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer collaboratorId);
/**
* 插入一条记录
......
......@@ -13,13 +13,7 @@ import java.util.List;
* @date 2020-09-10 9:40
*/
public interface TabSysCollaboratorRoleRelMapper {
/**
* 根据主键删除
*
* @param collaboratorRoleRelId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer collaboratorRoleRelId);
/**
* 插入一条记录
......
......@@ -14,13 +14,7 @@ import java.util.List;
* @date 2020-09-10 9:40
*/
public interface TabSysMenuAuthDepartMapper {
/**
* 根据主键删除
*
* @param menuDepartId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer menuDepartId);
/**
* 插入一条记录
......
......@@ -15,13 +15,7 @@ import java.util.List;
* @date 2020-09-10 9:40
*/
public interface TabSysMenuItemMapper {
/**
* 根据主键删除
*
* @param menuItemId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer menuItemId);
/**
* 插入一条记录
......
package com.gic.auth.dao.mapper;
import com.gic.auth.dto.AuthItemListDTO;
import com.gic.auth.dto.MenuDTO;
import com.gic.auth.entity.TabSysMenu;
import com.gic.auth.qo.MenuListQO;
import com.gic.auth.qo.MenuOperationItemListQO;
......@@ -16,13 +17,7 @@ import java.util.List;
* @date 2020-09-10 9:41
*/
public interface TabSysMenuMapper {
/**
* 根据主键删除
*
* @param menuId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer menuId);
/**
* 插入一条记录
......@@ -57,6 +52,16 @@ public interface TabSysMenuMapper {
int updateByPrimaryKeySelective(TabSysMenu record);
/**
* 更新好办小程序应用
* @Title: updatePageForHaobanApplet

* @Description:

* @author guojuxing
* @param record

* @return int


*/
int updatePageForHaobanApplet(TabSysMenu record);
/**
* 根据主键更新记录
*
* @param record 实体对象
......@@ -138,6 +143,26 @@ public interface TabSysMenuMapper {
List<TabSysMenu> listByParentMenuIdList(@Param("parentMenuIdList") List<Integer> parentMenuIdList);
/**
* gic菜单转应用菜单的时候,批量进行修改相关数据
* @Title: updateMenuTmp

* @Description:

* @author guojuxing
* @param menuIdList
* @param project
* @param parentId
* @param parentCode
* @param menuVersion
* @param menuVersionName

* @return void


*/
void updateMenuTmp(@Param("menuIdList") List<Integer> menuIdList,
@Param("project") String project,
@Param("parentId") Integer parentId,
@Param("parentCode") String parentCode,
@Param("menuVersion") String menuVersion,
@Param("menuVersionName") String menuVersionName);
/**
* selectByIdsAndOrderBy
* @Title: selectByIdsAndOrderBy
* @Description:
......@@ -266,9 +291,10 @@ public interface TabSysMenuMapper {
* @Description:

* @author guojuxing
* @param projectList

* @param platformTypeList
* @return void


*/
void deleteNotInApp(@Param("list") List<String> projectList);
void deleteNotInApp(@Param("list") List<String> projectList, @Param("platformTypeList") List<Integer> platformTypeList);
/**
......
......@@ -14,13 +14,7 @@ import java.util.List;
* @date 2020-09-10 9:41
*/
public interface TabSysMenuRoleMapper {
/**
* 根据主键删除
*
* @param menuRoleId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer menuRoleId);
/**
* 插入一条记录
......
......@@ -11,13 +11,7 @@ import org.apache.ibatis.annotations.Param;
* @date 2020-09-10 9:41
*/
public interface TabSysOperationUserMapper {
/**
* 根据主键删除
*
* @param operationUserId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer operationUserId);
/**
* 插入一条记录
......
......@@ -12,13 +12,7 @@ import java.util.List;
* @date 2020-09-10 9:41
*/
public interface TabSysOrderAppResourceMapper {
/**
* 根据主键删除
*
* @param orderAppResourceId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer orderAppResourceId);
/**
* 插入一条记录
......
......@@ -15,13 +15,6 @@ import java.util.List;
* @date 2020-09-10 9:41
*/
public interface TabSysResourceMapper {
/**
* 根据主键删除
*
* @param resourceId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer resourceId);
/**
* 插入一条记录
......
......@@ -16,14 +16,6 @@ import java.util.List;
*/
public interface TabSysRoleMapper {
/**
* 根据主键删除
*
* @param roleId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer roleId);
/**
* 插入一条记录
*
* @param record 实体对象
......
......@@ -14,13 +14,7 @@ import java.util.List;
* @date 2020-09-10 9:42
*/
public interface TabSysUnionEnterpriseMapper {
/**
* 根据主键删除
*
* @param unionId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer unionId);
/**
* 插入一条记录
......
......@@ -14,13 +14,6 @@ import java.util.List;
* @date 2020-09-10 9:42
*/
public interface TabSysUnionEnterpriseResourceMapper {
/**
* 根据主键删除
*
* @param unionResourceId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer unionResourceId);
/**
* 插入一条记录
......
......@@ -15,13 +15,6 @@ import java.util.List;
* @date 2020-09-10 9:42
*/
public interface TabSysUserMapper {
/**
* 根据主键删除
*
* @param userId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer userId);
/**
* 插入一条记录
......
......@@ -15,13 +15,7 @@ import java.util.Map;
* @date 2020-09-10 9:44
*/
public interface TabSysUserResourceMapper {
/**
* 根据主键删除
*
* @param userResourceId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer userResourceId);
/**
* 插入一条记录
......
......@@ -12,13 +12,7 @@ import java.util.List;
* @date 2020-09-10 9:45
*/
public interface TabSysUserRoleMapper {
/**
* 根据主键删除
*
* @param userRoleId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer userRoleId);
/**
* 插入一条记录
......
......@@ -36,7 +36,7 @@ public class TabAuditedGroup {
/**
*
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -80,12 +80,13 @@ public class TabAuditedGroup {
this.allCheck = allCheck;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabAuditedGroup setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -36,7 +36,7 @@ public class TabAuditedGroupUserRel {
/**
*
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -80,12 +80,13 @@ public class TabAuditedGroupUserRel {
this.userId = userId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabAuditedGroupUserRel setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -51,7 +51,7 @@ public class TabAuditor {
/**
*
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -119,12 +119,13 @@ public class TabAuditor {
this.isUse = isUse;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabAuditor setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -36,7 +36,7 @@ public class TabAuditorAuditedGroupRel {
/**
*
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -80,12 +80,13 @@ public class TabAuditorAuditedGroupRel {
this.auditedGroupId = auditedGroupId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabAuditorAuditedGroupRel setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -36,7 +36,7 @@ public class TabAuditorProjectItemRel {
/**
*
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -80,12 +80,13 @@ public class TabAuditorProjectItemRel {
this.projectItemId = projectItemId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabAuditorProjectItemRel setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -29,9 +29,9 @@ public class TabSysAccountGroup {
private Integer enterpriseId;
/**
* 1:有效 0:无效
* 0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
* 排序
......@@ -72,12 +72,13 @@ public class TabSysAccountGroup {
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysAccountGroup setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Integer getSort() {
......
......@@ -34,9 +34,9 @@ public class TabSysAccountGroupRel {
private Integer enterpriseId;
/**
* 1:有效 0:无效
* 0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
* 1:管理员 2:协作人
......@@ -85,14 +85,6 @@ public class TabSysAccountGroupRel {
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getType() {
return type;
}
......
......@@ -34,9 +34,9 @@ public class TabSysAuthCode {
private Integer relationId;
/**
* 1有效 0失效
* 0有效 1失效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -85,12 +85,13 @@ public class TabSysAuthCode {
this.relationId = relationId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysAuthCode setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -49,9 +49,9 @@ public class TabSysBusinessFrontRes {
private Integer enterpriseId;
/**
* 状态1:有效 0:无效
* 状态0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -119,12 +119,13 @@ public class TabSysBusinessFrontRes {
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysBusinessFrontRes setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -64,9 +64,9 @@ public class TabSysCollaborator {
private String subAppIds;
/**
* 状态: 0:无效 1:youxiao
* 状态: 1:无效 0:youxiao
*/
private Integer status;
private Integer deleteFlag;
/**
* 创建时间
......@@ -150,12 +150,13 @@ public class TabSysCollaborator {
this.subAppIds = subAppIds;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysCollaborator setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -29,9 +29,9 @@ public class TabSysCollaboratorRoleRel {
private Integer menuId;
/**
* 0:无效2:有效
* 1:无效0:有效
*/
private Integer status;
private Integer deleteFlag;
/**
* 创建时间
......@@ -67,12 +67,13 @@ public class TabSysCollaboratorRoleRel {
this.menuId = menuId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysCollaboratorRoleRel setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -54,9 +54,9 @@ public class TabSysMenu {
private Integer sort;
/**
* 0删除1有效
* 1删除0有效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -187,12 +187,13 @@ public class TabSysMenu {
this.sort = sort;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysMenu setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -44,9 +44,9 @@ public class TabSysMenuAuthDepart {
private String positionName;
/**
* 1:有效 0:无效
* 0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
* 创建时间
......@@ -112,12 +112,12 @@ public class TabSysMenuAuthDepart {
return this;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public TabSysMenuAuthDepart setStatus(Integer status) {
this.status = status;
public TabSysMenuAuthDepart setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
......
......@@ -29,9 +29,9 @@ public class TabSysMenuItem {
private Integer itemId;
/**
* 1:有效 0:无效
* 0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
* 创建时间
......@@ -67,12 +67,13 @@ public class TabSysMenuItem {
this.itemId = itemId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysMenuItem setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -34,9 +34,9 @@ public class TabSysMenuRole {
private Integer enterpriseId;
/**
* 状态1:有效 0:无效
* 状态0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -80,12 +80,13 @@ public class TabSysMenuRole {
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysMenuRole setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -29,9 +29,9 @@ public class TabSysOperationUser {
private String phoneNumber;
/**
* 状态,1有效,0无效
* 状态,0有效,1无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -77,12 +77,13 @@ public class TabSysOperationUser {
this.phoneNumber = phoneNumber;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysOperationUser setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -46,7 +46,7 @@ public class TabSysOrderAppResource {
/**
*
*/
private Integer status;
private Integer deleteFlag;
public Integer getOrderAppResourceId() {
return orderAppResourceId;
......@@ -96,11 +96,12 @@ public class TabSysOrderAppResource {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysOrderAppResource setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
}
\ No newline at end of file
......@@ -113,7 +113,7 @@ public class TabSysResource {
/**
*
*/
private Integer status;
private Integer deleteFlag;
public Integer getResourceId() {
return resourceId;
......@@ -235,11 +235,12 @@ public class TabSysResource {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysResource setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
}
\ No newline at end of file
......@@ -29,9 +29,9 @@ public class TabSysRole {
private Integer enterpriseId;
/**
* 状态1:有效 0:无效
* 状态0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -67,12 +67,13 @@ public class TabSysRole {
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysRole setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -31,7 +31,7 @@ public class TabSysUnionEnterprise {
/**
*
*/
private Integer status;
private Integer deleteFlag;
/**
* 授权状态,1授权中 2授权成功 3授权失败
......@@ -82,12 +82,13 @@ public class TabSysUnionEnterprise {
this.unionEnterpriseName = unionEnterpriseName;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysUnionEnterprise setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Integer getAuthorizationStatus() {
......
......@@ -66,7 +66,7 @@ public class TabSysUnionEnterpriseResource {
/**
*
*/
private Integer status;
private Integer deleteFlag;
public Integer getUnionResourceId() {
return unionResourceId;
......@@ -148,11 +148,12 @@ public class TabSysUnionEnterpriseResource {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysUnionEnterpriseResource setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
}
\ No newline at end of file
......@@ -39,9 +39,9 @@ public class TabSysUser {
private Integer superAdmin;
/**
* 状态,1有效,0无效
* 状态,0有效,1无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -93,6 +93,11 @@ public class TabSysUser {
*/
private Integer userPosition;
/***
* 营销是否触达 1是0否
*/
private Integer markingFlag;
public Integer getUserId() {
return userId;
}
......@@ -133,12 +138,13 @@ public class TabSysUser {
this.superAdmin = superAdmin;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysUser setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......@@ -223,4 +229,13 @@ public class TabSysUser {
this.userPosition = userPosition;
return this;
}
public Integer getMarkingFlag() {
return markingFlag;
}
public TabSysUser setMarkingFlag(Integer markingFlag) {
this.markingFlag = markingFlag;
return this;
}
}
\ No newline at end of file
......@@ -34,9 +34,9 @@ public class TabSysUserResource {
private Integer enterpriseId;
/**
* 状态1:有效 0:无效
* 状态0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -80,12 +80,13 @@ public class TabSysUserResource {
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysUserResource setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -34,9 +34,9 @@ public class TabSysUserRole {
private Integer enterpriseId;
/**
* 状态1:有效 0:无效
* 状态0:有效 1:无效
*/
private Integer status;
private Integer deleteFlag;
/**
*
......@@ -80,12 +80,13 @@ public class TabSysUserRole {
this.enterpriseId = enterpriseId;
}
public Integer getStatus() {
return status;
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setStatus(Integer status) {
this.status = status;
public TabSysUserRole setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
return this;
}
public Date getCreateTime() {
......
......@@ -79,4 +79,15 @@ public interface AuditedGroupUserRelService {
* @throws
*/
List<Integer> listAuditedGroupByUserId(Integer enterpriseId, Integer userId);
/**
* deleteByUserId
* @Title: deleteByUserId
* @Description:
* @author zhiwj
* @param userId
* @return void
* @throws
*/
void deleteByUserId(Integer userId);
}
......@@ -71,6 +71,16 @@ public interface MenuService {
void updatePage(MenuDTO menuDTO);
/**
* 更新好办小程序应用数据
* @Title: updatePageForHaobanApplet

* @Description:

* @author guojuxing
* @param menuDTO

* @return void


*/
void updatePageForHaobanApplet(MenuDTO menuDTO);
/**
* 查询页面下面的操作项列表数据
* @Title: listMenuRoleByParentId

* @Description:
......@@ -250,6 +260,31 @@ public interface MenuService {

*/
void deleteNotInApp(List<String> projectList);
/**
* 查询所有的level >= 3的数据
* @Title: listMenuForGicContainChild

* @Description:

* @author guojuxing
* @param parentIdList
level = 2的menu_id集合
* @return java.util.List<com.gic.auth.entity.TabSysMenu>


*/
List<TabSysMenu> listMenuForGicContainChild(List<Integer> parentIdList);
/**
* gic菜单转应用菜单的时候,批量进行修改相关数据
* @Title: updateMenuTmp

* @Description:

* @author guojuxing
* @param menuIdList 需要修改的菜单ID集合
* @param project applicationId
* @param parentId 应用菜单的menuId
* @param parentCode 应用菜单的menuCode
* @param menuVersion 应用的版本code
* @param menuVersionName
 应用的版本名称
* @return void


*/
void updateMenuTmp(List<Integer> menuIdList, String project, Integer parentId, String parentCode, String menuVersion, String menuVersionName);
/***********同步测试环境数据到生产************/
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabSysAccountGroupMapper;
import com.gic.auth.dto.AccountGroupDTO;
import com.gic.auth.entity.TabSysAccountGroup;
......@@ -24,7 +25,7 @@ public class AccountGroupServiceImpl implements AccountGroupService{
private TabSysAccountGroupMapper tabSysAccountGroupMapper;
@Override
public int save(AccountGroupDTO dto) {
dto.setStatus(1);
dto.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
dto.setCreateTime(new Date());
dto.setUpdateTime(new Date());
TabSysAccountGroup record = EntityUtil.changeEntityNew(TabSysAccountGroup.class, dto);
......@@ -73,7 +74,7 @@ public class AccountGroupServiceImpl implements AccountGroupService{
public int updateStatusByAccountGroupId(Integer accountGroupId) {
TabSysAccountGroup record = new TabSysAccountGroup();
record.setAccountGroupId(accountGroupId);
record.setStatus(0);
record.setDeleteFlag(DeleteFlagConstants.DELETE_STATUS);
return tabSysAccountGroupMapper.updateByPrimaryKeySelective(record);
}
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabAuditedGroupMapper;
import com.gic.auth.dto.AuditedGroupDTO;
import com.gic.auth.entity.TabAuditedGroup;
......@@ -41,7 +42,7 @@ public class AuditedGroupServiceImpl implements AuditedGroupService {
@Override
public Integer save(AuditedGroupDTO auditedGroupDTO) {
TabAuditedGroup auditedGroup = EntityUtil.changeEntityByJSON(TabAuditedGroup.class, auditedGroupDTO);
auditedGroup.setStatus(GlobalInfo.DATA_STATUS_NORMAL);
auditedGroup.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
auditedGroup.setCreateTime(new Date());
tabAuditedGroupMapper.insertSelective(auditedGroup);
return auditedGroup.getAuditedGroupId();
......@@ -70,7 +71,7 @@ public class AuditedGroupServiceImpl implements AuditedGroupService {
@Override
public TabAuditedGroup getAuditedGroup(Integer auditedGroupId) {
TabAuditedGroup tabAuditedGroup = tabAuditedGroupMapper.selectByPrimaryKey(auditedGroupId);
return tabAuditedGroup != null && (GlobalInfo.DATA_STATUS_NORMAL == tabAuditedGroup.getStatus()) ? tabAuditedGroup : null;
return tabAuditedGroup != null && (DeleteFlagConstants.NORMAL_STATUS == tabAuditedGroup.getDeleteFlag()) ? tabAuditedGroup : null;
}
@Override
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabAuditedGroupUserRelMapper;
import com.gic.auth.dto.AuditedGroupDTO;
import com.gic.auth.dto.AuditedGroupUserRelDTO;
import com.gic.auth.entity.TabAuditedGroupUserRel;
import com.gic.auth.service.AuditedGroupUserRelService;
import com.gic.commons.util.GlobalInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -36,7 +36,7 @@ public class AuditedGroupUserRelServiceImpl implements AuditedGroupUserRelServic
auditedGroupUserRel.setEnterpriseId(auditedGroupDTO.getEnterpriseId());
auditedGroupUserRel.setAuditedGroupId(auditedGroupDTO.getAuditedGroupId());
auditedGroupUserRel.setUserId(userId);
auditedGroupUserRel.setStatus(GlobalInfo.DATA_STATUS_NORMAL);
auditedGroupUserRel.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
auditedGroupUserRel.setCreateTime(new Date());
tabAuditedGroupUserRelMapper.insertSelectiveByNotExist(auditedGroupUserRel);
}
......@@ -78,4 +78,9 @@ public class AuditedGroupUserRelServiceImpl implements AuditedGroupUserRelServic
public List<Integer> listAuditedGroupByUserId(Integer enterpriseId, Integer userId) {
return tabAuditedGroupUserRelMapper.listAuditedGroupByUserId(enterpriseId, userId);
}
@Override
public void deleteByUserId(Integer userId) {
tabAuditedGroupUserRelMapper.deleteByUserId(userId);
}
}
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabAuditorAuditedGroupRelMapper;
import com.gic.auth.dto.AuditorAuditedGroupRelDTO;
import com.gic.auth.entity.TabAuditedGroupUserRel;
......@@ -45,7 +46,7 @@ public class AuditorAuditedGroupRelServiceImpl implements AuditorAuditedGroupRel
itemRel.setEnterpriseId(enterpriseId);
itemRel.setAuditorId(auditorId);
itemRel.setAuditedGroupId(auditedGroupId);
itemRel.setStatus(GlobalInfo.DATA_STATUS_NORMAL);
itemRel.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
itemRel.setCreateTime(new Date());
tabAuditorAuditedGroupRelMapper.insertSelectiveByNotExist(itemRel);
}
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabAuditorProjectItemRelMapper;
import com.gic.auth.entity.TabAuditorProjectItemRel;
import com.gic.auth.service.AuditorProjectItemRelService;
......@@ -34,7 +35,7 @@ public class AuditorProjectItemRelServiceImpl implements AuditorProjectItemRelSe
itemRel.setEnterpriseId(enterpriseId);
itemRel.setAuditorId(auditorId);
itemRel.setProjectItemId(projectItemId);
itemRel.setStatus(GlobalInfo.DATA_STATUS_NORMAL);
itemRel.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
itemRel.setCreateTime(new Date());
tabAuditorProjectItemRelMapper.insertSelectiveByNotExist(itemRel);
}
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabAuditorAuditedGroupRelMapper;
import com.gic.auth.dao.mapper.TabAuditorMapper;
import com.gic.auth.dto.AuditorAuditedGroupRelDTO;
......@@ -71,7 +72,7 @@ public class AuditorServiceImpl implements AuditorService {
auditor.setPhone(copy.getPhone());
auditor.setUserId(copy.getUserId());
auditor.setIsUse(copy.getIsUse());
auditor.setStatus(GlobalInfo.DATA_STATUS_NORMAL);
auditor.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
auditor.setCreateTime(new Date());
tabAuditorMapper.insertSelective(auditor);
return auditor.getAuditorId();
......@@ -93,7 +94,7 @@ public class AuditorServiceImpl implements AuditorService {
@Override
public TabAuditor getAuditor(Integer auditorId) {
TabAuditor auditor = tabAuditorMapper.selectByPrimaryKey(auditorId);
if (auditor != null && auditor.getStatus() == GlobalInfo.DATA_STATUS_NORMAL) {
if (auditor != null && auditor.getDeleteFlag() == DeleteFlagConstants.NORMAL_STATUS) {
return auditor;
}
return null;
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabSysAuthCodeMapper;
import com.gic.auth.entity.TabSysAuthCode;
import com.gic.auth.service.AuthCodeService;
......@@ -30,7 +31,7 @@ public class AuthCodeServiceImpl implements AuthCodeService {
public int expireAuthCode(Integer authCodeId) {
TabSysAuthCode tabSysAuthCode = new TabSysAuthCode();
tabSysAuthCode.setAuthCodeId(authCodeId);
tabSysAuthCode.setStatus(Constants.DEL_STATUS);
tabSysAuthCode.setDeleteFlag(DeleteFlagConstants.DELETE_STATUS);
return this.tabSysAuthCodeMapper.updateByPrimaryKeySelective(tabSysAuthCode);
}
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabSysBusinessFrontResMapper;
import com.gic.auth.dto.BusinessFrontResDTO;
import com.gic.auth.entity.TabSysBusinessFrontRes;
......@@ -25,7 +26,7 @@ public class BusinessFrontResServiceImpl implements BusinessFrontResService{
@Override
public Integer save(BusinessFrontResDTO dto) {
dto.setStatus(1);
dto.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
dto.setCreateTime(new Date());
dto.setUpdateTime(new Date());
TabSysBusinessFrontRes record = EntityUtil.changeEntityNew(TabSysBusinessFrontRes.class, dto);
......@@ -49,7 +50,7 @@ public class BusinessFrontResServiceImpl implements BusinessFrontResService{
public void delete(Integer resourceId) {
TabSysBusinessFrontRes record = new TabSysBusinessFrontRes();
record.setResourceId(resourceId);
record.setStatus(0);
record.setDeleteFlag(DeleteFlagConstants.DELETE_STATUS);
record.setUpdateTime(new Date());
tabSysBusinessFrontResMapper.updateByPrimaryKeySelective(record);
}
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabSysCollaboratorMapper;
import com.gic.auth.dto.CollaboratorDTO;
import com.gic.auth.dto.CollaboratorListDTO;
......@@ -31,7 +32,7 @@ public class CollaboratorServiceImpl implements CollaboratorService {
public Integer save(CollaboratorDTO dto) {
dto.setCreateTime(new Date());
dto.setUpdateTime(new Date());
dto.setStatus(1);
dto.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
TabSysCollaborator record = EntityUtil.changeEntityNew(TabSysCollaborator.class, dto);
tabSysCollaboratorMapper.insertSelective(record);
return record.getCollaboratorId();
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.constant.MenuPlatformTypeEnum;
import com.gic.auth.dao.mapper.TabSysMenuMapper;
import com.gic.auth.dto.AuthItemListDTO;
import com.gic.auth.dto.MenuDTO;
......@@ -55,10 +57,10 @@ public class MenuServiceImpl implements MenuService {
//默认gic平台菜单
record.setPlatformType(0);
}
record.setStatus(1);
record.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
if (StringUtils.isBlank(menuDTO.getMenuCode())) {
//权限项没有菜单code数据,但是这样会导致不好批量上传到生产,给一个默认的数据
record.setMenuCode(menuDTO.getParentCode() + "-" + menuDTO.getLevel() + menuDTO.getSort());
record.setMenuCode(menuDTO.getParentCode() == null ? "noParentCode" : menuDTO.getParentCode() + "-" + menuDTO.getLevel() + menuDTO.getSort());
}
tabSysMenuMapper.insertSelective(record);
return record.getMenuId();
......@@ -78,6 +80,14 @@ public class MenuServiceImpl implements MenuService {
}
@Override
public void updatePageForHaobanApplet(MenuDTO menuDTO) {
TabSysMenu record = EntityUtil.changeEntityNew(TabSysMenu.class, menuDTO);
record.setUpdateTime(new Date());
record.setPlatformType(MenuPlatformTypeEnum.HAOBAN_APPLET_APP.getCode());
tabSysMenuMapper.updatePageForHaobanApplet(record);
}
@Override
public List<TabSysMenu> listMenuItemByParentId(Integer parentId) {
List<TabSysMenu> list = tabSysMenuMapper.listMenuItemByParentId(parentId);
if (CollectionUtils.isNotEmpty(list)) {
......@@ -209,7 +219,37 @@ public class MenuServiceImpl implements MenuService {
@Override
public void deleteNotInApp(List<String> projectList) {
tabSysMenuMapper.deleteNotInApp(projectList);
//目前删除platform_type 为XXX的数据,做到同步应用市场应用数据
List<Integer> platformTypeList = new ArrayList<>(2);
platformTypeList.add(MenuPlatformTypeEnum.GIC.getCode());
platformTypeList.add(MenuPlatformTypeEnum.HAOBAN_APP.getCode());
platformTypeList.add(MenuPlatformTypeEnum.HAOBAN_APPLET_APP.getCode());
tabSysMenuMapper.deleteNotInApp(projectList, platformTypeList);
}
@Override
public List<TabSysMenu> listMenuForGicContainChild(List<Integer> parentIdList) {
if (CollectionUtils.isEmpty(parentIdList)) {
return new ArrayList<>();
}
List<TabSysMenu> result = new ArrayList<>();
List<TabSysMenu> list = tabSysMenuMapper.listByParentMenuIdList(parentIdList);
while (CollectionUtils.isNotEmpty(list)) {
result.addAll(list);
List<Integer> menuIdList = list
.stream()
.filter(e -> e != null)
.map(e -> e.getMenuId())
.collect(Collectors.toList());
list.clear();
list = tabSysMenuMapper.listByParentMenuIdList(menuIdList);
}
return result;
}
@Override
public void updateMenuTmp(List<Integer> menuIdList, String project, Integer parentId, String parentCode, String menuVersion, String menuVersionName) {
tabSysMenuMapper.updateMenuTmp(menuIdList, project, parentId, parentCode, menuVersion, menuVersionName);
}
@Override
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabSysOperationUserMapper;
import com.gic.auth.dto.OperationUserDTO;
import com.gic.auth.entity.TabSysOperationUser;
......@@ -32,7 +33,7 @@ public class OperationUserServiceImpl implements OperationUserService{
public Integer save(OperationUserDTO dto) {
dto.setCreateTime(new Date());
dto.setUpdateTime(new Date());
dto.setStatus(1);
dto.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
if (StringUtils.isBlank(dto.getPhoneAreaCode())) {
dto.setPhoneAreaCode("86");
}
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabSysOrderAppResourceMapper;
import com.gic.auth.dto.OrderAppResourceDTO;
import com.gic.auth.entity.TabSysOrderAppResource;
......@@ -28,7 +29,7 @@ public class OrderAppResourceServiceImpl implements OrderAppResourceService {
public Integer save(OrderAppResourceDTO orderAppResourceDTO) {
TabSysOrderAppResource resource = EntityUtil.changeEntityByJSON(TabSysOrderAppResource.class, orderAppResourceDTO);
resource.setCreateTime(new Date());
resource.setStatus(GlobalInfo.DATA_STATUS_NORMAL);
resource.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
tabSysOrderAppResourceMapper.insertSelective(resource);
return resource.getOrderAppResourceId();
}
......@@ -45,7 +46,7 @@ public class OrderAppResourceServiceImpl implements OrderAppResourceService {
public Integer del(Integer orderAppResourceId) {
TabSysOrderAppResource orderAppResource = new TabSysOrderAppResource();
orderAppResource.setOrderAppResourceId(orderAppResourceId);
orderAppResource.setStatus(GlobalInfo.DATA_STATUS_DELETE);
orderAppResource.setDeleteFlag(DeleteFlagConstants.DELETE_STATUS);
return tabSysOrderAppResourceMapper.updateByPrimaryKeySelective(orderAppResource);
}
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabSysResourceMapper;
import com.gic.auth.dto.ResourceDTO;
import com.gic.auth.entity.TabSysResource;
......@@ -31,7 +32,7 @@ public class ResourceServiceImpl implements ResourceService {
@Override
public Integer save(ResourceDTO resourceDTO) {
TabSysResource resource = EntityUtil.changeEntityByOrika(TabSysResource.class, resourceDTO);
resource.setStatus(GlobalInfo.DATA_STATUS_NORMAL);
resource.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
resource.setCreateTime(new Date());
return tabSysResourceMapper.insertSelective(resource);
}
......@@ -45,7 +46,7 @@ public class ResourceServiceImpl implements ResourceService {
@Override
public Integer delResource(Integer resourceId) {
TabSysResource resource = new TabSysResource();
resource.setStatus(GlobalInfo.DATA_STATUS_DELETE);
resource.setDeleteFlag(DeleteFlagConstants.DELETE_STATUS);
resource.setResourceId(resourceId);
return tabSysResourceMapper.updateByPrimaryKeySelective(resource);
}
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabSysUnionEnterpriseMapper;
import com.gic.auth.entity.TabSysUnionEnterprise;
import com.gic.auth.service.UnionEnterpriseService;
......@@ -46,7 +47,7 @@ public class UnionEnterpriseServiceImpl implements UnionEnterpriseService {
public int delUnionEnterprise(Integer id) {
TabSysUnionEnterprise enterprise = new TabSysUnionEnterprise();
enterprise.setUnionId(id);
enterprise.setStatus(Constants.DEL_STATUS);
enterprise.setDeleteFlag(DeleteFlagConstants.DELETE_STATUS);
return this.tabSysUnionEnterpriseMapper.updateByPrimaryKeySelective(enterprise);
}
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.AuthorizationStatusEnum;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dao.mapper.TabSysUnionEnterpriseResourceMapper;
import com.gic.auth.dto.UnionEnterpriseResourceDTO;
import com.gic.auth.entity.TabSysUnionEnterpriseResource;
......@@ -35,7 +36,7 @@ public class UnionEnterrpiseResourceServiceImpl implements UnionEnterpriseResour
return this.tabSysUnionEnterpriseResourceMapper.updateByPrimaryKeySelective(resource);
}else {
resource.setAuthorizationStatus(AuthorizationStatusEnum.NORMAL.getCode());
resource.setStatus(Constants.NORMAL_STATUS);
resource.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
resource.setUpdateTime(new Date());
resource.setCreateTime(new Date());
resource.setUnionId(unionId);
......
package com.gic.auth.service.impl;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.constant.LoginUserTypeEnum;
import com.gic.auth.dao.mapper.TabSysUserMapper;
import com.gic.auth.dto.UserDTO;
......@@ -33,7 +34,7 @@ public class UserServiceImpl implements UserService {
userDTO.setLoginType(LoginUserTypeEnum.GIC_USER.getCode());
userDTO.setCreateTime(new Date());
userDTO.setUpdateTime(new Date());
userDTO.setStatus(1);
userDTO.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
TabSysUser tabUser = EntityUtil.changeEntityNew(TabSysUser.class, userDTO);
if (tabUser.getAccountType() == null) {
//永久有效账号
......@@ -48,7 +49,7 @@ public class UserServiceImpl implements UserService {
userDTO.setLoginType(LoginUserTypeEnum.OPERATION_USER.getCode());
userDTO.setCreateTime(new Date());
userDTO.setUpdateTime(new Date());
userDTO.setStatus(1);
userDTO.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
//设置超管权限
userDTO.setSuperAdmin(1);
TabSysUser tabUser = EntityUtil.changeEntityNew(TabSysUser.class, userDTO);
......
......@@ -2,6 +2,7 @@ package com.gic.auth.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.constant.AccountGroupMemberTypeEnum;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.constant.SignConstants;
import com.gic.auth.dto.AccountGroupDTO;
import com.gic.auth.dto.AccountGroupListDTO;
......@@ -205,7 +206,7 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
Date now = new Date();
for (AccountGroupMemberDTO dto : list) {
AccountGroupRelDTO temp = new AccountGroupRelDTO();
temp.setStatus(1);
temp.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
if (dto.getAccountGroupId() == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "分组ID不能改为空");
}
......@@ -343,7 +344,7 @@ public class AccountGroupApiServiceImpl implements AccountGroupApiService {
List<AccountGroupRelDTO> result = new ArrayList<>();
for (Integer userId : userIdList) {
AccountGroupRelDTO temp = new AccountGroupRelDTO();
temp.setStatus(1);
temp.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
temp.setAccountGroupId(groupId);
temp.setCreateTime(now);
temp.setUpdateTime(now);
......
package com.gic.auth.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dto.AuthCodeDTO;
import com.gic.auth.entity.TabSysAuthCode;
import com.gic.auth.service.AuthCodeApiService;
......@@ -29,7 +30,7 @@ public class AuthCodeApiServiceImpl implements AuthCodeApiService {
TabSysAuthCode sysAuthCode = EntityUtil.changeEntityByJSON(TabSysAuthCode.class, authCodeDTO);
sysAuthCode.setCreateTime(new Date());
sysAuthCode.setUpdateTime(new Date());
sysAuthCode.setStatus(Constants.NORMAL_STATUS);
sysAuthCode.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
this.authCodeService.saveAuthCode(sysAuthCode);
return ServiceResponse.success(sysAuthCode.getAuthCodeId());
}
......@@ -56,7 +57,7 @@ public class AuthCodeApiServiceImpl implements AuthCodeApiService {
public ServiceResponse validateAuthCode(Integer authCodeId, String authCode) {
TabSysAuthCode sysAuthCode = this.authCodeService.getAuthCode(authCodeId);
if(sysAuthCode != null){
if(sysAuthCode.getStatus() == 0){
if(sysAuthCode.getDeleteFlag() == DeleteFlagConstants.DELETE_STATUS){
return EnterpriseServiceResponse.failure(ErrorCode.AUTHCODE_USED);
}
if(sysAuthCode.getExpirationTime().before(new Date())){
......
......@@ -3,6 +3,7 @@ package com.gic.auth.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.constant.AccountGroupMemberTypeEnum;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.constant.SignConstants;
import com.gic.auth.dto.AppDTO;
import com.gic.auth.dto.CollaboratorDTO;
......@@ -169,7 +170,7 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
temp.setCreateTime(now);
temp.setUpdateTime(now);
temp.setMenuId(Integer.parseInt(str));
temp.setStatus(1);
temp.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
list.add(temp);
}
collaboratorRoleRelService.deleteByCollaboratorId(collaboratorId);
......@@ -186,7 +187,7 @@ public class CollaboratorApiServiceImpl implements CollaboratorApiService {
}
CollaboratorDTO dto = new CollaboratorDTO();
dto.setCollaboratorId(collaboratorId);
dto.setStatus(0);
dto.setDeleteFlag(DeleteFlagConstants.DELETE_STATUS);
collaboratorService.update(dto);
return ServiceResponse.success();
}
......
......@@ -29,6 +29,7 @@ import com.gic.open.api.dto.*;
import com.gic.open.api.service.AppTokenApiService;
import com.gic.open.api.service.ApplicationApiService;
import com.gic.open.api.service.ServeApiService;
import com.gic.redis.data.util.RedisUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -123,42 +124,17 @@ public class MenuApiServiceImpl implements MenuApiService {
if (tabSysUser == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "用户不存在");
}
if (StringUtils.isBlank(versionCode)) {
return ServiceResponse.success(new ArrayList<>());
}
//是否是运维用户
boolean isOperationUser = tabSysUser.getLoginType().intValue() != 0;
List<MenuDTO> result;
if (tabSysUser.getSuperAdmin().intValue() == 1) {
List<TabSysMenu> temp = new ArrayList<>();
//超级管理员
MenuListQO params = new MenuListQO();
if (!isOperationUser) {
params.setAuthTypeList(Arrays.stream(new Integer[]{1,2}).collect(Collectors.toList()));
}
//查询gic的菜单
params.setIsGIC(MenuProjectConstants.DEFAULT_PROJECT_CODE);
params.setVersionCode(versionCode);
params.setMenuType(MenuTypeEnum.PAGE.getCode());
temp.addAll(this.menuService.listMenu(params));
//查询应用的菜单
params.setVersionCode("");
params.setIsGIC(MenuProjectConstants.APP_PROJECT_CODE);
params.setMenuType(MenuTypeEnum.PAGE.getCode());
temp.addAll(this.menuService.listMenu(params));
result = EntityUtil.changeEntityListNew(MenuDTO.class, filterOperationUserDepartAuth(temp, tabSysUser));
//没有权限的操作项数据
ServiceResponse<List<MenuDTO>> tempResult = getNoAuthOperationItem(userId, MenuProjectConstants.ALL_CODE,
versionCode);
return ServiceResponse.success(tempResult.getResult());
} else {
List<TabSysMenu> menuList = getUserMenuList(userId);
result = EntityUtil.changeEntityListNew(MenuDTO.class, menuList);
//没有权限的操作项数据
ServiceResponse<List<MenuDTO>> tempResult = getNoAuthOperationItem(userId, MenuProjectConstants.ALL_CODE,
versionCode);
result.addAll(tempResult.getResult());
return ServiceResponse.success(tempResult.getResult());
}
return ServiceResponse.success(result);
}
@Override
......@@ -259,6 +235,19 @@ public class MenuApiServiceImpl implements MenuApiService {
}
@Override
public ServiceResponse<List<MenuDTO>> getAllMenu() {
//超级管理员
MenuListQO params = new MenuListQO();
//查询gic的菜单
List<Integer> menuTypeList = new ArrayList<>(2);
menuTypeList.add(MenuTypeEnum.PAGE.getCode());
menuTypeList.add(MenuTypeEnum.OPERATION.getCode());
params.setMenuTypeList(menuTypeList);
List<MenuDTO> result = EntityUtil.changeEntityListNew(MenuDTO.class, this.menuService.listMenu(params));
return ServiceResponse.success(result);
}
@Override
public ServiceResponse<List<MenuDTO>> getSuperAdminMenuNotTree(Integer enterpriseId) {
ServiceResponse<EnterpriseDTO> result = enterpriseApiService.getEnterpriseById(enterpriseId);
if (result.isSuccess()) {
......@@ -435,7 +424,7 @@ public class MenuApiServiceImpl implements MenuApiService {
if (record.getMenuType().intValue() == MenuTypeEnum.PAGE.getCode()) {
//如果是页面,判断下面是否有子页面
if (menuService.isHasChild(menuId)) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "页面下有项目,不允许删除页面");
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "页面下有项目,不允许删除页面");
}
} else if (record.getMenuType().intValue() == MenuTypeEnum.ROLE.getCode()) {
//权限项,需要同时删除关联表
......@@ -444,7 +433,7 @@ public class MenuApiServiceImpl implements MenuApiService {
MenuDTO menuDTO = new MenuDTO();
menuDTO.setMenuId(menuId);
menuDTO.setStatus(0);
menuDTO.setDeleteFlag(DeleteFlagConstants.DELETE_STATUS);
menuService.updatePage(menuDTO);
return ServiceResponse.success();
}
......@@ -607,7 +596,7 @@ public class MenuApiServiceImpl implements MenuApiService {
MenuItemDTO menuItemDTO = new MenuItemDTO();
menuItemDTO.setItemId(Integer.parseInt(operationItem));
menuItemDTO.setMenuId(menuId);
menuItemDTO.setStatus(1);
menuItemDTO.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
menuItemDTO.setCreateTime(now);
menuItemDTO.setUpdateTime(now);
itemDTOList.add(menuItemDTO);
......@@ -662,7 +651,7 @@ public class MenuApiServiceImpl implements MenuApiService {
MenuItemDTO menuItemDTO = new MenuItemDTO();
menuItemDTO.setItemId(Integer.parseInt(operationItem));
menuItemDTO.setMenuId(params.getMenuId());
menuItemDTO.setStatus(1);
menuItemDTO.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
menuItemDTO.setCreateTime(now);
menuItemDTO.setUpdateTime(now);
itemDTOList.add(menuItemDTO);
......@@ -718,6 +707,24 @@ public class MenuApiServiceImpl implements MenuApiService {
}
@Override
public ServiceResponse<MenuDTO> getHasBuyAppByMenuCode(String menuCode, Integer enterpriseId) {
TabSysMenu record = menuService.getMenuByMenuCode(menuCode);
if (record == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "菜单code错误,无数据");
}
ServiceResponse<List<ApplicationTokenDTO>> appResult = appTokenApiService
.listApplicationByeId(Long.valueOf(enterpriseId));
if (appResult.isSuccess()) {
List<ApplicationTokenDTO> appList = appResult.getResult();
boolean existApp = appList.stream().anyMatch(e -> e.getApplicationId().toString().equals(record.getProject()));
if (existApp) {
return ServiceResponse.success(EntityUtil.changeEntityNew(MenuDTO.class, record));
}
}
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "菜单code错误,无数据");
}
@Override
public ServiceResponse<List<MenuDTO>> test(String menuCode) {
TabSysMenu tabSysMenu = menuService.getMenuByMenuCode(menuCode);
List<TabSysMenu> devMenuList = menuService.listMenuTempForGic(menuCode);
......@@ -778,7 +785,7 @@ public class MenuApiServiceImpl implements MenuApiService {
MenuItemDTO menuItemDTO = new MenuItemDTO();
menuItemDTO.setItemId(tempItem.getMenuId());
menuItemDTO.setMenuId(proMenu.getMenuId());
menuItemDTO.setStatus(1);
menuItemDTO.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
menuItemDTO.setCreateTime(now);
menuItemDTO.setUpdateTime(now);
itemDTOList.add(menuItemDTO);
......@@ -795,6 +802,91 @@ public class MenuApiServiceImpl implements MenuApiService {
}
@Override
public ServiceResponse<Void> switchGicMenuToApp(String gicMenuCode, String appMenuCode) {
TabSysMenu gicMenu = menuService.getMenuByMenuCode(gicMenuCode);
boolean isNotGicMenu = gicMenu == null || gicMenu.getLevel() != 1 || !gicMenu.getProject().equals(MenuProjectConstants.DEFAULT_PROJECT)
|| gicMenu.getPlatformType() != MenuPlatformTypeEnum.GIC.getCode();
if (isNotGicMenu) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "不存在或者不是GIC对应的code");
}
TabSysMenu appMenu = menuService.getMenuByMenuCode(appMenuCode);
boolean isNotAppMenu = appMenu == null || appMenu.getLevel() != 1 || appMenu.getProject().equals(MenuProjectConstants.DEFAULT_PROJECT)
|| gicMenu.getPlatformType() != MenuPlatformTypeEnum.GIC.getCode();
if (isNotAppMenu) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "不存在或者不是应用对应的code");
}
String applicationId = appMenu.getProject();
Integer parentId = appMenu.getMenuId();
String parentCode = appMenu.getMenuCode();
String menuVersion = appMenu.getMenuVersion();
String menuVersionName = appMenu.getMenuVersionName();
//第二层级需要修改的
//1:修改project
//2:修改parent_id,parent_code
//3:menu_version menu_version_name
List<TabSysMenu> list = menuService.listByParentMenuIdList(Arrays.asList(gicMenu.getMenuId()));
if (CollectionUtils.isNotEmpty(list)) {
List<Integer> menuIdList = list.stream().filter(e -> e != null).map(e -> e.getMenuId()).collect(Collectors.toList());
menuService.updateMenuTmp(menuIdList, applicationId, parentId, parentCode, menuVersion, menuVersionName);
//下面层级需要修改的
//1:修改project
//2:menu_version menu_version_name
List<TabSysMenu> childList = menuService.listMenuForGicContainChild(menuIdList);
if (CollectionUtils.isNotEmpty(childList)) {
List<Integer> childMenuIdList = childList.stream().filter(e -> e != null).map(e -> e.getMenuId()).collect(Collectors.toList());
menuService.updateMenuTmp(childMenuIdList, applicationId, null, null, menuVersion, menuVersionName);
}
}
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> switchAppMenuToGic(String gicMenuCode, String appMenuCode) {
TabSysMenu appMenu = menuService.getMenuByMenuCode(appMenuCode);
boolean isNotAppMenu = appMenu == null || appMenu.getLevel() != 1 || appMenu.getProject().equals(MenuProjectConstants.DEFAULT_PROJECT)
|| appMenu.getPlatformType() != MenuPlatformTypeEnum.GIC.getCode();
if (isNotAppMenu) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "不存在或者不是应用对应的code");
}
TabSysMenu gicMenu = menuService.getMenuByMenuCode(gicMenuCode);
boolean isNotGicMenu = gicMenu == null || gicMenu.getLevel() != 1 || !gicMenu.getProject().equals(MenuProjectConstants.DEFAULT_PROJECT)
|| gicMenu.getPlatformType() != MenuPlatformTypeEnum.GIC.getCode();
if (isNotGicMenu) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "不存在或者不是gic对应的code");
}
Integer parentId = gicMenu.getMenuId();
String parentCode = gicMenu.getMenuCode();
String menuVersion = gicMenu.getMenuVersion();
String menuVersionName = gicMenu.getMenuVersionName();
//第二层级需要修改的数据
//1:修改project 为gic
//2:修改parent_id, parent_code
//3:menu_version,menu_version_name
List<TabSysMenu> list = menuService.listByParentMenuIdList(Arrays.asList(appMenu.getMenuId()));
if (CollectionUtils.isNotEmpty(list)) {
List<Integer> menuIdList = list.stream().filter(e -> e != null).map(e -> e.getMenuId()).collect(Collectors.toList());
menuService.updateMenuTmp(menuIdList, MenuProjectConstants.DEFAULT_PROJECT, parentId, parentCode, menuVersion, menuVersionName);
//下面层级需要修改的
//1:修改project
//2:menu_version menu_version_name
List<TabSysMenu> childList = menuService.listMenuForGicContainChild(menuIdList);
if (CollectionUtils.isNotEmpty(childList)) {
List<Integer> childMenuIdList = childList.stream().filter(e -> e != null).map(e -> e.getMenuId()).collect(Collectors.toList());
menuService.updateMenuTmp(childMenuIdList, MenuProjectConstants.DEFAULT_PROJECT, null, null, menuVersion, menuVersionName);
}
}
return ServiceResponse.success();
}
@Override
public ServiceResponse<List<MenuDTO>> filterOperationUserDepartAuth(List<MenuDTO> resultList, UserDTO tabSysUser) {
List<TabSysMenu> list = filterOperationUserDepartAuth(EntityUtil.changeEntityListNew(TabSysMenu.class, resultList),
EntityUtil.changeEntityNew(TabSysUser.class, tabSysUser));
......@@ -836,7 +928,7 @@ public class MenuApiServiceImpl implements MenuApiService {
Date now = new Date();
menuDTO.setMenuAuthDepartList(
list.stream().map(e -> e.setMenuCode(menuDTO.getMenuCode())
.setStatus(1)
.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS)
.setCreateTime(now)
.setUpdateTime(now)).collect(Collectors.toList()));
}
......@@ -948,7 +1040,7 @@ public class MenuApiServiceImpl implements MenuApiService {
*/
private void saveAppMenu() {
ServiceResponse<List<ApplicationDTO>> appListResponse = applicationApiService.listApplicationAndServeProp();
Map<String, TabSysMenu> appMenu = getFirstLevelAppMenu();
Map<String, Integer> appMenu = getFirstLevelAppMenu();
if (appListResponse.isSuccess()) {
List<ApplicationDTO> appList = appListResponse.getResult();
//删除已经不存在的应用
......@@ -960,6 +1052,8 @@ public class MenuApiServiceImpl implements MenuApiService {
//删除不在projectList中的应用菜单:逻辑删除
menuService.deleteNotInApp(projectList);
for (ApplicationDTO app : appList) {
//gic应用
boolean isGicApp = MenuPlatformTypeEnum.GIC.getCode().equals(app.getAppType());
if (appMenu.containsKey(app.getApplicationId().toString())) {
//如果已存在,则更新版本信息
MenuDTO menuDTO = new MenuDTO();
......@@ -967,16 +1061,29 @@ public class MenuApiServiceImpl implements MenuApiService {
menuDTO.setProject(app.getApplicationId().toString());
setMenuVersion(app.getPropDTOList(), app.getServeExpanList(), menuDTO);
// setMenuAuthType(menuDTO);
menuDTO.setMenuId(appMenu.get(app.getApplicationId().toString()).getMenuId());
menuDTO.setMenuId(appMenu.get(app.getApplicationId().toString()));
menuService.updatePage(menuDTO);
//
if (!isGicApp) {
menuDTO.setMenuId(null);
menuService.updatePageForHaobanApplet(menuDTO);
}
} else {
MenuDTO menuDTO = new MenuDTO();
menuDTO.setMenuName(app.getName());
menuDTO.setProject(app.getApplicationId().toString());
menuDTO.setMenuCode("noParentCode-" + System.currentTimeMillis());
setMenuVersion(app.getPropDTOList(), app.getServeExpanList(), menuDTO);
// setMenuAuthType(menuDTO);
setNormalFieldValue(menuDTO);
menuDTO.setPlatformType(isGicApp ? MenuPlatformTypeEnum.GIC.getCode() : MenuPlatformTypeEnum.HAOBAN_APP.getCode());
menuService.savePage(menuDTO);
//好办小程序应用生成一份和好办应用同样的数据
if (!isGicApp) {
menuDTO.setPlatformType(MenuPlatformTypeEnum.HAOBAN_APPLET_APP.getCode());
menuDTO.setMenuCode(MenuPlatformTypeEnum.HAOBAN_APPLET_APP.getCode() + "noParentCode-" + System.currentTimeMillis());
menuService.savePage(menuDTO);
}
}
}
}
......@@ -1024,18 +1131,26 @@ public class MenuApiServiceImpl implements MenuApiService {
}
/**
* 获取应用第一级菜单(应用列表)
* 获取应用第一级菜单(应用列表)(gic和好办应用)
* @return
*/
private Map<String, TabSysMenu> getFirstLevelAppMenu() {
private Map<String, Integer> getFirstLevelAppMenu() {
MenuListQO params = new MenuListQO();
params.setIsGIC(MenuProjectConstants.APP_PROJECT_CODE);
params.setLevel(MenuLevelConstants.FIRST_LEVEL);
List<TabSysMenu> menuList = menuService.listMenu(params);
Map<String, TabSysMenu> map = new HashMap<>(16);
if (menuList != null) {
for (TabSysMenu menu : menuList) {
map.put(menu.getProject(), menu);
params.setPlatformType(MenuPlatformTypeEnum.GIC.getCode());
List<TabSysMenu> menuListOfGic = menuService.listMenu(params);
Map<String, Integer> map = new HashMap<>(16);
if (menuListOfGic != null) {
for (TabSysMenu menu : menuListOfGic) {
map.put(menu.getProject(), menu.getMenuId());
}
}
params.setPlatformType(MenuPlatformTypeEnum.HAOBAN_APP.getCode());
List<TabSysMenu> menuListOfHaoBanApp = menuService.listMenu(params);
if (menuListOfHaoBanApp != null) {
for (TabSysMenu menu : menuListOfHaoBanApp) {
map.put(menu.getProject(), menu.getMenuId());
}
}
return map;
......@@ -1272,16 +1387,7 @@ public class MenuApiServiceImpl implements MenuApiService {
}
}
Map<String, Object> resourcePage = getBusinessFrontRes(params.getEnterpriseId());
List<TabSysMenu> tempList = new ArrayList<>();
for (TabSysMenu menu : resultList) {
if (resourcePage.containsKey(menu.getMenuCode())) {
//如果包含了,则过滤掉
continue;
}
tempList.add(menu);
}
List<TabSysMenu> tempList = filterResource(resultList, params.getEnterpriseId());
if (isNeedTree) {
return ServiceResponse.success(this.treeMenu(tempList, 1, 0));
......@@ -1298,31 +1404,8 @@ public class MenuApiServiceImpl implements MenuApiService {
*/
private List<TabSysMenu> filterOperationUserDepartAuth(List<TabSysMenu> resultList, TabSysUser tabSysUser) {
if (tabSysUser != null && tabSysUser.getLoginType().intValue() != 0) {
//运营人员的部门职位;根据手机号查询运维人员的部门职位信息
GicUserDTO gicUserDTO = gicUserService.getUserByMobile(tabSysUser.getPhoneNumber());
LOGGER.info("运维人员的部门职位数据:{}", JSON.toJSONString(gicUserDTO));
//如果是运营人员
Set<String> departPosition = new HashSet<>(2);
String departmentCode = gicUserDTO.getDepartmentCode();
if (StringUtils.isNotBlank(departmentCode)) {
if (StringUtils.isBlank(gicUserDTO.getPositionCode())) {
//如果职位code是空,则取下面全部的职位code
List<GicDepartmentDTO> gicDepartmentDTOList = gicDepartmentService.listAllGicDepartment();
if (CollectionUtils.isNotEmpty(gicDepartmentDTOList)) {
Map<String, List<GicPositionDTO>> departMap = gicDepartmentDTOList
.stream()
.collect(Collectors.toMap(e -> e.getDepartmentCode(), e -> e.getPositionList()));
List<GicPositionDTO> positionList = departMap.get(departmentCode);
if (CollectionUtils.isNotEmpty(positionList)) {
positionList.forEach(e -> {
departPosition.add(departmentCode + "-" + e.getPositionCode());
});
}
}
} else {
departPosition.add(departmentCode + "-" + gicUserDTO.getPositionCode());
}
}
Set<String> departPosition = getLoginOperationDepartPosition(tabSysUser.getPhoneNumber());
//过滤运营人员的部门职位权限
Map<String, List<TabSysMenuAuthDepart>> departMap = getAuthDepartMap(null);
return resultList.stream().filter(e -> {
......@@ -1352,6 +1435,40 @@ public class MenuApiServiceImpl implements MenuApiService {
}
/**
* 获取运维人员的部门职位数据
* @param phoneNumber
* @return
*/
private Set<String> getLoginOperationDepartPosition(String phoneNumber) {
//如果是运营人员
Set<String> departPosition = new HashSet<>(16);
//运营人员的部门职位;根据手机号查询运维人员的部门职位信息
GicUserDTO gicUserDTO = gicUserService.getUserByMobile(phoneNumber);
LOGGER.info("运维人员的部门职位数据:{}", JSON.toJSONString(gicUserDTO));
String departmentCode = gicUserDTO.getDepartmentCode();
if (StringUtils.isNotBlank(departmentCode)) {
if (StringUtils.isBlank(gicUserDTO.getPositionCode())) {
//如果职位code是空,则取下面全部的职位code
List<GicDepartmentDTO> gicDepartmentDTOList = gicDepartmentService.listAllGicDepartment();
if (CollectionUtils.isNotEmpty(gicDepartmentDTOList)) {
Map<String, List<GicPositionDTO>> departMap = gicDepartmentDTOList
.stream()
.collect(Collectors.toMap(e -> e.getDepartmentCode(), e -> e.getPositionList()));
List<GicPositionDTO> positionList = departMap.get(departmentCode);
if (CollectionUtils.isNotEmpty(positionList)) {
positionList.forEach(e -> {
departPosition.add(departmentCode + DELIMITER + e.getPositionCode());
});
}
}
} else {
departPosition.add(departmentCode + DELIMITER + gicUserDTO.getPositionCode());
}
}
return departPosition;
}
/**
* 查询出所有的部门职位,用于过滤运营人员权限
* @param menuCodeList
* @return
......@@ -1370,16 +1487,7 @@ public class MenuApiServiceImpl implements MenuApiService {
private ServiceResponse<List<MenuDTO>> getAppMenuPage(Integer enterpriseId, List<Integer> menuIdList, String appId) {
//返回结果集定义声明
List<TabSysMenu> resultList = menuService.selectByIdsAndOrderBy(menuIdList, " order by sort");
Map<String, Object> resourcePage = getBusinessFrontRes(enterpriseId);
List<TabSysMenu> tempList = new ArrayList<>();
for (TabSysMenu menu : resultList) {
if (resourcePage.containsKey(menu.getMenuCode())) {
//如果包含了,则过滤掉
continue;
}
tempList.add(menu);
}
List<TabSysMenu> tempList = filterResource(resultList, enterpriseId);
return ServiceResponse.success(this.treeMenu(tempList, 1, 0));
}
......@@ -1388,8 +1496,10 @@ public class MenuApiServiceImpl implements MenuApiService {
* @param enterpriseId
* @return
*/
private Map<String, Object> getBusinessFrontRes(Integer enterpriseId) {
Map<String, Object> resourcePage = new HashMap<>(16);
private Set<String> getBusinessFrontRes(Integer enterpriseId) {
Set<String> resourcePage = new HashSet<>(16);
//todo 是否商品资源变成应用
//过滤商品资源页面
ServiceResponse<List<EnterpriseResourceRelDTO>> resourceResult = enterpriseApiService.getBusinessFrontRes(enterpriseId);
if (resourceResult.isSuccess()) {
......@@ -1408,7 +1518,7 @@ public class MenuApiServiceImpl implements MenuApiService {
List<TabSysBusinessFrontRes> frontResourceList = businessFrontResService.listByCode(resourceCodeList, 1);
if (CollectionUtils.isNotEmpty(frontResourceList)) {
for (TabSysBusinessFrontRes resource : frontResourceList) {
resourcePage.put(resource.getPageName(), 1);
resourcePage.add(resource.getPageName());
}
}
}
......@@ -1418,6 +1528,26 @@ public class MenuApiServiceImpl implements MenuApiService {
}
/**
* 获取前置资源
* @param resultList
* @param enterpriseId
* @return
*/
private List<TabSysMenu> filterResource(List<TabSysMenu> resultList, Integer enterpriseId) {
List<TabSysMenu> tempList = new ArrayList<>();
Set<String> resourcePage = getBusinessFrontRes(enterpriseId);
for (TabSysMenu menu : resultList) {
if (resourcePage.contains(menu.getMenuCode())) {
//如果包含了,则过滤掉
continue;
}
tempList.add(menu);
}
return tempList;
}
/**
* 获取用户没有权限的操作项
* @Title: getNoAuthOperationItem

* @Description:
......@@ -1428,45 +1558,34 @@ public class MenuApiServiceImpl implements MenuApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.MenuDTO>>


 */
private ServiceResponse<List<MenuDTO>> getNoAuthOperationItem(Integer userId, int projectCode, String versionCode) {
//没有基础服务数据,则返回空
if (projectCode != MenuProjectConstants.APP_PROJECT_CODE && StringUtils.isBlank(versionCode)) {
List<MenuDTO> noAuthList = new ArrayList<>(1);
MenuDTO temp = new MenuDTO();
temp.setMenuId(-1);
noAuthList.add(temp);
return ServiceResponse.success(noAuthList);
}
TabSysUser tabSysUser = userService.getUserById(userId);
if (tabSysUser == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "用户不存在");
}
boolean isSuperAdmin = tabSysUser.getSuperAdmin().intValue() == 1;
//添加逻辑:如果是超级管理员,过滤部门权限,给出没有权限的操作项
if (tabSysUser.getSuperAdmin().intValue() == 1) {
if (isSuperAdmin) {
//
MenuListQO params = new MenuListQO();
//操作项
params.setMenuType(2);
params.setMenuType(MenuTypeEnum.OPERATION.getCode());
List<TabSysMenu> allOper = menuService.listMenu(params);
if (tabSysUser != null && tabSysUser.getLoginType().intValue() != 0) {
//运营人员的部门职位;根据手机号查询运维人员的部门职位信息
GicUserDTO gicUserDTO = gicUserService.getUserByMobile(tabSysUser.getPhoneNumber());
LOGGER.info("运维人员的部门职位数据:{}", JSON.toJSONString(gicUserDTO));
//如果是运营人员
Set<String> departPosition = new HashSet<>(2);
String departmentCode = gicUserDTO.getDepartmentCode();
if (StringUtils.isNotBlank(departmentCode)) {
if (StringUtils.isBlank(gicUserDTO.getPositionCode())) {
//如果职位code是空,则取下面全部的职位code
List<GicDepartmentDTO> gicDepartmentDTOList = gicDepartmentService.listAllGicDepartment();
if (CollectionUtils.isNotEmpty(gicDepartmentDTOList)) {
Map<String, List<GicPositionDTO>> departMap = gicDepartmentDTOList
.stream()
.collect(Collectors.toMap(e -> e.getDepartmentCode(), e -> e.getPositionList()));
List<GicPositionDTO> positionList = departMap.get(departmentCode);
if (CollectionUtils.isNotEmpty(positionList)) {
positionList.forEach(e -> {
departPosition.add(departmentCode + DELIMITER + e.getPositionCode());
});
}
}
} else {
departPosition.add(departmentCode + DELIMITER + gicUserDTO.getPositionCode());
}
}
boolean isOperationUser = tabSysUser.getLoginType().intValue() != 0;
if (isOperationUser) {
//运营人员的部门职位
Set<String> departPosition = getLoginOperationDepartPosition(tabSysUser.getPhoneNumber());
//过滤运营人员的部门职位权限
Map<String, List<TabSysMenuAuthDepart>> departMap = getAuthDepartMap(null);
return ServiceResponse.success(EntityUtil.changeEntityListNew(MenuDTO.class, allOper.stream().filter(e -> {
......@@ -1485,8 +1604,8 @@ public class MenuApiServiceImpl implements MenuApiService {
}
return true;
}).collect(Collectors.toList())));
} else if (tabSysUser != null && tabSysUser.getSuperAdmin().intValue() == 1) {
//超级管理员
} else {
//gic超级管理员
return ServiceResponse.success(EntityUtil.changeEntityListNew(MenuDTO.class,allOper.stream().filter(e -> e.getAuthType().intValue() == 3).collect(Collectors.toList())));
}
}
......
......@@ -2,6 +2,7 @@ package com.gic.auth.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dto.MenuRoleDTO;
import com.gic.auth.dto.RoleDTO;
import com.gic.auth.dto.RoleListDTO;
......@@ -51,7 +52,7 @@ public class RoleApiServiceImpl implements RoleApiService{
}
dto.setUpdateTime(new Date());
dto.setCreateTime(new Date());
dto.setStatus(1);
dto.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
//验证名称不能重复
if (roleService.isRepeatRoleName(dto.getEnterpriseId(), null, dto.getRoleName())) {
......@@ -164,7 +165,7 @@ public class RoleApiServiceImpl implements RoleApiService{
menuRoleDTO.setMenuId(Integer.parseInt(menuId));
menuRoleDTO.setCreateTime(now);
menuRoleDTO.setUpdateTime(now);
menuRoleDTO.setStatus(1);
menuRoleDTO.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
list.add(menuRoleDTO);
}
menuRoleService.insertForeach(list);
......
......@@ -3,6 +3,7 @@ package com.gic.auth.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.constant.AuthorizationStatusEnum;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.constant.ResourceTypeEnum;
import com.gic.auth.dto.UnionEnterpriseDTO;
import com.gic.auth.dto.UnionEnterpriseResourceDTO;
......@@ -45,7 +46,7 @@ public class UnionEnterpriseApiServiceImpl implements UnionEnterpriseApiService
int i = 0;
if(enterpriseDTO.getUnionId() == null) {
unionEnterprise.setCreateTime(new Date());
unionEnterprise.setStatus(Constants.NORMAL_STATUS);
unionEnterprise.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
unionEnterprise.setAuthorizationStatus(AuthorizationStatusEnum.NORMAL.getCode());
unionEnterprise.setUpdateTime(new Date());
i = this.unionEnterpriseService.saveUnionEnterprise(unionEnterprise);
......
......@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.constant.AccountGroupMemberTypeEnum;
import com.gic.auth.constant.AccountPositionEnum;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.constant.LoginUserTypeEnum;
import com.gic.auth.dto.*;
import com.gic.auth.entity.*;
......@@ -356,6 +357,8 @@ public class UserApiServiceImpl implements UserApiService {
userResourceService.deleteByUserId(userId);
//删除账号分组关联
accountGroupRelService.deleteByUserId(userId, AccountGroupMemberTypeEnum.ADMIN.getCode());
//
auditedGroupUserRelService.deleteByUserId(userId);
userService.delete(userId);
return ServiceResponse.success(tabUser.getUserName());
}
......@@ -629,7 +632,7 @@ public class UserApiServiceImpl implements UserApiService {
accountGroupRelDTO.setCreateTime(now);
accountGroupRelDTO.setUpdateTime(now);
accountGroupRelDTO.setEnterpriseId(enterpriseId);
accountGroupRelDTO.setStatus(1);
accountGroupRelDTO.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
accountGroupRelDTOList.add(accountGroupRelDTO);
}
accountGroupRelService.insertFetch(accountGroupRelDTOList);
......
package com.gic.auth.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dto.UserResourceDTO;
import com.gic.auth.entity.TabSysUser;
import com.gic.auth.service.UserResourceApiService;
......@@ -40,7 +41,7 @@ public class UserResourceApiServiceImpl implements UserResourceApiService{
dto.setCreateTime(new Date());
dto.setUpdateTime(new Date());
dto.setStatus(1);
dto.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
userResourceService.save(dto);
return ServiceResponse.success();
......
package com.gic.auth.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.constant.DeleteFlagConstants;
import com.gic.auth.dto.UserRoleDTO;
import com.gic.auth.entity.TabSysUser;
import com.gic.auth.service.UserRoleApiService;
......@@ -38,7 +39,7 @@ public class UserRoleApiServiceImpl implements UserRoleApiService{
dto.setCreateTime(new Date());
dto.setUpdateTime(new Date());
dto.setStatus(1);
dto.setDeleteFlag(DeleteFlagConstants.NORMAL_STATUS);
userRoleService.save(dto);
return ServiceResponse.success();
......
......@@ -6,12 +6,12 @@
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="audited_group_name" jdbcType="VARCHAR" property="auditedGroupName" />
<result column="all_check" jdbcType="INTEGER" property="allCheck" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
audited_group_id, enterprise_id, audited_group_name, all_check, status, create_time,
audited_group_id, enterprise_id, audited_group_name, all_check, delete_flag, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -20,16 +20,13 @@
from tab_audited_group
where audited_group_id = #{auditedGroupId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_audited_group
where audited_group_id = #{auditedGroupId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabAuditedGroup">
insert into tab_audited_group (audited_group_id, enterprise_id, audited_group_name,
all_check, status, create_time,
all_check, delete_flag, create_time,
update_time)
values (#{auditedGroupId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{auditedGroupName,jdbcType=VARCHAR},
#{allCheck,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{allCheck,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabAuditedGroup">
......@@ -50,8 +47,8 @@
<if test="allCheck != null">
all_check,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -73,8 +70,8 @@
<if test="allCheck != null">
#{allCheck,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -96,8 +93,8 @@
<if test="allCheck != null">
all_check = #{allCheck,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -113,7 +110,7 @@
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
audited_group_name = #{auditedGroupName,jdbcType=VARCHAR},
all_check = #{allCheck,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where audited_group_id = #{auditedGroupId,jdbcType=INTEGER}
......@@ -122,7 +119,7 @@
select
1
from tab_audited_group
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
......@@ -135,14 +132,14 @@
</select>
<update id="delAuditedGroup">
update tab_audited_group
set status = 0
set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where audited_group_id = #{auditedGroupId}
</update>
<select id="listAuditedGroup" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_audited_group
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
......@@ -152,7 +149,7 @@
</select>
<select id="countByAuditedGroupIds" resultType="java.lang.Integer">
select count(1)
from tab_audited_group where status = 1
from tab_audited_group where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="null != ids">
and audited_group_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
......
......@@ -6,12 +6,12 @@
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="audited_group_id" jdbcType="INTEGER" property="auditedGroupId" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
audited_group_user_rel_id, enterprise_id, audited_group_id, user_id, status, create_time,
audited_group_user_rel_id, enterprise_id, audited_group_id, user_id, delete_flag, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -20,16 +20,13 @@
from tab_audited_group_user_rel
where audited_group_user_rel_id = #{auditedGroupUserRelId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_audited_group_user_rel
where audited_group_user_rel_id = #{auditedGroupUserRelId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabAuditedGroupUserRel">
insert into tab_audited_group_user_rel (audited_group_user_rel_id, enterprise_id,
audited_group_id, user_id, status,
audited_group_id, user_id, delete_flag,
create_time, update_time)
values (#{auditedGroupUserRelId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER},
#{auditedGroupId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{auditedGroupId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabAuditedGroupUserRel">
......@@ -47,8 +44,8 @@
<if test="userId != null">
user_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -70,8 +67,8 @@
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -93,8 +90,8 @@
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -110,26 +107,26 @@
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
audited_group_id = #{auditedGroupId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where audited_group_user_rel_id = #{auditedGroupUserRelId,jdbcType=INTEGER}
</update>
<update id="delByAuditedGroupId">
update tab_audited_group_user_rel set status = 0
update tab_audited_group_user_rel set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where audited_group_id = #{auditedGroupId}
</update>
<insert id="insertSelectiveByNotExist">
INSERT INTO tab_audited_group_user_rel (
audited_group_id,
user_id,
status,
delete_flag,
create_time,
enterprise_id
) SELECT
#{auditedGroupId},
#{userId},
#{status},
#{deleteFlag},
#{createTime},
#{enterpriseId}
FROM
......@@ -147,7 +144,7 @@
)
</insert>
<update id="updateStatusByUserIds">
update tab_audited_group_user_rel set status = 1
update tab_audited_group_user_rel set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
where enterprise_id = #{enterpriseId}
and audited_group_id = #{auditedGroupId}
and user_id in
......@@ -160,7 +157,7 @@
audited_group_id auditedGroupId, count(1) userCount
from
tab_audited_group_user_rel
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="null != ids">
and audited_group_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
......@@ -183,7 +180,7 @@
#{item}
</foreach>
</if>
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</where>
</select>
<select id="listAuditedGroupByUserId" resultType="java.lang.Integer">
......@@ -197,7 +194,10 @@
<if test="userId != null ">
and user_id = #{userId}
</if>
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</where>
</select>
<update id="deleteByUserId">
update tab_audited_group_user_rel set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS} where user_id = #{userId};
</update>
</mapper>
\ No newline at end of file
......@@ -6,12 +6,12 @@
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="auditor_id" jdbcType="INTEGER" property="auditorId" />
<result column="audited_group_id" jdbcType="INTEGER" property="auditedGroupId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
auditor_audited_group_rel_id, enterprise_id, auditor_id, audited_group_id, status,
auditor_audited_group_rel_id, enterprise_id, auditor_id, audited_group_id, delete_flag,
create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -20,16 +20,13 @@
from tab_auditor_audited_group_rel
where auditor_audited_group_rel_id = #{auditorAuditedGroupRelId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_auditor_audited_group_rel
where auditor_audited_group_rel_id = #{auditorAuditedGroupRelId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabAuditorAuditedGroupRel">
insert into tab_auditor_audited_group_rel (auditor_audited_group_rel_id, enterprise_id,
auditor_id, audited_group_id, status,
auditor_id, audited_group_id, delete_flag,
create_time, update_time)
values (#{auditorAuditedGroupRelId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER},
#{auditorId,jdbcType=INTEGER}, #{auditedGroupId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{auditorId,jdbcType=INTEGER}, #{auditedGroupId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabAuditorAuditedGroupRel">
......@@ -47,8 +44,8 @@
<if test="auditedGroupId != null">
audited_group_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -70,8 +67,8 @@
<if test="auditedGroupId != null">
#{auditedGroupId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -93,8 +90,8 @@
<if test="auditedGroupId != null">
audited_group_id = #{auditedGroupId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -110,35 +107,35 @@
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
auditor_id = #{auditorId,jdbcType=INTEGER},
audited_group_id = #{auditedGroupId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where auditor_audited_group_rel_id = #{auditorAuditedGroupRelId,jdbcType=INTEGER}
</update>
<update id="delRel">
update tab_auditor_audited_group_rel
set status = 0
set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where audited_group_id = #{auditedGroupId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</update>
<update id="delByAuditorId">
update tab_auditor_audited_group_rel
set status = 0
set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where auditor_id = #{auditorId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</update>
<insert id="insertSelectiveByNotExist">
INSERT INTO tab_auditor_audited_group_rel (
enterprise_id,
auditor_id,
audited_group_id,
status,
delete_flag,
create_time
) SELECT
#{enterpriseId},
#{auditorId},
#{auditedGroupId},
#{status},
#{deleteFlag},
#{createTime}
FROM
DUAL
......@@ -156,7 +153,7 @@
</insert>
<update id="updateStatusByAuditedGroupIds">
update tab_auditor_audited_group_rel
set status = 1
set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
where auditor_id = #{auditorId}
and enterprise_id = #{enterpriseId}
<if test="null != ids">
......@@ -170,7 +167,7 @@
select
<include refid="Base_Column_List" />
from tab_auditor_audited_group_rel
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="auditorId != null ">
and auditor_id = #{auditorId}
</if>
......@@ -189,7 +186,7 @@
auditor_id auditorId, count(1) auditedGroupCount
from
tab_auditor_audited_group_rel
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="null != ids">
and auditor_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
......@@ -202,7 +199,7 @@
select
auditor_id
from tab_auditor_audited_group_rel
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
......
......@@ -9,12 +9,12 @@
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="openid" jdbcType="VARCHAR" property="openid" />
<result column="is_use" jdbcType="INTEGER" property="isUse" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
auditor_id, enterprise_id, auditor_name, phone, user_id, openid, is_use, status,
auditor_id, enterprise_id, auditor_name, phone, user_id, openid, is_use, delete_flag,
create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -23,18 +23,15 @@
from tab_auditor
where auditor_id = #{auditorId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_auditor
where auditor_id = #{auditorId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabAuditor">
insert into tab_auditor (auditor_id, enterprise_id, auditor_name,
phone, user_id, openid,
is_use, status, create_time,
is_use, delete_flag, create_time,
update_time)
values (#{auditorId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{auditorName,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, #{openid,jdbcType=VARCHAR},
#{isUse,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{isUse,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabAuditor">
......@@ -64,8 +61,8 @@
<if test="isUse != null">
is_use,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -96,8 +93,8 @@
<if test="isUse != null">
#{isUse,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -128,8 +125,8 @@
<if test="isUse != null">
is_use = #{isUse,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -148,7 +145,7 @@
user_id = #{userId,jdbcType=INTEGER},
openid = #{openid,jdbcType=VARCHAR},
is_use = #{isUse,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where auditor_id = #{auditorId,jdbcType=INTEGER}
......@@ -157,7 +154,7 @@
select
<include refid="Base_Column_List" />
from tab_auditor
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="phone != null and phone != '' ">
and phone = #{phone}
</if>
......@@ -179,13 +176,13 @@
limit 1
</select>
<update id="delAuditor">
update tab_auditor set status = 0 where status = 1 and auditor_id = #{auditorId}
update tab_auditor set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS} where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS} and auditor_id = #{auditorId}
</update>
<select id="listAuditor" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_auditor
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="auditorName != null and auditorName != '' ">
and auditor_name like concat('%', #{auditorName}, '%')
</if>
......@@ -213,7 +210,7 @@
</if>
</where>
and is_use = 1
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
limit 1
</select>
</mapper>
\ No newline at end of file
......@@ -6,12 +6,12 @@
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="auditor_id" jdbcType="INTEGER" property="auditorId" />
<result column="project_item_id" jdbcType="INTEGER" property="projectItemId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
auditor_project_item_rel_id, enterprise_id, auditor_id, project_item_id, status,
auditor_project_item_rel_id, enterprise_id, auditor_id, project_item_id, delete_flag,
create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -20,16 +20,13 @@
from tab_auditor_project_item_rel
where auditor_project_item_rel_id = #{auditorProjectItemRelId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_auditor_project_item_rel
where auditor_project_item_rel_id = #{auditorProjectItemRelId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabAuditorProjectItemRel">
insert into tab_auditor_project_item_rel (auditor_project_item_rel_id, enterprise_id,
auditor_id, project_item_id, status,
auditor_id, project_item_id, delete_flag,
create_time, update_time)
values (#{auditorProjectItemRelId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER},
#{auditorId,jdbcType=INTEGER}, #{projectItemId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{auditorId,jdbcType=INTEGER}, #{projectItemId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabAuditorProjectItemRel">
......@@ -47,8 +44,8 @@
<if test="projectItemId != null">
project_item_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -70,8 +67,8 @@
<if test="projectItemId != null">
#{projectItemId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -93,8 +90,8 @@
<if test="projectItemId != null">
project_item_id = #{projectItemId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -110,21 +107,21 @@
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
auditor_id = #{auditorId,jdbcType=INTEGER},
project_item_id = #{projectItemId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where auditor_project_item_rel_id = #{auditorProjectItemRelId,jdbcType=INTEGER}
</update>
<update id="delByAuditorId">
update tab_auditor_project_item_rel
set status = 0
where status = 1
set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and auditor_id = #{auditorId}
</update>
<update id="delRelByProjectItemId">
update tab_auditor_project_item_rel
set status = 0
where status = 1
set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and project_item_id = #{projectItemId}
</update>
<insert id="insertSelectiveByNotExist">
......@@ -132,13 +129,13 @@
enterprise_id,
auditor_id,
project_item_id,
status,
delete_flag,
create_time
) SELECT
#{enterpriseId},
#{auditorId},
#{projectItemId},
#{status},
#{deleteFlag},
#{createTime}
FROM
DUAL
......@@ -156,7 +153,7 @@
</insert>
<update id="updateStatusByProjectItemIds">
update tab_auditor_project_item_rel
set status = 1
set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
where auditor_id = #{auditorId}
and enterprise_id = #{enterpriseId}
<if test="null != ids">
......@@ -170,7 +167,7 @@
select
<include refid="Base_Column_List" />
from tab_auditor_project_item_rel
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="auditorId != null ">
and auditor_id = #{auditorId}
</if>
......@@ -180,7 +177,7 @@
select
auditor_id auditorId, count(1) projectItemCount
from tab_auditor_project_item_rel
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="null != ids">
and auditor_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
......@@ -193,7 +190,7 @@
select
auditor_id
from tab_auditor_project_item_rel
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
......
......@@ -5,13 +5,13 @@
<id column="account_group_id" jdbcType="INTEGER" property="accountGroupId" />
<result column="account_group_name" jdbcType="VARCHAR" property="accountGroupName" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
account_group_id, account_group_name, enterprise_id, status, sort, create_time, update_time
account_group_id, account_group_name, enterprise_id, delete_flag, sort, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -19,16 +19,13 @@
from tab_sys_account_group
where account_group_id = #{accountGroupId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_account_group
where account_group_id = #{accountGroupId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysAccountGroup" useGeneratedKeys="true" keyProperty="accountGroupId">
insert into tab_sys_account_group (account_group_id, account_group_name,
enterprise_id, status, sort,
enterprise_id, delete_flag, sort,
create_time, update_time)
values (#{accountGroupId,jdbcType=INTEGER}, #{accountGroupName,jdbcType=VARCHAR},
#{enterpriseId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER},
#{enterpriseId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysAccountGroup">
......@@ -43,8 +40,8 @@
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="sort != null">
sort,
......@@ -66,8 +63,8 @@
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
......@@ -89,8 +86,8 @@
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
......@@ -108,7 +105,7 @@
update tab_sys_account_group
set account_group_name = #{accountGroupName,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
......@@ -119,14 +116,14 @@
SELECT ifnull(max(sort), 0)
from tab_sys_account_group
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and enterprise_id = #{enterpriseId}
</select>
<select id="countByAccountGroupName" resultType="int">
SELECT count(1)
from tab_sys_account_group
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and enterprise_id = #{enterpriseId}
<if test="accountGroupId != null">
and account_group_id &lt;&gt; #{accountGroupId}
......@@ -137,7 +134,7 @@
<select id="listAccountGroupByEnterpriseId" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
from tab_sys_account_group
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and enterprise_id = #{enterpriseId}
order by sort
</select>
......@@ -145,7 +142,7 @@
<select id="listByIdList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
from tab_sys_account_group
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="list != null and list.size() > 0">
and account_group_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
......
......@@ -6,13 +6,13 @@
<result column="account_group_id" jdbcType="INTEGER" property="accountGroupId" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
account_group_rel_id, account_group_id, user_id, enterprise_id, status, type, create_time,
account_group_rel_id, account_group_id, user_id, enterprise_id, delete_flag, type, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -21,17 +21,14 @@
from tab_sys_account_group_rel
where account_group_rel_id = #{accountGroupRelId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_account_group_rel
where account_group_rel_id = #{accountGroupRelId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysAccountGroupRel">
insert into tab_sys_account_group_rel (account_group_rel_id, account_group_id,
user_id, enterprise_id, status,
user_id, enterprise_id, delete_flag,
type, create_time, update_time
)
values (#{accountGroupRelId,jdbcType=INTEGER}, #{accountGroupId,jdbcType=INTEGER},
#{userId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{userId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
......@@ -50,8 +47,8 @@
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="type != null">
type,
......@@ -76,8 +73,8 @@
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
......@@ -102,8 +99,8 @@
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
......@@ -122,7 +119,7 @@
set account_group_id = #{accountGroupId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
type = #{type,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
......@@ -131,14 +128,14 @@
<update id="deleteByAccountGroupId">
update tab_sys_account_group_rel
set status = 0
where status = 1
set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and account_group_id = #{accountGroupId}
</update>
<insert id="insertForeach" parameterType="java.util.List">
insert into tab_sys_account_group_rel (account_group_rel_id, account_group_id,
user_id, enterprise_id, status,
user_id, enterprise_id, delete_flag,
type, create_time, update_time
)
VALUES
......@@ -148,7 +145,7 @@
#{item.accountGroupId},
#{item.userId},
#{item.enterpriseId},
#{item.status},
#{item.deleteFlag},
#{item.type},
#{item.createTime},
#{item.updateTime}
......@@ -158,16 +155,16 @@
<update id="deleteByUserId">
update tab_sys_account_group_rel
set status = 0
where status = 1
set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and user_id = #{userId}
and type = #{type}
</update>
<update id="deleteByUserIdList">
update tab_sys_account_group_rel
set status = 0
where status = 1
set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="userIdList != null and userIdList.size() > 0">
and user_id in
<foreach collection="userIdList" index="index" item="item" open="(" separator="," close=")">
......@@ -182,14 +179,14 @@
<include refid="Base_Column_List" />
from tab_sys_account_group_rel
where user_id = #{userId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and type = #{type}
</select>
<update id="deleteByAccountGroupIdAndUserId">
update tab_sys_account_group_rel
set status = 0
where status = 1
set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and user_id = #{userId}
and account_group_id = #{accountGroupId}
and type = #{type}
......@@ -203,14 +200,14 @@
<if test="type != null">
and type = #{type}
</if>
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
<select id="groupByAccountGroupId" resultType="com.gic.auth.dto.AccountGroupListDTO">
select account_group_id accountGroupId,
count(user_id) memberCount
from tab_sys_account_group_rel
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="list != null and list.size() > 0">
and account_group_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
......@@ -226,7 +223,7 @@
<include refid="Base_Column_List" />
from tab_sys_account_group_rel
where
status = 1
delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="list != null and list.size() > 0">
and account_group_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
......
......@@ -6,13 +6,13 @@
<result column="auth_code" jdbcType="VARCHAR" property="authCode" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="relation_id" jdbcType="INTEGER" property="relationId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="expiration_time" jdbcType="TIMESTAMP" property="expirationTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
auth_code_id, auth_code, enterprise_id, relation_id, status, create_time, expiration_time,
auth_code_id, auth_code, enterprise_id, relation_id, delete_flag, create_time, expiration_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -21,19 +21,16 @@
from tab_sys_auth_code
where auth_code_id = #{authCodeId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_auth_code
where auth_code_id = #{authCodeId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysAuthCode">
<selectKey keyProperty="authCodeId" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_sys_auth_code (auth_code_id, auth_code, enterprise_id,
relation_id, status, create_time,
relation_id, delete_flag, create_time,
expiration_time, update_time)
values (#{authCodeId,jdbcType=INTEGER}, #{authCode,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=INTEGER},
#{relationId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{relationId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{expirationTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysAuthCode" useGeneratedKeys="true" keyProperty="authCodeId">
......@@ -51,8 +48,8 @@
<if test="relationId != null">
relation_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -77,8 +74,8 @@
<if test="relationId != null">
#{relationId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -103,8 +100,8 @@
<if test="relationId != null">
relation_id = #{relationId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -123,7 +120,7 @@
set auth_code = #{authCode,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
relation_id = #{relationId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
expiration_time = #{expirationTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
......@@ -137,7 +134,7 @@
<if test="relationId != null">
and relation_id = #{relationId}
</if>
and status=1
and delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and expiration_time &gt;= now()
order by create_time desc
</select>
......
......@@ -9,13 +9,13 @@
<result column="page_name" jdbcType="VARCHAR" property="pageName" />
<result column="resource_detail" jdbcType="VARCHAR" property="resourceDetail" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
resource_id, resource_name, resource_code, resource_type, page_name, resource_detail,
enterprise_id, status, create_time, update_time
enterprise_id, delete_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -23,18 +23,15 @@
from tab_sys_business_front_res
where resource_id = #{resourceId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_business_front_res
where resource_id = #{resourceId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysBusinessFrontRes" useGeneratedKeys="true" keyProperty="resourceId">
insert into tab_sys_business_front_res (resource_id, resource_name, resource_code,
resource_type, page_name, resource_detail,
enterprise_id, status, create_time,
enterprise_id, delete_flag, create_time,
update_time)
values (#{resourceId,jdbcType=INTEGER}, #{resourceName,jdbcType=VARCHAR}, #{resourceCode,jdbcType=VARCHAR},
#{resourceType,jdbcType=INTEGER}, #{pageName,jdbcType=VARCHAR}, #{resourceDetail,jdbcType=VARCHAR},
#{enterpriseId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{enterpriseId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysBusinessFrontRes">
......@@ -61,8 +58,8 @@
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -93,8 +90,8 @@
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -125,8 +122,8 @@
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -145,7 +142,7 @@
page_name = #{pageName,jdbcType=VARCHAR},
resource_detail = #{resourceDetail,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where resource_id = #{resourceId,jdbcType=INTEGER}
......@@ -154,7 +151,7 @@
<select id="listByParam" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_business_front_res
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="search != null and search != ''">
and (resource_name like concat('%', #{search}, '%') or page_name like concat('%', #{search}, '%')
or resource_detail like concat('%', #{search}, '%'))
......@@ -167,7 +164,7 @@
<select id="listByCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_business_front_res
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and resource_type = #{resourceType}
and resource_code in
<foreach close=")" collection="codeList" index="index" item="item" open="(" separator=",">
......@@ -179,14 +176,14 @@
SELECT <include refid="Base_Column_List"></include>
from tab_sys_business_front_res
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
GROUP by resource_code
</select>
<select id="listByResourceCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_business_front_res
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and resource_code = #{resourceCode}
</select>
</mapper>
\ No newline at end of file
......@@ -12,13 +12,13 @@
<result column="creator" jdbcType="VARCHAR" property="creator" />
<result column="resource_ids" jdbcType="VARCHAR" property="resourceIds" />
<result column="sub_app_ids" jdbcType="VARCHAR" property="subAppIds" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
collaborator_id, collaborator_name, enterprise_id, collaboration_enterprise_id, phone,
app_id, app_name, creator, resource_ids, sub_app_ids, status, create_time, update_time
app_id, app_name, creator, resource_ids, sub_app_ids, delete_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -26,20 +26,17 @@
from tab_sys_collaborator
where collaborator_id = #{collaboratorId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_collaborator
where collaborator_id = #{collaboratorId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysCollaborator">
insert into tab_sys_collaborator (collaborator_id, collaborator_name,
enterprise_id, collaboration_enterprise_id,
phone, app_id, app_name,
creator, resource_ids, sub_app_ids, status,
creator, resource_ids, sub_app_ids, delete_flag,
create_time, update_time)
values (#{collaboratorId,jdbcType=INTEGER}, #{collaboratorName,jdbcType=VARCHAR},
#{enterpriseId,jdbcType=INTEGER}, #{collaborationEnterpriseId,jdbcType=INTEGER},
#{phone,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, #{appName,jdbcType=VARCHAR},
#{creator,jdbcType=VARCHAR}, #{resourceIds,jdbcType=VARCHAR}, #{subAppIds,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{creator,jdbcType=VARCHAR}, #{resourceIds,jdbcType=VARCHAR}, #{subAppIds,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysCollaborator" useGeneratedKeys="true" keyProperty="collaboratorId">
......@@ -75,8 +72,8 @@
<if test="subAppIds != null">
sub_app_ids,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -116,8 +113,8 @@
<if test="subAppIds != null">
#{subAppIds,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -157,8 +154,8 @@
<if test="subAppIds != null">
sub_app_ids = #{subAppIds,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -180,7 +177,7 @@
creator = #{creator,jdbcType=VARCHAR},
resource_ids = #{resourceIds,jdbcType=VARCHAR},
sub_app_ids = #{subAppIds,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where collaborator_id = #{collaboratorId,jdbcType=INTEGER}
......@@ -197,7 +194,7 @@
a.app_id appId,
a.app_name appName,
a.creator,
a.status,
a.delete_flag deleteFlag,
a.create_time createTime
from tab_sys_collaborator a
......@@ -209,8 +206,8 @@
<if test="appId != null and appId != '' ">
and a.app_id in (${appId})
</if>
<if test="status != null">
and a.status = #{status}
<if test="deleteFlag != null">
and a.delete_flag = #{deleteFlag}
</if>
<if test="collaboratorIdList != null and collaboratorIdList.size() > 0">
and a.collaborator_id in
......@@ -254,15 +251,15 @@
where collaboration_enterprise_id = #{enterpriseId}
and phone = #{phone}
and app_id = #{appId}
and status != 0
and delete_flag != ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
limit 1
</select>
<update id="deleteByPhoneAndAppId">
update tab_sys_collaborator set status = 0, update_time = now()
update tab_sys_collaborator set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}, update_time = now()
where collaboration_enterprise_id = #{enterpriseId}
and phone = #{phone}
and app_id = #{appId}
and status != 0
and delete_flag != ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
</update>
</mapper>
\ No newline at end of file
......@@ -5,12 +5,12 @@
<id column="collaborator_role_rel_id" jdbcType="INTEGER" property="collaboratorRoleRelId" />
<result column="collaborator_id" jdbcType="INTEGER" property="collaboratorId" />
<result column="menu_id" jdbcType="INTEGER" property="menuId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
collaborator_role_rel_id, collaborator_id, menu_id, status, create_time, update_time
collaborator_role_rel_id, collaborator_id, menu_id, delete_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -18,16 +18,13 @@
from tab_sys_collaborator_role_rel
where collaborator_role_rel_id = #{collaboratorRoleRelId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_collaborator_role_rel
where collaborator_role_rel_id = #{collaboratorRoleRelId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysCollaboratorRoleRel">
insert into tab_sys_collaborator_role_rel (collaborator_role_rel_id, collaborator_id,
menu_id, status, create_time,
menu_id, delete_flag, create_time,
update_time)
values (#{collaboratorRoleRelId,jdbcType=INTEGER}, #{collaboratorId,jdbcType=INTEGER},
#{menuId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{menuId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysCollaboratorRoleRel">
......@@ -42,8 +39,8 @@
<if test="menuId != null">
menu_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -62,8 +59,8 @@
<if test="menuId != null">
#{menuId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -82,8 +79,8 @@
<if test="menuId != null">
menu_id = #{menuId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -98,7 +95,7 @@
update tab_sys_collaborator_role_rel
set collaborator_id = #{collaboratorId,jdbcType=INTEGER},
menu_id = #{menuId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where collaborator_role_rel_id = #{collaboratorRoleRelId,jdbcType=INTEGER}
......@@ -106,7 +103,7 @@
<insert id="saveFetch" parameterType="java.util.List">
insert into tab_sys_collaborator_role_rel (collaborator_role_rel_id, collaborator_id,
menu_id, status, create_time,
menu_id, delete_flag, create_time,
update_time)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
......@@ -114,7 +111,7 @@
#{item.collaboratorRoleRelId},
#{item.collaboratorId},
#{item.menuId},
#{item.status},
#{item.deleteFlag},
#{item.createTime},
#{item.updateTime}
)
......@@ -122,9 +119,9 @@
</insert>
<update id="deleteByCollaboratorId">
update tab_sys_collaborator_role_rel set status = 0
update tab_sys_collaborator_role_rel set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and collaborator_id = #{collaboratorId}
</update>
......@@ -132,7 +129,7 @@
SELECT <include refid="Base_Column_List"></include>
from tab_sys_collaborator_role_rel
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and collaborator_id = #{collaboratorId}
</select>
</mapper>
\ No newline at end of file
......@@ -8,13 +8,13 @@
<result column="depart_name" jdbcType="VARCHAR" property="departName" />
<result column="position_code" jdbcType="VARCHAR" property="positionCode" />
<result column="position_name" jdbcType="VARCHAR" property="positionName" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
menu_depart_id, menu_code, depart_code, depart_name, position_code, position_name,
status, create_time, update_time
delete_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -22,18 +22,15 @@
from tab_sys_menu_auth_depart
where menu_depart_id = #{menuDepartId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_menu_auth_depart
where menu_depart_id = #{menuDepartId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysMenuAuthDepart">
insert into tab_sys_menu_auth_depart (menu_depart_id, menu_code, depart_code,
depart_name, position_code, position_name,
status, create_time, update_time
delete_flag, create_time, update_time
)
values (#{menuDepartId,jdbcType=INTEGER}, #{menuCode,jdbcType=VARCHAR}, #{departCode,jdbcType=VARCHAR},
#{departName,jdbcType=VARCHAR}, #{positionCode,jdbcType=VARCHAR}, #{positionName,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
#{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysMenuAuthDepart">
......@@ -57,8 +54,8 @@
<if test="positionName != null">
position_name,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -86,8 +83,8 @@
<if test="positionName != null">
#{positionName,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -115,8 +112,8 @@
<if test="positionName != null">
position_name = #{positionName,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -134,7 +131,7 @@
depart_name = #{departName,jdbcType=VARCHAR},
position_code = #{positionCode,jdbcType=VARCHAR},
position_name = #{positionName,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where menu_depart_id = #{menuDepartId,jdbcType=INTEGER}
......@@ -143,7 +140,7 @@
<insert id="saveFetch" parameterType="java.util.List">
insert into tab_sys_menu_auth_depart (menu_depart_id, menu_code, depart_code,
depart_name, position_code, position_name,
status, create_time, update_time
delete_flag, create_time, update_time
)
values
<foreach collection="list" item="item" index="index" separator=",">
......@@ -154,7 +151,7 @@
#{item.departName},
#{item.positionCode},
#{item.positionName},
#{item.status},
#{item.deleteFlag},
#{item.createTime},
#{item.updateTime}
)
......@@ -162,8 +159,8 @@
</insert>
<update id="deleteByMenuCode">
update tab_sys_menu_auth_depart set status = 0
where status = 1
update tab_sys_menu_auth_depart set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and menu_code = #{menuCode}
</update>
......@@ -173,7 +170,7 @@
from tab_sys_menu_auth_depart
where menu_code = #{menuCode}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
<select id="listAllAuthDepart" resultMap="BaseResultMap">
......@@ -181,7 +178,7 @@
from tab_sys_menu_auth_depart
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="list != null and list.size() > 0">
and menu_code in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
......
......@@ -5,12 +5,12 @@
<id column="menu_item_id" jdbcType="INTEGER" property="menuItemId" />
<result column="menu_id" jdbcType="INTEGER" property="menuId" />
<result column="item_id" jdbcType="INTEGER" property="itemId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
menu_item_id, menu_id, item_id, status, create_time, update_time
menu_item_id, menu_id, item_id, delete_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -18,16 +18,13 @@
from tab_sys_menu_item
where menu_item_id = #{menuItemId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_menu_item
where menu_item_id = #{menuItemId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysMenuItem">
insert into tab_sys_menu_item (menu_item_id, menu_id, item_id,
status, create_time, update_time
delete_flag, create_time, update_time
)
values (#{menuItemId,jdbcType=INTEGER}, #{menuId,jdbcType=INTEGER}, #{itemId,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
#{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysMenuItem">
......@@ -42,8 +39,8 @@
<if test="itemId != null">
item_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -62,8 +59,8 @@
<if test="itemId != null">
#{itemId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -82,8 +79,8 @@
<if test="itemId != null">
item_id = #{itemId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -98,7 +95,7 @@
update tab_sys_menu_item
set menu_id = #{menuId,jdbcType=INTEGER},
item_id = #{itemId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where menu_item_id = #{menuItemId,jdbcType=INTEGER}
......@@ -106,7 +103,7 @@
<insert id="insertForeach" parameterType="java.util.List">
insert into tab_sys_menu_item (menu_item_id, menu_id, item_id,
status, create_time, update_time
delete_flag, create_time, update_time
)
values
<foreach collection="list" item="item" index="index" separator=",">
......@@ -114,7 +111,7 @@
#{item.menuItemId},
#{item.menuId},
#{item.itemId},
#{item.status},
#{item.deleteFlag},
#{item.createTime},
#{item.updateTime}
)
......@@ -123,8 +120,8 @@
<update id="deleteByMenuId">
<if test="menuId != null">
update tab_sys_menu_item set status = 0
where status = 1
update tab_sys_menu_item set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and menu_id = #{menuId}
</if>
</update>
......@@ -135,14 +132,14 @@
<include refid="Base_Column_List" />
from tab_sys_menu_item
where menu_id = #{menuId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
<select id="listMenuItemByMenuIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu_item
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and menu_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
......@@ -153,7 +150,7 @@
select
item_id
from tab_sys_menu_item
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
GROUP by item_id
</select>
......@@ -161,7 +158,7 @@
select menu_id menuId,
count(1) operationItemCount
from tab_sys_menu_item
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and item_id = #{itemId}
group by menu_id
</select>
......@@ -169,8 +166,8 @@
<update id="deleteByMenuIdList">
<if test="list != null and list.size() > 0">
update tab_sys_menu_item set status = 0
where status = 1
update tab_sys_menu_item set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and menu_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
......@@ -180,8 +177,8 @@
<update id="deleteByItemId">
<if test="itemId != null">
update tab_sys_menu_item set status = 0
where status = 1
update tab_sys_menu_item set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and item_id = #{itemId}
</if>
</update>
......@@ -189,7 +186,7 @@
<select id="listByDev" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_menu_item_dev
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and menu_id = #{menuId}
</select>
</mapper>
\ No newline at end of file
......@@ -10,7 +10,7 @@
<result column="target" jdbcType="INTEGER" property="target" />
<result column="icon_url" jdbcType="VARCHAR" property="iconUrl" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="level" jdbcType="INTEGER" property="level" />
......@@ -26,7 +26,7 @@
<result column="platform_type" jdbcType="INTEGER" property="platformType" />
</resultMap>
<sql id="Base_Column_List">
menu_id, menu_name, project, menu_url, parent_id, target, icon_url, sort, status,
menu_id, menu_name, project, menu_url, parent_id, target, icon_url, sort, delete_flag,
create_time, update_time, level, is_show, menu_code, parent_code, menu_version, menu_type,
menu_version_name, project_url_for_web, admin_only_sign, auth_type, platform_type
</sql>
......@@ -48,21 +48,18 @@
from tab_sys_menu
where menu_id = #{menuId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_menu
where menu_id = #{menuId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysMenu">
insert into tab_sys_menu (menu_id, menu_name, project,
menu_url, parent_id, target,
icon_url, sort, status,
icon_url, sort, delete_flag,
create_time, update_time, level,
is_show, menu_code, parent_code,
menu_version, menu_type, menu_version_name,
project_url_for_web, admin_only_sign, auth_type, platform_type)
values (#{menuId,jdbcType=INTEGER}, #{menuName,jdbcType=VARCHAR}, #{project,jdbcType=VARCHAR},
#{menuUrl,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{target,jdbcType=INTEGER},
#{iconUrl,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{iconUrl,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{level,jdbcType=INTEGER},
#{isShow,jdbcType=INTEGER}, #{menuCode,jdbcType=VARCHAR}, #{parentCode,jdbcType=VARCHAR},
#{menuVersion,jdbcType=VARCHAR}, #{menuType,jdbcType=INTEGER}, #{menuVersionName,jdbcType=VARCHAR},
......@@ -95,8 +92,8 @@
<if test="sort != null">
sort,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -163,8 +160,8 @@
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -231,8 +228,8 @@
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -276,6 +273,71 @@
</set>
where menu_id = #{menuId,jdbcType=INTEGER}
</update>
<update id="updatePageForHaobanApplet" parameterType="com.gic.auth.entity.TabSysMenu">
update tab_sys_menu
<set>
<if test="menuName != null">
menu_name = #{menuName,jdbcType=VARCHAR},
</if>
<if test="menuUrl != null">
menu_url = #{menuUrl,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="target != null">
target = #{target,jdbcType=INTEGER},
</if>
<if test="iconUrl != null">
icon_url = #{iconUrl,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="level != null">
level = #{level,jdbcType=INTEGER},
</if>
<if test="isShow != null">
is_show = #{isShow,jdbcType=INTEGER},
</if>
<if test="menuCode != null">
menu_code = #{menuCode,jdbcType=VARCHAR},
</if>
<if test="parentCode != null">
parent_code = #{parentCode,jdbcType=VARCHAR},
</if>
<if test="menuVersion != null">
menu_version = #{menuVersion,jdbcType=VARCHAR},
</if>
<if test="menuType != null">
menu_type = #{menuType,jdbcType=INTEGER},
</if>
<if test="menuVersionName != null">
menu_version_name = #{menuVersionName,jdbcType=VARCHAR},
</if>
<if test="projectUrlForWeb != null">
project_url_for_web = #{projectUrlForWeb,jdbcType=VARCHAR},
</if>
<if test="adminOnlySign != null">
admin_only_sign = #{adminOnlySign,jdbcType=INTEGER},
</if>
<if test="authType != null">
auth_type = #{authType,jdbcType=INTEGER},
</if>
</set>
where platform_type = #{platformType,jdbcType=INTEGER}
and project = #{project,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.auth.entity.TabSysMenu">
update tab_sys_menu
set menu_name = #{menuName,jdbcType=VARCHAR},
......@@ -285,7 +347,7 @@
target = #{target,jdbcType=INTEGER},
icon_url = #{iconUrl,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
level = #{level,jdbcType=INTEGER},
......@@ -306,7 +368,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
where delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="search != null and search != '' ">
and ( menu_name like concat('%', #{search}, '%') or menu_code like concat('%', #{search}, '%') )
</if>
......@@ -320,7 +382,7 @@
<if test="menuType != null">
and menu_type = #{menuType}
</if>
<if test="menuType == null">
<if test="menuType == null and menuTypeList == null">
and menu_type != 2
</if>
<if test="level != null">
......@@ -341,6 +403,12 @@
#{item}
</foreach>
</if>
<if test="menuTypeList != null and menuTypeList.size() > 0">
and menu_type in
<foreach close=")" collection="menuTypeList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
order by level,sort
</select>
......@@ -349,7 +417,7 @@
select
ifnull(max(sort), 0)
from tab_sys_menu
where status=1
where delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and parent_id = #{parentId}
<if test="project != null">
and project = #{project}
......@@ -361,7 +429,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
where delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and parent_id = #{parentId}
and menu_type = 2
order by sort
......@@ -371,7 +439,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
where delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and parent_id = #{parentId}
and project = #{project}
order by sort
......@@ -381,7 +449,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
where delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="search != null and search != '' ">
and ( menu_name like concat('%', #{search}, '%') or menu_code like concat('%', #{search}, '%') or parent_code like concat('%', #{search}, '%') or menu_url like concat('%', #{search}, '%') )
</if>
......@@ -400,7 +468,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
where delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="null != menuIdList and menuIdList.size() &gt; 0">
and menu_id in
<foreach close=")" collection="menuIdList" index="index" item="item" open="(" separator=",">
......@@ -413,7 +481,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
where delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="null != parentMenuIdList and parentMenuIdList.size() &gt; 0">
and parent_id in
<foreach close=")" collection="parentMenuIdList" index="index" item="item" open="(" separator=",">
......@@ -422,11 +490,34 @@
</if>
</select>
<update id="updateMenuTmp">
update tab_sys_menu set
<if test="parentId != null">
parent_id = #{parentId},
</if>
<if test="parentCode != null and parentCode != ''">
parent_code = #{parentCode},
</if>
<if test="menuVersion != null and menuVersion != ''">
menu_version = #{menuVersion},
</if>
<if test="menuVersionName != null and menuVersionName != ''">
menu_version_name = #{menuVersionName},
</if>
project = #{project}
where menu_id in
<foreach close=")" collection="menuIdList" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
and delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</update>
<select id="selectByIdsAndOrderBy" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
where delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="null != menuIdList and menuIdList.size() &gt; 0">
and menu_id in
<foreach close=")" collection="menuIdList" index="index" item="item" open="(" separator=",">
......@@ -442,9 +533,9 @@
select
a.menu_id menuId,
a.menu_name menuName,
(select count(DISTINCT b.item_id) from tab_sys_menu_item b where a.menu_id = b.menu_id and b.status = 1 ) operationItemCount
(select count(DISTINCT b.item_id) from tab_sys_menu_item b where a.menu_id = b.menu_id and b.delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS} ) operationItemCount
from tab_sys_menu a
where a.status=1
where a.delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and a.parent_id = #{menuId}
<include refid="role_filter" />
</select>
......@@ -454,7 +545,7 @@
select
count(1)
from tab_sys_menu
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and parent_id = #{menuId}
</select>
......@@ -462,7 +553,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
where delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="project != null">
and project = #{project}
</if>
......@@ -486,7 +577,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
where delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and project != 'gic'
and platform_type = 0
<include refid="tree_filter" />
......@@ -502,7 +593,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status=1
where delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and project != 'gic'
and platform_type = 0
<include refid="tree_filter" />
......@@ -529,7 +620,7 @@
<select id="countByMenuCode" resultType="int">
SELECT count(1) from tab_sys_menu
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and menu_code = #{menuCode}
<if test="menuId != null">
and menu_id &lt;&gt; #{menuId}
......@@ -539,7 +630,7 @@
<select id="getMenuByMenuCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_menu
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and menu_code = #{menuCode}
limit 1
</select>
......@@ -548,14 +639,14 @@
<update id="updateParentCodeByParentId">
update tab_sys_menu set parent_code = #{parentCode}
where parent_id = #{parentId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</update>
<select id="listAdminOnlyOperationItem" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and admin_only_sign = 1
and menu_type = 2
and platform_type = 0
......@@ -564,8 +655,8 @@
<update id="deleteByMenuIdList">
<if test="list != null and list.size() > 0">
update tab_sys_menu set status = 0
where status = 1
update tab_sys_menu set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and menu_id IN
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
#{item}
......@@ -575,10 +666,13 @@
<update id="deleteNotInApp">
<if test="list != null and list.size() > 0">
update tab_sys_menu set status = 0
where status = 1
update tab_sys_menu set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and project != 'gic'
and platform_type = 0
and platform_type in
<foreach close=")" collection="platformTypeList" index="index" item="platformType" open="(" separator=",">
#{platformType}
</foreach>
and project NOT IN
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
#{item}
......@@ -589,7 +683,7 @@
<select id="listMenuTemp" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_menu_dev
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and project = #{project}
and platform_type = 0
</select>
......@@ -597,14 +691,14 @@
<select id="listMenuTempByMenuCode" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_menu_dev
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and parent_code = #{menuCode}
</select>
<select id="listMenuTempByMenuIdList" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_menu_dev
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and parent_id in
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
#{item}
......@@ -617,14 +711,14 @@
FROM
tab_sys_menu
WHERE
status = 1
delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and menu_code IN (
SELECT
menu_code
FROM
tab_sys_menu_dev
WHERE
status = 1 and
delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS} and
menu_id IN (
SELECT
item_id
......@@ -632,7 +726,7 @@
tab_sys_menu_item_dev
WHERE
menu_id = #{menuId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
)
)
</select>
......
......@@ -6,12 +6,12 @@
<result column="menu_id" jdbcType="INTEGER" property="menuId" />
<result column="role_id" jdbcType="INTEGER" property="roleId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
menu_role_id, menu_id, role_id, enterprise_id, status, create_time, update_time
menu_role_id, menu_id, role_id, enterprise_id, delete_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -19,16 +19,13 @@
from tab_sys_menu_role
where menu_role_id = #{menuRoleId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_menu_role
where menu_role_id = #{menuRoleId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysMenuRole">
insert into tab_sys_menu_role (menu_role_id, menu_id, role_id,
enterprise_id, status, create_time,
enterprise_id, delete_flag, create_time,
update_time)
values (#{menuRoleId,jdbcType=INTEGER}, #{menuId,jdbcType=INTEGER}, #{roleId,jdbcType=INTEGER},
#{enterpriseId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{enterpriseId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysMenuRole">
......@@ -46,8 +43,8 @@
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -69,8 +66,8 @@
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -92,8 +89,8 @@
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -109,20 +106,21 @@
set menu_id = #{menuId,jdbcType=INTEGER},
role_id = #{roleId,jdbcType=INTEGER},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where menu_role_id = #{menuRoleId,jdbcType=INTEGER}
</update>
<delete id="deleteByRoleId">
DELETE FROM tab_sys_menu_role
<update id="deleteByRoleId">
update tab_sys_menu_role set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where role_id = #{roleId}
</delete>
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</update>
<insert id="insertForeach" parameterType="java.util.List">
insert into tab_sys_menu_role (menu_role_id, menu_id, role_id,
enterprise_id, status, create_time,
enterprise_id, delete_flag, create_time,
update_time)
values
<foreach collection="list" item="item" index="index" separator=",">
......@@ -131,7 +129,7 @@
#{item.menuId},
#{item.roleId},
#{item.enterpriseId},
#{item.status},
#{item.deleteFlag},
#{item.createTime},
#{item.updateTime}
)
......@@ -144,14 +142,14 @@
<include refid="Base_Column_List" />
from tab_sys_menu_role
where role_id = #{roleId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
<select id="listMenuRoleByRoleIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu_role
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and role_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
......
......@@ -5,14 +5,14 @@
<id column="operation_user_id" jdbcType="INTEGER" property="operationUserId" />
<result column="operation_user_name" jdbcType="VARCHAR" property="operationUserName" />
<result column="phone_number" jdbcType="VARCHAR" property="phoneNumber" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="phone_area_code" jdbcType="VARCHAR" property="phoneAreaCode" />
</resultMap>
<sql id="Base_Column_List">
operation_user_id, operation_user_name, phone_number, status, create_time, update_time,
operation_user_id, operation_user_name, phone_number, delete_flag, create_time, update_time,
enterprise_id, phone_area_code
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -21,17 +21,14 @@
from tab_sys_operation_user
where operation_user_id = #{operationUserId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_operation_user
where operation_user_id = #{operationUserId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysOperationUser" useGeneratedKeys="true" keyProperty="operationUserId">
insert into tab_sys_operation_user (operation_user_id, operation_user_name,
phone_number, status, create_time,
phone_number, delete_flag, create_time,
update_time, enterprise_id, phone_area_code
)
values (#{operationUserId,jdbcType=INTEGER}, #{operationUserName,jdbcType=VARCHAR},
#{phoneNumber,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{phoneNumber,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{enterpriseId,jdbcType=INTEGER}, #{phoneAreaCode,jdbcType=VARCHAR}
)
</insert>
......@@ -47,8 +44,8 @@
<if test="phoneNumber != null">
phone_number,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -73,8 +70,8 @@
<if test="phoneNumber != null">
#{phoneNumber,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -99,8 +96,8 @@
<if test="phoneNumber != null">
phone_number = #{phoneNumber,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -121,7 +118,7 @@
update tab_sys_operation_user
set operation_user_name = #{operationUserName,jdbcType=VARCHAR},
phone_number = #{phoneNumber,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
......@@ -132,7 +129,7 @@
<select id="getByPhone" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"></include>
from tab_sys_operation_user
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and enterprise_id = #{enterpriseId}
and phone_number = #{phone}
</select>
......
......@@ -8,10 +8,10 @@
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
</resultMap>
<sql id="Base_Column_List">
order_app_resource_id, enterprise_id, type, content, create_time, update_time, status
order_app_resource_id, enterprise_id, type, content, create_time, update_time, delete_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -19,17 +19,14 @@
from tab_sys_order_app_resource
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_order_app_resource
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysOrderAppResource">
insert into tab_sys_order_app_resource (order_app_resource_id, enterprise_id,
type, content, create_time,
update_time, status)
update_time, delete_flag)
values (#{orderAppResourceId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER})
#{updateTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysOrderAppResource">
<selectKey keyProperty="orderAppResourceId" order="AFTER" resultType="java.lang.Integer">
......@@ -55,8 +52,8 @@
<if test="updateTime != null">
update_time,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -78,8 +75,8 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
</trim>
</insert>
......@@ -101,8 +98,8 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
</set>
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
......@@ -114,7 +111,7 @@
content = #{content,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
delete_flag = #{deleteFlag,jdbcType=INTEGER}
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</update>
<select id="listByIds" resultMap="BaseResultMap">
......
......@@ -17,12 +17,12 @@
<result column="channel_resource" jdbcType="INTEGER" property="channelResource" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
</resultMap>
<sql id="Base_Column_List">
resource_id, resource_name, enterprise_id, user_resource, member_card_resource, fwh_resource,
applet_resource, store_resource, goods_resource_id, order_resource, app_resource,
sms_sign_resource, channel_resource, create_time, update_time, status
sms_sign_resource, channel_resource, create_time, update_time, delete_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -30,23 +30,20 @@
from tab_sys_resource
where resource_id = #{resourceId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_resource
where resource_id = #{resourceId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysResource">
insert into tab_sys_resource (resource_id, resource_name, enterprise_id,
user_resource, member_card_resource, fwh_resource,
applet_resource, store_resource, goods_resource_id,
order_resource, app_resource, sms_sign_resource,
channel_resource, create_time, update_time,
status)
delete_flag)
values (#{resourceId,jdbcType=INTEGER}, #{resourceName,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=INTEGER},
#{userResource,jdbcType=BIGINT}, #{memberCardResource,jdbcType=BIGINT}, #{fwhResource,jdbcType=BIGINT},
#{appletResource,jdbcType=BIGINT}, #{storeResource,jdbcType=BIGINT}, #{goodsResourceId,jdbcType=BIGINT},
#{orderResource,jdbcType=INTEGER}, #{appResource,jdbcType=INTEGER}, #{smsSignResource,jdbcType=INTEGER},
#{channelResource,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{status,jdbcType=INTEGER})
#{deleteFlag,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysResource">
insert into tab_sys_resource
......@@ -96,8 +93,8 @@
<if test="updateTime != null">
update_time,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -146,8 +143,8 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
</trim>
</insert>
......@@ -196,8 +193,8 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
</set>
where resource_id = #{resourceId,jdbcType=INTEGER}
......@@ -218,14 +215,14 @@
channel_resource = #{channelResource,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
delete_flag = #{deleteFlag,jdbcType=INTEGER}
where resource_id = #{resourceId,jdbcType=INTEGER}
</update>
<select id="listResource" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_resource
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="resourceName != null and resourceName != '' ">
and resource_name like concat('%', #{resourceName}, '%')
</if>
......@@ -238,7 +235,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_resource
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="resourceId != null ">
and resource_id &lt;&gt; #{resourceId}
</if>
......
......@@ -5,12 +5,12 @@
<id column="role_id" jdbcType="INTEGER" property="roleId" />
<result column="role_name" jdbcType="VARCHAR" property="roleName" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
role_id, role_name, enterprise_id, status, create_time, update_time
role_id, role_name, enterprise_id, delete_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -18,16 +18,13 @@
from tab_sys_role
where role_id = #{roleId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_role
where role_id = #{roleId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysRole" useGeneratedKeys="true" keyProperty="roleId">
insert into tab_sys_role (role_id, role_name, enterprise_id,
status, create_time, update_time
delete_flag, create_time, update_time
)
values (#{roleId,jdbcType=INTEGER}, #{roleName,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
#{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysRole">
......@@ -42,8 +39,8 @@
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -62,8 +59,8 @@
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -82,8 +79,8 @@
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -98,7 +95,7 @@
update tab_sys_role
set role_name = #{roleName,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where role_id = #{roleId,jdbcType=INTEGER}
......@@ -108,9 +105,9 @@
select
a.role_id roleId,
a.role_name roleName,
(select count(DISTINCT b.user_id) from tab_sys_user_role b where a.role_id = b.role_id and b.status = 1 ) authUserCount
(select count(DISTINCT b.user_id) from tab_sys_user_role b where a.role_id = b.role_id and b.delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS} ) authUserCount
from tab_sys_role a
where a.status = 1
where a.delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and a.enterprise_id = #{enterpriseId}
<if test="search != null and search != '' ">
and ( a.role_name like concat('%', #{search}, '%') )
......@@ -120,23 +117,23 @@
</select>
<update id="deleteByRoleId">
update tab_sys_role set status = 0
update tab_sys_role set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where role_id = #{roleId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</update>
<select id="listRoleNoPage" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_role
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and enterprise_id = #{enterpriseId}
</select>
<select id="countRepeatRoleName" resultType="int">
select count(1) from tab_sys_role
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="roleId != null">
and role_id <![CDATA[ <> ]]> #{roleId}
</if>
......
......@@ -5,7 +5,7 @@
<id column="union_id" jdbcType="INTEGER" property="unionId" />
<result column="union_enterprise_id" jdbcType="INTEGER" property="unionEnterpriseId" />
<result column="union_enterprise_name" jdbcType="VARCHAR" property="unionEnterpriseName" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="authorization_status" jdbcType="INTEGER" property="authorizationStatus" />
<result column="authorization_time" jdbcType="TIMESTAMP" property="authorizationTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
......@@ -13,7 +13,7 @@
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
</resultMap>
<sql id="Base_Column_List">
union_id, union_enterprise_id, union_enterprise_name, status, authorization_status,
union_id, union_enterprise_id, union_enterprise_name, delete_flag, authorization_status,
authorization_time, create_time, update_time, enterprise_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
......@@ -22,17 +22,14 @@
from tab_sys_union_enterprise
where union_id = #{unionId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_union_enterprise
where union_id = #{unionId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysUnionEnterprise" useGeneratedKeys="true" keyProperty="unionId">
insert into tab_sys_union_enterprise (union_id, union_enterprise_id, union_enterprise_name,
status, authorization_status, authorization_time,
delete_flag, authorization_status, authorization_time,
create_time, update_time, enterprise_id
)
values (#{unionId,jdbcType=INTEGER}, #{unionEnterpriseId,jdbcType=INTEGER}, #{unionEnterpriseName,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{authorizationStatus,jdbcType=INTEGER}, #{authorizationTime,jdbcType=TIMESTAMP},
#{deleteFlag,jdbcType=INTEGER}, #{authorizationStatus,jdbcType=INTEGER}, #{authorizationTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{enterpriseId,jdbcType=INTEGER}
)
</insert>
......@@ -48,8 +45,8 @@
<if test="unionEnterpriseName != null">
union_enterprise_name,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="authorizationStatus != null">
authorization_status,
......@@ -77,8 +74,8 @@
<if test="unionEnterpriseName != null">
#{unionEnterpriseName,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="authorizationStatus != null">
#{authorizationStatus,jdbcType=INTEGER},
......@@ -106,8 +103,8 @@
<if test="unionEnterpriseName != null">
union_enterprise_name = #{unionEnterpriseName,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="authorizationStatus != null">
authorization_status = #{authorizationStatus,jdbcType=INTEGER},
......@@ -131,7 +128,7 @@
update tab_sys_union_enterprise
set union_enterprise_id = #{unionEnterpriseId,jdbcType=INTEGER},
union_enterprise_name = #{unionEnterpriseName,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
authorization_status = #{authorizationStatus,jdbcType=INTEGER},
authorization_time = #{authorizationTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -144,14 +141,14 @@
<include refid="Base_Column_List" />
from tab_sys_union_enterprise
where union_enterprise_id = #{unionId,jdbcType=INTEGER}
and status=1
and delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
<select id="pageUnionEnterprise" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_union_enterprise
where enterprise_id = #{enterpriseId,jdbcType=INTEGER}
and status=1
and delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="search != null and search !=''">
and union_enterprise_name like concat('%',#{search}, '%')
</if>
......
......@@ -12,11 +12,11 @@
<result column="resource" jdbcType="BIGINT" property="resource" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
</resultMap>
<sql id="Base_Column_List">
union_resource_id, union_id, resource_type, authorization_status, authorization_time,
authorization_message, enterprise_id, resource, create_time, update_time, status
authorization_message, enterprise_id, resource, create_time, update_time, delete_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -24,20 +24,17 @@
from tab_sys_union_enterprise_resource
where union_resource_id = #{unionResourceId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_union_enterprise_resource
where union_resource_id = #{unionResourceId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysUnionEnterpriseResource">
insert into tab_sys_union_enterprise_resource (union_resource_id, union_id, resource_type,
authorization_status, authorization_time,
authorization_message, enterprise_id, resource,
create_time, update_time, status
create_time, update_time, delete_flag
)
values (#{unionResourceId,jdbcType=INTEGER}, #{unionId,jdbcType=INTEGER}, #{resourceType,jdbcType=INTEGER},
#{authorizationStatus,jdbcType=INTEGER}, #{authorizationTime,jdbcType=TIMESTAMP},
#{authorizationMessage,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=INTEGER}, #{resource,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysUnionEnterpriseResource">
......@@ -73,8 +70,8 @@
<if test="updateTime != null">
update_time,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
......@@ -108,8 +105,8 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
</trim>
</insert>
......@@ -143,8 +140,8 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
</set>
where union_resource_id = #{unionResourceId,jdbcType=INTEGER}
......@@ -160,7 +157,7 @@
resource = #{resource,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
delete_flag = #{deleteFlag,jdbcType=INTEGER}
where union_resource_id = #{unionResourceId,jdbcType=INTEGER}
</update>
<select id="getResource" resultMap="BaseResultMap">
......@@ -169,18 +166,18 @@
from tab_sys_union_enterprise_resource
where union_id = #{unionId,jdbcType=INTEGER}
and resource_type = #{type}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
<update id="delResource" >
update tab_sys_union_enterprise_resource
set status=0
set delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where union_id = #{unionId,jdbcType=INTEGER}
and enterprise_id= #{enterpriseId}
</update>
<update id="updateAuthorizationStatus" >
update tab_sys_union_enterprise_resource
set authorization_status=#{authOrizationStatus},authorization_time=now(),authorization_message=#{authOrizationMessage}, auth_key=#{key}
where enterprise_id= #{enterpriseId} and resource_type=#{resourceType} and status = 1
where enterprise_id= #{enterpriseId} and resource_type=#{resourceType} and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</update>
<select id="listResourceByEnterpriseIdAndType" resultType="com.gic.auth.dto.UnionEnterpriseResourceDTO">
select
......@@ -189,18 +186,18 @@
where t1.enterprise_id = #{enterpriseId,jdbcType=INTEGER}
and t1.union_id=t2.union_id
and t2.resource_type = #{type}
and t1.status = 1
and t1.delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
<select id="listResourceByUnionId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_union_enterprise_resource
where union_id=#{unionId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
<update id="delResourceByResourceId" >
update tab_sys_union_enterprise_resource
set status=0
set delete_flag=${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where resource = #{resourceId}
</update>
<select id="getKeyByResourceId" resultMap="BaseResultMap">
......@@ -208,7 +205,7 @@
auth_key
from tab_sys_union_enterprise_resource
where resource=#{resourceId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
<select id="getUnionEnterpriseIdByResouce" resultMap="BaseResultMap">
select
......
......@@ -7,7 +7,7 @@
<result column="phone_number" jdbcType="VARCHAR" property="phoneNumber" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="super_admin" jdbcType="INTEGER" property="superAdmin" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
......@@ -18,10 +18,11 @@
<result column="account_type" jdbcType="INTEGER" property="accountType" />
<result column="account_due_date" jdbcType="TIMESTAMP" property="accountDueDate" />
<result column="user_position" jdbcType="INTEGER" property="userPosition" />
<result column="marking_flag" jdbcType="INTEGER" property="markingFlag" />
</resultMap>
<sql id="Base_Column_List">
user_id, user_name, phone_number, password, super_admin, status, create_time, update_time,
enterprise_id, phone_area_code, user_group_ids, login_type, password_type, account_type, account_due_date, user_position
user_id, user_name, phone_number, password, super_admin, delete_flag, create_time, update_time,
enterprise_id, phone_area_code, user_group_ids, login_type, password_type, account_type, account_due_date, user_position, marking_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -29,18 +30,15 @@
from tab_sys_user
where user_id = #{userId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_user
where user_id = #{userId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysUser" useGeneratedKeys="true" keyProperty="userId">
insert into tab_sys_user (user_id, user_name, phone_number,
password, super_admin, status,
password, super_admin, delete_flag,
create_time, update_time, enterprise_id,
phone_area_code, user_group_ids, login_type, password_type, account_type, account_due_date, user_position
)
values (#{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{phoneNumber,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR}, #{superAdmin,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{password,jdbcType=VARCHAR}, #{superAdmin,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{enterpriseId,jdbcType=INTEGER},
#{phoneAreaCode,jdbcType=VARCHAR}, #{userGroupIds,jdbcType=VARCHAR}, #{loginType,jdbcType=INTEGER},
#{passwordType,jdbcType=INTEGER}, #{accountType,jdbcType=INTEGER}, #{accountDueDate,jdbcType=TIMESTAMP}, #{userPosition,jdbcType=INTEGER}
......@@ -64,8 +62,8 @@
<if test="superAdmin != null">
super_admin,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -114,8 +112,8 @@
<if test="superAdmin != null">
#{superAdmin,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -164,8 +162,8 @@
<if test="superAdmin != null">
super_admin = #{superAdmin,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -206,7 +204,7 @@
phone_number = #{phoneNumber,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
super_admin = #{superAdmin,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
......@@ -222,7 +220,7 @@
<select id="countByPhone" resultType="int">
select count(1) from tab_sys_user
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="userId != null">
and user_id <![CDATA[ <> ]]> #{userId}
</if>
......@@ -232,7 +230,7 @@
<select id="countByPhoneAndLoginType" resultType="int">
select count(1) from tab_sys_user
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="userId != null">
and user_id <![CDATA[ <> ]]> #{userId}
</if>
......@@ -247,7 +245,7 @@
<include refid="Base_Column_List" />
from tab_sys_user
where enterprise_id = #{enterpriseId,jdbcType=INTEGER}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and super_admin = 1
and login_type = 0
</select>
......@@ -256,7 +254,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_user
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="enterpriseId != null">
and enterprise_id = #{enterpriseId}
</if>
......@@ -273,7 +271,7 @@
<include refid="Base_Column_List" />
from tab_sys_user
where phone_number = #{phoneNumber}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and enterprise_id = #{enterpriseId}
and password = #{password}
and phone_area_code = #{nationCode}
......@@ -297,9 +295,9 @@
left join tab_sys_user_role b on a.user_id = b.user_id
left join tab_sys_user_resource c on a.user_id = c.user_id
where a.enterprise_id = #{enterpriseId}
and a.status = 1
and b.status = 1
and c.status = 1
and a.delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and b.delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and c.delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and a.login_type = 0
<if test="search != null and search != '' ">
and ( a.user_name like concat('%', #{search}, '%') or a.phone_number like concat('%', #{search}, '%') )
......@@ -339,9 +337,9 @@
<update id="deleteById">
update tab_sys_user set status = 0
update tab_sys_user set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where user_id = #{userId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and login_type = 0
</update>
......@@ -349,7 +347,7 @@
select
1
from tab_sys_user
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and login_type = 0
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
......@@ -363,7 +361,7 @@
limit 1
</select>
<select id="countUserByUserIds" resultType="java.lang.Integer">
select count(1) from tab_sys_user where status = 1
select count(1) from tab_sys_user where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and login_type = 0
and user_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
......@@ -376,7 +374,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_user
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and login_type = 0
<if test="ids != null and ids.size() > 0">
and user_id in
......@@ -390,7 +388,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_user
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and enterprise_id = #{enterpriseId}
and login_type = 0
and super_admin != 1
......@@ -407,7 +405,7 @@
<select id="listAllUser" resultType="java.lang.Integer">
select user_id from tab_sys_user where status = 1
select user_id from tab_sys_user where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="enterpriseId != null">
and enterprise_id = #{enterpriseId}
</if>
......@@ -415,7 +413,7 @@
<select id="listGicUser" resultMap="BaseResultMap">
select <include refid="Base_Column_List"></include>
from tab_sys_user where status = 1
from tab_sys_user where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
and enterprise_id = #{enterpriseId}
<if test="isGic != null">
and login_type = #{isGic}
......
......@@ -6,12 +6,12 @@
<result column="resource_id" jdbcType="INTEGER" property="resourceId" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
user_resource_id, resource_id, user_id, enterprise_id, status, create_time, update_time
user_resource_id, resource_id, user_id, enterprise_id, delete_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -19,16 +19,13 @@
from tab_sys_user_resource
where user_resource_id = #{userResourceId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_user_resource
where user_resource_id = #{userResourceId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysUserResource">
insert into tab_sys_user_resource (user_resource_id, resource_id, user_id,
enterprise_id, status, create_time,
enterprise_id, delete_flag, create_time,
update_time)
values (#{userResourceId,jdbcType=INTEGER}, #{resourceId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER},
#{enterpriseId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{enterpriseId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysUserResource">
......@@ -46,8 +43,8 @@
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -69,8 +66,8 @@
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -92,8 +89,8 @@
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -109,7 +106,7 @@
set resource_id = #{resourceId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where user_resource_id = #{userResourceId,jdbcType=INTEGER}
......@@ -118,7 +115,7 @@
select
<include refid="Base_Column_List" />
from tab_sys_user_resource
where status = 1
where delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="resourceId != null ">
and resource_id = #{resourceId}
</if>
......@@ -130,7 +127,7 @@
<!--List<Map<String,Integer>> countByResourceIds(List<Integer> resourceIds);-->
<select id="countByResourceIds" resultType="java.util.HashMap">
select resource_id resourceId , count(1) userResourceCount from tab_sys_user_resource where
status = 1
delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
<if test="null != ids">
and resource_id in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
......@@ -142,9 +139,9 @@
<update id="deleteByUserId" parameterType="java.lang.Integer">
UPDATE tab_sys_user_resource set status = 0
UPDATE tab_sys_user_resource set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where user_id = #{userId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</update>
<select id="listUserResourceByUserId" resultMap="BaseResultMap">
......@@ -152,6 +149,6 @@
<include refid="Base_Column_List" />
from tab_sys_user_resource
where user_id = #{userId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
</mapper>
\ No newline at end of file
......@@ -6,12 +6,12 @@
<result column="role_id" jdbcType="INTEGER" property="roleId" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
user_role_id, role_id, user_id, enterprise_id, status, create_time, update_time
user_role_id, role_id, user_id, enterprise_id, delete_flag, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -19,16 +19,13 @@
from tab_sys_user_role
where user_role_id = #{userRoleId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_user_role
where user_role_id = #{userRoleId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysUserRole">
insert into tab_sys_user_role (user_role_id, role_id, user_id,
enterprise_id, status, create_time,
enterprise_id, delete_flag, create_time,
update_time)
values (#{userRoleId,jdbcType=INTEGER}, #{roleId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER},
#{enterpriseId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{enterpriseId,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysUserRole">
......@@ -46,8 +43,8 @@
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="status != null">
status,
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createTime != null">
create_time,
......@@ -69,8 +66,8 @@
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
......@@ -92,8 +89,8 @@
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -109,16 +106,16 @@
set role_id = #{roleId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where user_role_id = #{userRoleId,jdbcType=INTEGER}
</update>
<update id="deleteByUserId" parameterType="java.lang.Integer">
UPDATE tab_sys_user_role set status = 0
UPDATE tab_sys_user_role set delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@DELETE_STATUS}
where user_id = #{userId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</update>
<select id="listUserRoleByUserId" resultMap="BaseResultMap">
......@@ -126,7 +123,7 @@
<include refid="Base_Column_List" />
from tab_sys_user_role
where user_id = #{userId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
......@@ -135,6 +132,6 @@
<include refid="Base_Column_List" />
from tab_sys_user_role
where role_id = #{roleId}
and status = 1
and delete_flag = ${@com.gic.auth.constant.DeleteFlagConstants@NORMAL_STATUS}
</select>
</mapper>
\ No newline at end of file
......@@ -29,6 +29,7 @@ import com.gic.enterprise.utils.UserDetailUtils;
import com.gic.member.config.api.service.AppletsConfigApiService;
import com.gic.member.config.api.service.MemberCardApiService;
import com.gic.member.config.api.service.ServiceConfigApiService;
import com.gic.redis.data.util.RedisUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -41,6 +42,8 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
/**
*
* @ClassName: LoginController
......@@ -73,6 +76,8 @@ public class LoginController {
@Autowired
private ServiceConfigApiService serviceConfigApiService;
private static final String MENU_LOCAL_CACHE_KEY = "auth:menu:list:all";
@RequestMapping("list-enterprise-by-phone")
public RestResponse listUserEnterprise(String phoneNumber, String nationCode) {
if (StringUtils.isBlank(phoneNumber)) {
......@@ -150,43 +155,22 @@ public class LoginController {
}
if (enterpriseDTO != null) {
userDetail.setEnterpriseInfo(EntityUtil.changeEntityNew(EnterpriseInfo.class, enterpriseDTO));
//登录用户所拥有的权限菜单和操作项(接口)
ServiceResponse<List<MenuDTO>> menuResult = menuApiService.listUserMenu(userDetail.getUserId(),
enterpriseDTO.getVersionCode());
if (menuResult.isSuccess()) {
List<MenuDTO> menuList = menuResult.getResult();
List<MenuInfo> menuInfoList = EntityUtil.changeEntityListNew(MenuInfo.class, menuList);
Map<String, Object> map = new HashMap<>(16);
if (CollectionUtils.isNotEmpty(menuInfoList)) {
for (MenuInfo menuDTO : menuInfoList) {
if (StringUtils.isBlank(menuDTO.getMenuUrl())) {
continue;
}
map.put(menuDTO.getMenuUrl(), menuDTO);
}
}
//查询全部的操作模块
Map<String, MenuInfo> moduleMap = new HashMap<>(16);
ServiceResponse<List<MenuDTO>> allGicMenu = menuApiService
.getAllMenuNotTree(enterpriseDTO.getVersionCode());
if (allGicMenu.isSuccess()) {
List<MenuDTO> temp = allGicMenu.getResult();
List<MenuInfo> tempMenuInfoList = EntityUtil.changeEntityListNew(MenuInfo.class, temp);
if (CollectionUtils.isNotEmpty(tempMenuInfoList)) {
for (MenuInfo menuDTO : tempMenuInfoList) {
if (StringUtils.isBlank(menuDTO.getMenuUrl())) {
continue;
}
moduleMap.put(menuDTO.getProjectUrlForWeb() + menuDTO.getMenuUrl(), menuDTO);
}
}
userDetail.setMenuInfoList(tempMenuInfoList);
}
Set<Integer> menuIdSet = new HashSet<>(2);
if (CollectionUtils.isNotEmpty(menuList)) {
menuIdSet = menuList.stream().filter(e -> StringUtils.isNotBlank(e.getMenuUrl()))
.map(e -> e.getMenuId()).collect(Collectors.toSet());
}
//塞用户权限菜单值
userDetail.setMenuIdSet(menuIdSet);
//塞本地缓存
setAllMenuToLocaleCache();
//设置用户资源组
this.setUserResource(userDetail, userDetail.getUserId());
//塞值
userDetail.setMenuUrlMap(map);
userDetail.setModuleUrlMap(moduleMap);
}
//塞缓存
UserDetailUtils.setUserDetail(userDetail);
......@@ -234,6 +218,19 @@ public class LoginController {
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "token错误");
}
/**
* gic平台的菜单数据塞本地缓存
*/
private void setAllMenuToLocaleCache() {
ServiceResponse<List<MenuDTO>> response = menuApiService.getAllMenu();
if (response.isSuccess()) {
List<MenuDTO> list = response.getResult();
//gic平台的菜单数据塞本地缓存
RedisUtil.delLocalCache(MENU_LOCAL_CACHE_KEY);
RedisUtil.setLocalCache(MENU_LOCAL_CACHE_KEY, EntityUtil.changeEntityListNew(MenuInfo.class, list), null);
}
}
private void setUserResource(UserDetail detail, Integer userId) {
ServiceResponse<UserResourceDTO> resource = this.userResourceApiService.getResourceByUserId(userId);
detail.setUserResourceInfo(new UserResourceInfo());
......
......@@ -11,6 +11,7 @@ import com.gic.auth.service.UserApiService;
import com.gic.auth.web.utils.EnterpriseBasicAppUtils;
import com.gic.auth.web.vo.LogListVO;
import com.gic.auth.web.vo.UserOperationItemAuthVO;
import com.gic.commons.annotation.HeaderSignIgnore;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.ano.IgnoreLogin;
......@@ -113,12 +114,30 @@ public class MenuController {
return RestResponse.success(getAppId(null, menuCode));
}
/**
* gic菜单转到某一个应用下面
* @param menuCode
* @return
*/
@IgnoreLogin
@RequestMapping("sync-menu-to-pro")
public RestResponse syncMenuToPro(String menuCode) {
return RestResponse.success(menuApiService.syncProductMenu(menuCode));
}
@IgnoreLogin
@HeaderSignIgnore
@RequestMapping("switch-gic-menu-to-app")
public RestResponse switchGicMenuToApp(String gicMenuCode, String appMenuCode, Boolean appToGic) {
ServiceResponse response;
if (appToGic != null && appToGic) {
response = menuApiService.switchAppMenuToGic(gicMenuCode, appMenuCode);
} else {
response = menuApiService.switchGicMenuToApp(gicMenuCode, appMenuCode);
}
return ResultControllerUtils.commonResult(response);
}
@RequestMapping("login-collaborator-menu-of-app")
public RestResponse getCollaboratorMenu(String appId, String menuCode) {
LOGGER.info("查询登录用户的协作应用的菜单参数:{}-{}", appId, menuCode);
......
......@@ -127,8 +127,7 @@ public class ExcelUtils {
public static List<Map<Integer, String>> readXlsx(Workbook xssfWorkbook, int row, Map<Integer, Boolean> dateTypeMap) {
List<Map<Integer, String>> result = new ArrayList<Map<Integer, String>>();
String dateFormat = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat format = new SimpleDateFormat(dateFormat);
SimpleDateFormat format = new SimpleDateFormat(Constants.DATE_FORMAT);
// XSSFWorkbook xssfWorkbook = new XSSFWorkbook(in);
for (int numSheet = 0; numSheet < 1; numSheet++) {
Sheet xssfSheet = xssfWorkbook.getSheetAt(numSheet);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment