fix: 查询like使用字符串拼接替代concat

This commit is contained in:
TsMask
2025-03-05 17:39:01 +08:00
parent 4e788497d7
commit 0c83bcecc6
25 changed files with 83 additions and 66 deletions

View File

@@ -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)