@@ -0,0 +1,1384 @@
+package net.ihypo.task;%0A%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0A%0Aimport net.ihypo.db.DbDriver;%0A%0Aimport com.mysql.jdbc.Statement;%0A%0Apublic class TaskFactory %7B%0A%09static public void finashWork(int taskId) throws ClassNotFoundException, SQLException%7B%0A%09%09Statement statement = (Statement) new DbDriver().getConnection().createStatement();%0A%09%09System.out.println(%22select task_unfinash from tasks where task_id = %22 + taskId + %22;%22);%0A%09%09ResultSet set = statement.executeQuery(%22select task_unfinash from tasks where task_id = %22 + taskId + %22;%22);%0A%09%09if(set.next())%7B%0A%09%09%09int unFinash = set.getInt(%22task_unfinash%22) - 1;%0A%09%09%09if(unFinash %3C 0)%0A%09%09%09%09unFinash = 0;%0A%09%09%09System.out.println(%22update tasks set task_unfinash = %22 + unFinash + %22 where task_id = %22 + taskId + %22;%22);%0A%09%09%09statement.execute(%22update tasks set task_unfinash = %22 + unFinash + %22 where task_id = %22 + taskId + %22;%22);%0A%09%09%7D%0A%09%7D%0A%09static public void unFinashWork(int taskId) throws ClassNotFoundException, SQLException%7B%0A%09%09Statement statement = (Statement) new DbDriver().getConnection().createStatement();%0A%09%09ResultSet set = statement.executeQuery(%22select task_unfinash from tasks where task_id = %22 + taskId + %22;%22);%0A%09%09if(set.next())%7B%0A%09%09%09int unFinash = set.getInt(%22task_unfinash%22) + 1;%0A%09%09%09if(unFinash %3C 0)%0A%09%09%09%09unFinash = 0;%0A%09%09%09statement.execute(%22update tasks set task_unfinash = %22 + unFinash + %22 where task_id = %22 + taskId + %22;%22);%0A%09%09%7D%0A%09%7D%0A%7D%0A

add a function can conut the num of work unfinash