|
|
|
@ -3,6 +3,7 @@ package cn.estsh.i3plus.pojo.platform.sqlpack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.*;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
|
|
|
@ -16,64 +17,78 @@ import java.util.Arrays;
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* In 参数封装
|
|
|
|
|
* @param columnName
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlIds(String columnName,Long[] params){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// 参数数组 [1,2,3] -> "1,2,3"
|
|
|
|
|
HqlPack.getInPack(StringUtils.join(params,","),columnName,result);
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 资源查询
|
|
|
|
|
* @param sysLocaleResource
|
|
|
|
|
* @param localeResource
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysLocaleResource(SysLocaleResource sysLocaleResource){
|
|
|
|
|
public static String packHqlSysLocaleResource(SysLocaleResource localeResource){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
//查询日期
|
|
|
|
|
// HqlPack.timeBuilder(sysLocaleResource.getCreateDateTimeStart(),sysLocaleResource.getCreateDateTimeEnd(),
|
|
|
|
|
// "createDateTime", result, false);
|
|
|
|
|
//数字类型封装
|
|
|
|
|
HqlPack.getNumEqualPack(sysLocaleResource.getResourceType(),"resourceType",result);
|
|
|
|
|
HqlPack.getNumEqualPack(localeResource.getResourceType(),"resourceType",result);
|
|
|
|
|
//字符串类型封装
|
|
|
|
|
HqlPack.getStringEqualPack(sysLocaleResource.getLanguageCode(),"languageCode",result);
|
|
|
|
|
HqlPack.getStringEqualPack(localeResource.getLanguageCode(),"languageCode",result);
|
|
|
|
|
//字符串类型封装
|
|
|
|
|
HqlPack.getStringLikerPack(sysLocaleResource.getResourceKey(),"resourceKey",result);
|
|
|
|
|
HqlPack.getStringLikerPack(localeResource.getResourceKey(),"resourceKey",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 语言
|
|
|
|
|
* @param lang
|
|
|
|
|
* @param localeLanguage
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysLocaleLanguage(SysLocaleLanguage lang) {
|
|
|
|
|
public static String packHqlSysLocaleLanguage(SysLocaleLanguage localeLanguage) {
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
//查询日期
|
|
|
|
|
// HqlPack.timeBuilder(lang.getCreateDateTimeStart(),lang.getCreateDateTimeEnd(),
|
|
|
|
|
// "createDateTime", result, false);
|
|
|
|
|
//字符串类型封装
|
|
|
|
|
HqlPack.getStringLikerPack(lang.getLanguageCode(),"languageCode",result);
|
|
|
|
|
HqlPack.getStringLikerPack(localeLanguage.getLanguageCode(),"languageCode",result);
|
|
|
|
|
//字符串类型封装
|
|
|
|
|
HqlPack.getStringLikerPack(lang.getLanguageName(),"languageName",result);
|
|
|
|
|
HqlPack.getStringLikerPack(localeLanguage.getLanguageName(),"languageName",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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 packHqlSysPosition(SysPosition position){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// 查询参数封装
|
|
|
|
@ -89,7 +104,7 @@ public class CoreHqlPack {
|
|
|
|
|
* @param organize
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlOrganize(Organize organize){
|
|
|
|
|
public static String packHqlSysOrganize(SysOrganize organize){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// 查询参数封装
|
|
|
|
@ -105,7 +120,7 @@ public class CoreHqlPack {
|
|
|
|
|
* @param department
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlDepartment(Department department){
|
|
|
|
|
public static String packHqlSysDepartment(SysDepartment department){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// 查询参数封装
|
|
|
|
@ -150,36 +165,36 @@ public class CoreHqlPack {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 系统参数复杂查询
|
|
|
|
|
* @param sysConfig
|
|
|
|
|
* @param config
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysConfig(SysConfig sysConfig) {
|
|
|
|
|
public static String packHqlSysConfig(SysConfig config) {
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// hql拼接
|
|
|
|
|
HqlPack.getStringLikerPack(sysConfig.getName(),"name",result);
|
|
|
|
|
HqlPack.getStringLikerPack(sysConfig.getConfigCode(),"configCode",result);
|
|
|
|
|
HqlPack.getNumEqualPack(sysConfig.getConfigTypeId(),"configTypeId",result);
|
|
|
|
|
HqlPack.getStringLikerPack(config.getName(),"name",result);
|
|
|
|
|
HqlPack.getStringLikerPack(config.getConfigCode(),"configCode",result);
|
|
|
|
|
HqlPack.getNumEqualPack(config.getConfigType(),"configTypeId",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 字典信息复杂查询
|
|
|
|
|
* @param sysDictionary
|
|
|
|
|
* @param dictionary
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysDictionary(SysDictionary sysDictionary) {
|
|
|
|
|
public static String packHqlSysDictionary(SysDictionary dictionary) {
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// hql拼接
|
|
|
|
|
HqlPack.getStringLikerPack(sysDictionary.getName(),"name",result);
|
|
|
|
|
HqlPack.getStringLikerPack(sysDictionary.getDictionaryCode(),"dictionaryCode",result);
|
|
|
|
|
HqlPack.getStringLikerPack(dictionary.getName(),"name",result);
|
|
|
|
|
HqlPack.getStringLikerPack(dictionary.getDictionaryCode(),"dictionaryCode",result);
|
|
|
|
|
// 默认查询非顶级字典
|
|
|
|
|
if(sysDictionary.getParentId() == null || sysDictionary.getParentId() < 1){
|
|
|
|
|
if(dictionary.getParentId() == null || dictionary.getParentId() < 1){
|
|
|
|
|
HqlPack.getNumNOEqualPack(CommonEnumUtil.PARENT.DEFAULT.getValue(),"parentId",result);
|
|
|
|
|
}
|
|
|
|
|
HqlPack.getNumEqualPack(sysDictionary.getParentId(),"parentId",result);
|
|
|
|
|
HqlPack.getNumEqualPack(dictionary.getParentId(),"parentId",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
@ -189,7 +204,7 @@ public class CoreHqlPack {
|
|
|
|
|
* @param toolType
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlToolType(ToolType toolType) {
|
|
|
|
|
public static String packHqlSysToolType(SysToolType toolType) {
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// hql拼接
|
|
|
|
@ -203,15 +218,15 @@ public class CoreHqlPack {
|
|
|
|
|
* @param tool
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlTool(Tool tool) {
|
|
|
|
|
public static String packHqlSysTool(SysTool tool) {
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// hql拼接
|
|
|
|
|
HqlPack.getStringLikerPack(tool.getName(),"name",result);
|
|
|
|
|
HqlPack.getNumEqualPack(tool.getToolTypeId(),"toolTypeId",result);
|
|
|
|
|
HqlPack.getNumEqualPack(tool.getToolStatusId(),"toolStatusId",result);
|
|
|
|
|
HqlPack.getNumEqualPack(tool.getToolDataTypeId(),"toolDataTypeId",result);
|
|
|
|
|
HqlPack.getNumEqualPack(tool.getToolConnTypeId(),"toolConnTypeId",result);
|
|
|
|
|
HqlPack.getNumEqualPack(tool.getToolStatus(),"toolStatus",result);
|
|
|
|
|
HqlPack.getNumEqualPack(tool.getToolDataType(),"toolDataType",result);
|
|
|
|
|
HqlPack.getNumEqualPack(tool.getToolConnType(),"toolConnType",result);
|
|
|
|
|
HqlPack.getStringLikerPack(tool.getToolIp(),"toolIp",result);
|
|
|
|
|
HqlPack.getNumLikerPack(tool.getToolPort(),"toolPort",result);
|
|
|
|
|
|
|
|
|
@ -220,37 +235,37 @@ public class CoreHqlPack {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 消息复杂查询
|
|
|
|
|
* @param sysMessage
|
|
|
|
|
* @param message
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysMessage(SysMessage sysMessage){
|
|
|
|
|
public static String packHqlSysMessage(SysMessage message){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// hql拼接
|
|
|
|
|
HqlPack.getStringLikerPack(sysMessage.getMessageTitle(),"messageTitle",result);
|
|
|
|
|
HqlPack.getStringLikerPack(sysMessage.getMessageContent(),"messageContent",result);
|
|
|
|
|
HqlPack.getStringLikerPack(message.getMessageTitle(),"messageTitle",result);
|
|
|
|
|
HqlPack.getStringLikerPack(message.getMessageContent(),"messageContent",result);
|
|
|
|
|
// HqlPack.getNumLikerPack(sysMessage.getMessageStatusId(),"messageStatusId",result);
|
|
|
|
|
// HqlPack.getNumLikerPack(sysMessage.getMessageTypeId(),"messageTypeId",result);
|
|
|
|
|
// HqlPack.getNumEqualPack(sysMessage.getMessageRecipientId(),"messageRecipientId",result);
|
|
|
|
|
// HqlPack.getNumEqualPack(sysMessage.getMessageSendId(),"messageSendId",result);
|
|
|
|
|
HqlPack.timeBuilder(sysMessage.getCreateDatetime(),"createDatetime", result, false,false);
|
|
|
|
|
HqlPack.timeBuilder(message.getCreateDatetime(),"createDatetime", result, false,false);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 文件资源复杂查询
|
|
|
|
|
* @param sysFile
|
|
|
|
|
* @param file
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysFile(SysFile sysFile) {
|
|
|
|
|
public static String packHqlSysFile(SysFile file) {
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// hql拼接
|
|
|
|
|
HqlPack.getStringLikerPack(sysFile.getName(),"name",result);
|
|
|
|
|
HqlPack.getNumEqualPack(sysFile.getFileTypeId(),"fileTypeId",result);
|
|
|
|
|
HqlPack.getStringLikerPack(sysFile.getCreateUser(),"createUser",result);
|
|
|
|
|
HqlPack.timeBuilder(sysFile.getCreateDatetime(),"createDatetime",result,false,false);
|
|
|
|
|
HqlPack.getStringLikerPack(file.getName(),"name",result);
|
|
|
|
|
HqlPack.getNumEqualPack(file.getFileTypeId(),"fileTypeId",result);
|
|
|
|
|
HqlPack.getStringLikerPack(file.getCreateUser(),"createUser",result);
|
|
|
|
|
HqlPack.timeBuilder(file.getCreateDatetime(),"createDatetime",result,false,false);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
@ -260,7 +275,7 @@ public class CoreHqlPack {
|
|
|
|
|
* @param taskTimeExpression
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlTaskTimeExpression(TaskTimeExpression taskTimeExpression) {
|
|
|
|
|
public static String packHqlSysTaskTimeExpression(SysTaskTimeExpression taskTimeExpression) {
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// hql拼接
|
|
|
|
@ -274,7 +289,7 @@ public class CoreHqlPack {
|
|
|
|
|
* @param taskTime
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlTaskTime(TaskTime taskTime){
|
|
|
|
|
public static String packHqlSysTaskTime(SysTaskTime taskTime){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// hql拼接
|
|
|
|
@ -308,16 +323,16 @@ public class CoreHqlPack {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询字典代码是否重复
|
|
|
|
|
* @param sysDictionary
|
|
|
|
|
* @param dictionary
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysDictionaryCode(SysDictionary sysDictionary){
|
|
|
|
|
public static String packHqlSysDictionaryCode(SysDictionary dictionary){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
// and
|
|
|
|
|
HqlPack.getStringEqualPack(sysDictionary.getDictionaryCode(),"dictionaryCode",result);
|
|
|
|
|
HqlPack.getStringEqualPack(dictionary.getDictionaryCode(),"dictionaryCode",result);
|
|
|
|
|
// not
|
|
|
|
|
HqlPack.getNumNOEqualPack(sysDictionary.getId(),"id",result);
|
|
|
|
|
HqlPack.getNumNOEqualPack(dictionary.getId(),"id",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
@ -344,29 +359,29 @@ public class CoreHqlPack {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询语言代码是否重复
|
|
|
|
|
* @param sysLocaleLanguage
|
|
|
|
|
* @param localeLanguage
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysLocaleLanguageCode(SysLocaleLanguage sysLocaleLanguage){
|
|
|
|
|
public static String packHqlSysLocaleLanguageCode(SysLocaleLanguage localeLanguage){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
HqlPack.getStringEqualPack(sysLocaleLanguage.getLanguageCode(),"languageCode",result);
|
|
|
|
|
HqlPack.getNumNOEqualPack(sysLocaleLanguage.getId(),"id",result);
|
|
|
|
|
HqlPack.getStringEqualPack(localeLanguage.getLanguageCode(),"languageCode",result);
|
|
|
|
|
HqlPack.getNumNOEqualPack(localeLanguage.getId(),"id",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 检查系统资源是否重复
|
|
|
|
|
* @param sysLocaleResource
|
|
|
|
|
* @param localeResource
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static String packHqlSysLocaleResourceKey(SysLocaleResource sysLocaleResource){
|
|
|
|
|
public static String packHqlSysLocaleResourceKey(SysLocaleResource localeResource){
|
|
|
|
|
StringBuffer result = new StringBuffer();
|
|
|
|
|
|
|
|
|
|
HqlPack.getStringEqualPack(sysLocaleResource.getLanguageCode(),"languageCode",result);
|
|
|
|
|
HqlPack.getStringEqualPack(sysLocaleResource.getResourceKey(),"resourceKey",result);
|
|
|
|
|
HqlPack.getNumNOEqualPack(sysLocaleResource.getId(),"id",result);
|
|
|
|
|
HqlPack.getStringEqualPack(localeResource.getLanguageCode(),"languageCode",result);
|
|
|
|
|
HqlPack.getStringEqualPack(localeResource.getResourceKey(),"resourceKey",result);
|
|
|
|
|
HqlPack.getNumNOEqualPack(localeResource.getId(),"id",result);
|
|
|
|
|
|
|
|
|
|
return result.toString();
|
|
|
|
|
}
|
|
|
|
|