| | |
| | | /// <summary> |
| | | /// 根据ID集合查询 |
| | | /// </summary> |
| | | public static List<SysTask> selectByIds(List<int> ids) |
| | | public static List<SysTask> SelectByIds(List<int> ids) |
| | | { |
| | | string sql = string.Format("select * from lf.sys_task where id in ({0}) order by id desc", string.Join(",", ids.ToArray())); |
| | | |
| | |
| | | /// <summary> |
| | | /// 插入任务 |
| | | /// </summary> |
| | | public static int insert(SysTask task) |
| | | public static int Insert(SysTask task) |
| | | { |
| | | string sql = "insert into lf.sys_task (name, status, type, descr, err, ip, pid, gids, depcode, dircode, create_user) values (@name, @status, @type, @descr, @err, @ip, @pid, @gids, @depcode, @dircode, @create_user)"; |
| | | |
| | | List<DbParameter> list = Tools.GetParams<SysTask>(sql, task); |
| | | |
| | | object obj = Tools.DBHelper.GetScalar(sql, list.ToArray()); |
| | | |
| | | return obj == null ? 0 : Convert.ToInt32(obj); |
| | |
| | | /// <summary> |
| | | /// 更新任务 |
| | | /// </summary> |
| | | public static int update(SysTask task) |
| | | public static int Update(SysTask task) |
| | | { |
| | | string sql = "update lf.sys_task set name=@name, status=@status, type=@type, descr=@descr, err=@err, ip=@ip, pid=@pid, gids=@gids, depcode=@depcode, dircode=@dircode, update_user=@update_user, update_time=now() where id=@id"; |
| | | |
| | | List<DbParameter> list = Tools.GetParams<SysTask>(sql, task); |
| | | |
| | | object obj = Tools.DBHelper.GetScalar(sql, list.ToArray()); |
| | | |
| | | return obj == null ? 0 : Convert.ToInt32(obj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 创建任务实体类 |
| | | /// </summary> |
| | | public static SysTask CreateTask(XYZArgs args, SysMeta meta) |
| | | { |
| | | SysTask task = new SysTask(); |
| | | // |
| | | |
| | | |
| | | |
| | | return task; |
| | | } |
| | | } |
| | | } |