代码拉取完成,页面将自动刷新
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
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。