Merge remote-tracking branch 'origin/lichang' into lite
This commit is contained in:
@@ -21,13 +21,13 @@ func (r SysConfig) SelectByPage(query map[string]string) ([]model.SysConfig, int
|
||||
tx = tx.Where("del_flag = '0'")
|
||||
// 查询条件拼接
|
||||
if v, ok := query["configName"]; ok && v != "" {
|
||||
tx = tx.Where("config_name like concat(?, '%')", v)
|
||||
tx = tx.Where("config_name like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["configType"]; ok && v != "" {
|
||||
tx = tx.Where("config_type = ?", v)
|
||||
}
|
||||
if v, ok := query["configKey"]; ok && v != "" {
|
||||
tx = tx.Where("config_key like concat(?, '%')", v)
|
||||
tx = tx.Where("config_key like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["beginTime"]; ok && v != "" {
|
||||
if len(v) == 10 {
|
||||
@@ -72,13 +72,13 @@ func (r SysConfig) Select(sysConfig model.SysConfig) []model.SysConfig {
|
||||
tx = tx.Where("del_flag = '0'")
|
||||
// 查询条件拼接
|
||||
if sysConfig.ConfigName != "" {
|
||||
tx = tx.Where("config_name like concat(?, '%')", sysConfig.ConfigName)
|
||||
tx = tx.Where("config_name like ?", fmt.Sprintf("%s%%", sysConfig.ConfigName))
|
||||
}
|
||||
if sysConfig.ConfigType != "" {
|
||||
tx = tx.Where("config_type = ?", sysConfig.ConfigType)
|
||||
}
|
||||
if sysConfig.ConfigKey != "" {
|
||||
tx = tx.Where("config_key like concat(?, '%')", sysConfig.ConfigKey)
|
||||
tx = tx.Where("config_key like ?", fmt.Sprintf("%s%%", sysConfig.ConfigKey))
|
||||
}
|
||||
if sysConfig.CreateTime > 0 {
|
||||
tx = tx.Where("create_time >= ?", sysConfig.CreateTime)
|
||||
|
||||
@@ -28,7 +28,7 @@ func (r SysDept) Select(sysDept model.SysDept, dataScopeSQL string) []model.SysD
|
||||
tx = tx.Where("parent_id = ?", sysDept.ParentId)
|
||||
}
|
||||
if sysDept.DeptName != "" {
|
||||
tx = tx.Where("dept_name like concat(?, '%')", sysDept.DeptName)
|
||||
tx = tx.Where("dept_name like ?", fmt.Sprintf("%s%%", sysDept.DeptName))
|
||||
}
|
||||
if sysDept.StatusFlag != "" {
|
||||
tx = tx.Where("status_flag = ?", sysDept.StatusFlag)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"be.ems/src/framework/database/db"
|
||||
@@ -23,7 +24,7 @@ func (r SysDictData) SelectByPage(query map[string]string) ([]model.SysDictData,
|
||||
tx = tx.Where("dict_type = ?", v)
|
||||
}
|
||||
if v, ok := query["dataLabel"]; ok && v != "" {
|
||||
tx = tx.Where("data_label like concat(?, '%')", v)
|
||||
tx = tx.Where("data_label like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["statusFlag"]; ok && v != "" {
|
||||
tx = tx.Where("status_flag = ?", v)
|
||||
@@ -55,7 +56,7 @@ func (r SysDictData) Select(sysDictData model.SysDictData) []model.SysDictData {
|
||||
tx = tx.Where("del_flag = '0'")
|
||||
// 查询条件拼接
|
||||
if sysDictData.DataLabel != "" {
|
||||
tx = tx.Where("data_label like concat(?, '%')", sysDictData.DataLabel)
|
||||
tx = tx.Where("data_label like ?", fmt.Sprintf("%s%%", sysDictData.DataLabel))
|
||||
}
|
||||
if sysDictData.DictType != "" {
|
||||
tx = tx.Where("dict_type = ?", sysDictData.DictType)
|
||||
|
||||
@@ -21,10 +21,10 @@ func (r SysDictType) SelectByPage(query map[string]string) ([]model.SysDictType,
|
||||
tx = tx.Where("del_flag = '0'")
|
||||
// 查询条件拼接
|
||||
if v, ok := query["dictName"]; ok && v != "" {
|
||||
tx = tx.Where("dict_name like concat(?, '%')", v)
|
||||
tx = tx.Where("dict_name like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["dictType"]; ok && v != "" {
|
||||
tx = tx.Where("dict_type like concat(?, '%')", v)
|
||||
tx = tx.Where("dict_type like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["statusFlag"]; ok && v != "" {
|
||||
tx = tx.Where("status_flag = ?", v)
|
||||
@@ -72,10 +72,10 @@ func (r SysDictType) Select(sysDictType model.SysDictType) []model.SysDictType {
|
||||
tx = tx.Where("del_flag = '0'")
|
||||
// 查询条件拼接
|
||||
if sysDictType.DictName != "" {
|
||||
tx = tx.Where("dict_name like concat(?, '%')", sysDictType.DictName)
|
||||
tx = tx.Where("dict_name like ?", fmt.Sprintf("%s%%", sysDictType.DictName))
|
||||
}
|
||||
if sysDictType.DictType != "" {
|
||||
tx = tx.Where("dict_type like concat(?, '%')", sysDictType.DictType)
|
||||
tx = tx.Where("dict_type like ?", fmt.Sprintf("%s%%", sysDictType.DictType))
|
||||
}
|
||||
if sysDictType.StatusFlag != "" {
|
||||
tx = tx.Where("status_flag = ?", sysDictType.StatusFlag)
|
||||
|
||||
@@ -20,10 +20,10 @@ func (r SysLogLogin) SelectByPage(query map[string]string, dataScopeSQL string)
|
||||
tx := db.DB("").Model(&model.SysLogLogin{})
|
||||
// 查询条件拼接
|
||||
if v, ok := query["loginIp"]; ok && v != "" {
|
||||
tx = tx.Where("login_ip like concat(?, '%')", v)
|
||||
tx = tx.Where("login_ip like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["userName"]; ok && v != "" {
|
||||
tx = tx.Where("user_name like concat(?, '%')", v)
|
||||
tx = tx.Where("user_name like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["statusFlag"]; ok && v != "" {
|
||||
tx = tx.Where("status_flag = ?", v)
|
||||
|
||||
@@ -20,16 +20,16 @@ func (r SysLogOperate) SelectByPage(query map[string]string, dataScopeSQL string
|
||||
tx := db.DB("").Model(&model.SysLogOperate{})
|
||||
// 查询条件拼接
|
||||
if v, ok := query["title"]; ok && v != "" {
|
||||
tx = tx.Where("title like concat(?, '%')", v)
|
||||
tx = tx.Where("title like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["businessType"]; ok && v != "" {
|
||||
tx = tx.Where("business_type = ?", v)
|
||||
}
|
||||
if v, ok := query["operaBy"]; ok && v != "" {
|
||||
tx = tx.Where("opera_by like concat(?, '%')", v)
|
||||
tx = tx.Where("opera_by like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["operaIp"]; ok && v != "" {
|
||||
tx = tx.Where("opera_ip like concat(?, '%')", v)
|
||||
tx = tx.Where("opera_ip like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["statusFlag"]; ok && v != "" {
|
||||
tx = tx.Where("status_flag = ?", v)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"be.ems/src/framework/constants"
|
||||
@@ -21,7 +22,7 @@ func (r SysMenu) Select(sysMenu model.SysMenu, userId int64) []model.SysMenu {
|
||||
tx = tx.Where("del_flag = '0'")
|
||||
// 查询条件拼接
|
||||
if sysMenu.MenuName != "" {
|
||||
tx = tx.Where("menu_name like concat(?, '%')", sysMenu.MenuName)
|
||||
tx = tx.Where("menu_name like ?", fmt.Sprintf("%s%%", sysMenu.MenuName))
|
||||
}
|
||||
if sysMenu.VisibleFlag != "" {
|
||||
tx = tx.Where("visible_flag = ?", sysMenu.VisibleFlag)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"be.ems/src/framework/database/db"
|
||||
@@ -20,10 +21,10 @@ func (r SysPost) SelectByPage(query map[string]string) ([]model.SysPost, int64)
|
||||
tx = tx.Where("del_flag = '0'")
|
||||
// 查询条件拼接
|
||||
if v, ok := query["postCode"]; ok && v != "" {
|
||||
tx = tx.Where("post_code like concat(?, '%')", v)
|
||||
tx = tx.Where("post_code like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["postName"]; ok && v != "" {
|
||||
tx = tx.Where("post_name like concat(?, '%')", v)
|
||||
tx = tx.Where("post_name like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["statusFlag"]; ok && v != "" {
|
||||
tx = tx.Where("status_flag = ?", v)
|
||||
@@ -55,10 +56,10 @@ func (r SysPost) Select(sysPost model.SysPost) []model.SysPost {
|
||||
tx = tx.Where("del_flag = '0'")
|
||||
// 查询条件拼接
|
||||
if sysPost.PostCode != "" {
|
||||
tx = tx.Where("post_code like concat(?, '%')", sysPost.PostCode)
|
||||
tx = tx.Where("post_code like ?", fmt.Sprintf("%s%%", sysPost.PostCode))
|
||||
}
|
||||
if sysPost.PostName != "" {
|
||||
tx = tx.Where("post_name like concat(?, '%')", sysPost.PostName)
|
||||
tx = tx.Where("post_name like ?", fmt.Sprintf("%s%%", sysPost.PostName))
|
||||
}
|
||||
if sysPost.StatusFlag != "" {
|
||||
tx = tx.Where("status_flag = ?", sysPost.StatusFlag)
|
||||
|
||||
@@ -21,10 +21,10 @@ func (r SysRole) SelectByPage(query map[string]string) ([]model.SysRole, int64)
|
||||
tx = tx.Where("del_flag = '0' and role_id > 1")
|
||||
// 查询条件拼接
|
||||
if v, ok := query["roleName"]; ok && v != "" {
|
||||
tx = tx.Where("role_name like concat(?, '%')", v)
|
||||
tx = tx.Where("role_name like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["roleKey"]; ok && v != "" {
|
||||
tx = tx.Where("role_key like concat(?, '%')", v)
|
||||
tx = tx.Where("role_key like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["statusFlag"]; ok && v != "" {
|
||||
tx = tx.Where("status_flag = ?", v)
|
||||
@@ -78,10 +78,10 @@ func (r SysRole) Select(sysRole model.SysRole) []model.SysRole {
|
||||
tx = tx.Where("del_flag = '0'")
|
||||
// 查询条件拼接
|
||||
if sysRole.RoleKey != "" {
|
||||
tx = tx.Where("role_key like concat(?, '%')", sysRole.RoleKey)
|
||||
tx = tx.Where("role_key like ?", fmt.Sprintf("%s%%", sysRole.RoleKey))
|
||||
}
|
||||
if sysRole.RoleName != "" {
|
||||
tx = tx.Where("role_name like concat(?, '%')", sysRole.RoleName)
|
||||
tx = tx.Where("role_name like ?", fmt.Sprintf("%s%%", sysRole.RoleName))
|
||||
}
|
||||
if sysRole.StatusFlag != "" {
|
||||
tx = tx.Where("status_flag = ?", sysRole.StatusFlag)
|
||||
|
||||
@@ -26,10 +26,10 @@ func (r SysUser) SelectByPage(query map[string]string, dataScopeSQL string) ([]m
|
||||
tx = tx.Where("user_id = ?", v)
|
||||
}
|
||||
if v, ok := query["userName"]; ok && v != "" {
|
||||
tx = tx.Where("user_name like concat(?, '%')", v)
|
||||
tx = tx.Where("user_name like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["phone"]; ok && v != "" {
|
||||
tx = tx.Where("phone like concat(?, '%')", v)
|
||||
tx = tx.Where("phone like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["statusFlag"]; ok && v != "" {
|
||||
tx = tx.Where("status_flag = ?", v)
|
||||
@@ -85,10 +85,10 @@ func (r SysUser) Select(sysUser model.SysUser) []model.SysUser {
|
||||
tx = tx.Where("del_flag = '0'")
|
||||
// 查询条件拼接
|
||||
if sysUser.UserName != "" {
|
||||
tx = tx.Where("user_name like concat(?, '%')", sysUser.UserName)
|
||||
tx = tx.Where("user_name like ?", fmt.Sprintf("%s%%", sysUser.UserName))
|
||||
}
|
||||
if sysUser.Phone != "" {
|
||||
tx = tx.Where("phone like concat(?, '%')", sysUser.Phone)
|
||||
tx = tx.Where("phone like ?", fmt.Sprintf("%s%%", sysUser.Phone))
|
||||
}
|
||||
if sysUser.StatusFlag != "" {
|
||||
tx = tx.Where("status_flag = ?", sysUser.StatusFlag)
|
||||
@@ -229,10 +229,10 @@ func (r SysUser) SelectAuthUsersByPage(query map[string]string, dataScopeSQL str
|
||||
tx = tx.Where("del_flag = '0'")
|
||||
// 查询条件拼接
|
||||
if v, ok := query["userName"]; ok && v != "" {
|
||||
tx = tx.Where("user_name like concat(?, '%')", v)
|
||||
tx = tx.Where("user_name like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["phone"]; ok && v != "" {
|
||||
tx = tx.Where("phone like concat(?, '%')", v)
|
||||
tx = tx.Where("phone like ?", fmt.Sprintf("%s%%", v))
|
||||
}
|
||||
if v, ok := query["statusFlag"]; ok && v != "" {
|
||||
tx = tx.Where("status_flag = ?", v)
|
||||
|
||||
Reference in New Issue
Block a user