public List <Record> selectListByAll(string id, string seriesNum, string operatorName, DateTime startTime, DateTime endTime) { string query_string = "SELECT * from `t_record` where isDel=0"; if (id != "") { query_string = query_string + " and id='" + id + "'"; } if (operatorName != "") { query_string = query_string + " and operator='" + operatorName + "'"; } if (seriesNum != "") { query_string = query_string + " and seriesNum='" + seriesNum + "'"; } if (startTime.Year != 1) { query_string = query_string + " and createTime>='" + startTime.ToString("yyyy-MM-dd HH:mm:ss") + "'"; } if (endTime.Year != 1) { query_string = query_string + " and createTime<='" + endTime.ToString("yyyy-MM-dd HH:mm:ss") + "'"; } DataTable dt = MysqlTool.queryData(query_string, new MySqlParameter[] { new MySqlParameter() }); List <Record> ls = MysqlTool.toList <Record>(dt); return(ls.Count > 0 ? ls : null); }
public List <RecordDetail> selectListByRecordId(string recordId) { string query_string = "SELECT * from `t_record_detail` where recordId=@recordId and isDel=0 order by `index`"; DataTable dt = MysqlTool.queryData(query_string, new MySqlParameter[] { new MySqlParameter("@recordId", recordId) }); List <RecordDetail> ls = MysqlTool.toList <RecordDetail>(dt); return(ls.Count > 0 ? ls : null); }
public Technology selectOneByProductId(string productId) { string query_string = "SELECT * FROM t_technology WHERE id = ( SELECT techId FROM `t_product` WHERE id = @id and isDel=0) and isDel=0"; DataTable dt = MysqlTool.queryData(query_string, new MySqlParameter[] { new MySqlParameter("@id", productId) }); Technology tech = null; if (dt.Rows.Count > 0) { tech = new Technology(dt.Rows[0]["id"].ToString(), Int32.Parse(dt.Rows[0]["mode"].ToString()), dt.Rows[0]["version"].ToString(), dt.Rows[0]["proId"].ToString()); } return(tech); }
public Technology selectOne(string id) { string query_string = "SELECT `id`, `mode`, `version`,`proId` FROM t_technology WHERE id=@id and isDel=0"; DataTable dt = MysqlTool.queryData(query_string, new MySqlParameter[] { new MySqlParameter("@id", id) }); Technology tech = null; if (dt.Rows.Count > 0) { tech = new Technology(dt.Rows[0]["id"].ToString(), Int32.Parse(dt.Rows[0]["mode"].ToString()), dt.Rows[0]["version"].ToString(), dt.Rows[0]["proId"].ToString()); } return(tech); }
public List <string> selectUserNameList(DateTime startTime, DateTime endTime) { string query_string = "SELECT distinct operator from `t_record` where isDel=0"; if (startTime.Year != 1) { query_string = query_string + " and createTime>='" + startTime.ToString("yyyy-MM-dd HH:mm:ss") + "'"; } if (endTime.Year != 1) { query_string = query_string + " and createTime<='" + endTime.ToString("yyyy-MM-dd HH:mm:ss") + "'"; } DataTable dt = MysqlTool.queryData(query_string, new MySqlParameter[] { new MySqlParameter() }); List <string> ls = new List <string>(); for (int i = 0; i < dt.Rows.Count; i++) { ls.Add(dt.Rows[i]["operator"].ToString()); } return(ls.Count > 0 ? ls : null); }