|
|
|
@ -1,10 +1,7 @@
|
|
|
|
|
package cn.estsh.i3plus.pojo.platform.sqlpack;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.Department;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.Position;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleLanguage;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleResource;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.*;
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
|
@ -56,54 +53,158 @@ public class CoreHqlPack {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* In 参数封装
|
|
|
|
|
* @param columnName
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlIds(String columnName,String[] params){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// 参数数组 [1,2,3] -> "1,2,3"
|
|
|
|
|
HqlPack.getInPack(String.join(",",params),columnName,result);
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 岗位复杂查询
|
|
|
|
|
* @param position
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlPosition(Position position) {
|
|
|
|
|
public static String packHqlPosition(Position position){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// 岗位名称
|
|
|
|
|
HqlPack.getStringLikerPack(position.getName(),"positionName",result);
|
|
|
|
|
// 岗位代码
|
|
|
|
|
// 查询参数封装
|
|
|
|
|
HqlPack.getNumEqualPack(position.getParentId(),"parentId",result);
|
|
|
|
|
HqlPack.getStringLikerPack(position.getName(),"name",result);
|
|
|
|
|
HqlPack.getStringLikerPack(position.getPositionCode(),"positionCode",result);
|
|
|
|
|
// 父级岗位
|
|
|
|
|
HqlPack.getNumEqualPack(position.getId(),"parentId",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* In 参数封装
|
|
|
|
|
* @param columnName
|
|
|
|
|
* 组织复杂查询
|
|
|
|
|
* @param organize
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlIds(String columnName,String[] params){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
public static String packHqlOrganize(Organize organize){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// 查询参数封装
|
|
|
|
|
HqlPack.getNumEqualPack(organize.getParentId(),"parentId",result);
|
|
|
|
|
HqlPack.getStringLikerPack(organize.getName(),"name",result);
|
|
|
|
|
HqlPack.getStringLikerPack(organize.getOrganizeCode(),"organizeCode",result);
|
|
|
|
|
|
|
|
|
|
// 参数数组 [1,2,3] -> "1,2,3"
|
|
|
|
|
HqlPack.getInPack(String.join(",",params),columnName,result);
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 部门复杂查询
|
|
|
|
|
* @param department
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlPosition(Department department) {
|
|
|
|
|
public static String packHqlDepartment(Department department){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// 查询参数封装
|
|
|
|
|
HqlPack.getNumEqualPack(department.getParentId(),"parentId",result);
|
|
|
|
|
HqlPack.getStringLikerPack(department.getName(),"name",result);
|
|
|
|
|
HqlPack.getStringLikerPack(department.getDepartmentCode(),"departmentCode",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 系统权限复杂查询
|
|
|
|
|
* @param menu
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysMenu(SysMenu menu){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// 查询参数封装
|
|
|
|
|
HqlPack.getNumEqualPack(menu.getParentId(),"parentId",result);
|
|
|
|
|
HqlPack.getNumEqualPack(menu.getMenuStatus(),"menuStatus",result);
|
|
|
|
|
HqlPack.getStringLikerPack(menu.getName(),"name",result);
|
|
|
|
|
HqlPack.getStringLikerPack(menu.getMenuCode(),"menuCode",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 系统角色复杂查询
|
|
|
|
|
* @param role
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysRole(SysRole role){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// 查询参数封装
|
|
|
|
|
HqlPack.getNumEqualPack(role.getRoleStatusId(),"roleStatusId",result);
|
|
|
|
|
HqlPack.getStringLikerPack(role.getName(),"name",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 系统参数复杂查询
|
|
|
|
|
* @param sysConfig
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysConfig(SysConfig sysConfig) {
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// hql拼接
|
|
|
|
|
HqlPack.getStringLikerPack(sysConfig.getName(),"name",result);
|
|
|
|
|
HqlPack.getStringLikerPack(sysConfig.getConfigCode(),"configCode",result);
|
|
|
|
|
HqlPack.getNumEqualPack(sysConfig.getConfigTypeId(),"configTypeId",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 字典信息复杂查询
|
|
|
|
|
* @param sysDictionary
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysDictionary(SysDictionary sysDictionary) {
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// hql拼接
|
|
|
|
|
HqlPack.getStringLikerPack(sysDictionary.getName(),"name",result);
|
|
|
|
|
HqlPack.getStringLikerPack(sysDictionary.getDictionaryCode(),"dictionaryCode",result);
|
|
|
|
|
HqlPack.getNumEqualPack(sysDictionary.getParentId(),"parentId",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 硬件类型复杂查询
|
|
|
|
|
* @param toolType
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlToolType(ToolType toolType) {
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// hql拼接
|
|
|
|
|
HqlPack.getStringLikerPack(toolType.getName(),"name",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 硬件复杂查询
|
|
|
|
|
* @param tool
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlTool(Tool tool) {
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// 部门名称
|
|
|
|
|
HqlPack.getStringLikerPack(department.getName(),"positionName",result);
|
|
|
|
|
// 部门代码
|
|
|
|
|
HqlPack.getStringLikerPack(department.getDepartmentCode(),"positionCode",result);
|
|
|
|
|
// 父级部门id
|
|
|
|
|
HqlPack.getNumEqualPack(department.getId(),"parentId",result);
|
|
|
|
|
// 所属组织id
|
|
|
|
|
HqlPack.getNumEqualPack(department.getOrganizeId(),"organizeId",result);
|
|
|
|
|
// hql拼接
|
|
|
|
|
HqlPack.getStringLikerPack(tool.getName(),"name",result);
|
|
|
|
|
HqlPack.getNumEqualPack(tool.getToolTypeId(),"toolTypeId",result);
|
|
|
|
|
HqlPack.getNumEqualPack(tool.getToolStatusId(),"toolStatusId",result);
|
|
|
|
|
HqlPack.getStringLikerPack(tool.getName(),"name",result);
|
|
|
|
|
HqlPack.getStringLikerPack(tool.getName(),"name",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|