2 Star 0 Fork 0

403716045/gcore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
DeviceModelDao.go 966 Bytes
一键复制 编辑 原始数据 按行查看 历史
xingang 提交于 2023-02-17 18:37 +08:00 . 重构
package dao
import (
"gitee.com/lv_baobao/gcore/dbUtils"
"gitee.com/lv_baobao/gcore/helper"
"gitee.com/lv_baobao/gcore/testing/models"
)
type DeviceModelDao struct {
*dbUtils.BaseDao
}
func NewDeviceModelDao() *DeviceModelDao {
return &DeviceModelDao{
BaseDao: &dbUtils.BaseDao{
TableName: "DeviceModel",
},
}
}
func (this *DeviceModelDao) SearchPageList(pageIndex int, pageSize int, manufactorId int) *helper.QueryResult {
var res = new(helper.QueryResult)
var list = make([]models.DeviceModel, 0)
return this.Queryable().OrderByDesc("ModelId").WhereIf("and manufactorId=?", manufactorId, manufactorId > 0).Page(pageIndex, pageSize, &list)
return res
}
func (this *DeviceModelDao) Delete(id int64) bool {
this.Queryable().Where("and modelId=?", id).Delete()
return true
}
func (this *DeviceModelDao) GetAll() []models.DeviceModel {
deviceModels := make([]models.DeviceModel, 0)
this.Queryable().List(&deviceModels)
return deviceModels
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/lv_baobao/gcore.git
git@gitee.com:lv_baobao/gcore.git
lv_baobao
gcore
gcore
3bf2efb9b087

搜索帮助