def mydelete(self, user_id): sql = mybatis_mapper2sql.get_child_statement(self.mapper, "delete") MyLog().getLogger().debug(sql) self.cs.execute(sql, (user_id, )) self.conn.commit() cnt = self.cs.rowcount return cnt
def myupdate(self,survey_id, title, content, interview_cnt, deadline, in_date, in_user_id, up_date, up_user_id): sql = mybatis_mapper2sql.get_child_statement(self.mapper, "update") MyLog().getLogger().debug(sql) self.cs.execute(sql, (title, content, interview_cnt, deadline, up_user_id, survey_id)) self.conn.commit() cnt = self.cs.rowcount return cnt
def myselect(self): sql = mybatis_mapper2sql.get_child_statement(self.mapper, "select") MyLog().getLogger().debug(sql) rs = self.cs.execute(sql) list = [] for record in rs: list.append({'survey_id':record[0],'title':record[1],'content':record[2],'interview_cnt':record[3],'deadline':record[4], 'in_date':record[5],'in_user_id':record[6],'up_date':record[7],'up_user_id':record[8]}) return list
def myupdate(self, user_id, pwd, user_name, mobile, email, birth, in_date, in_user_id, up_date, up_user_id): sql = mybatis_mapper2sql.get_child_statement(self.mapper, "update") MyLog().getLogger().debug(sql) self.cs.execute( sql, (pwd, user_name, mobile, email, birth, up_user_id, user_id)) self.conn.commit() cnt = self.cs.rowcount return cnt
def myselect(self): sql = mybatis_mapper2sql.get_child_statement(self.mapper, "select") MyLog().getLogger().debug(sql) rs = self.cs.execute(sql) list = [] for record in rs: list.append({ 'user_id': record[0], 'pwd': record[1], 'user_name': record[2], 'mobile': record[3], 'email': record[4], 'birth': record[5], 'in_date': record[6], 'in_user_id': record[7], 'up_date': record[8], 'up_user_id': record[9] }) return list