修改判断条件
This commit is contained in:
@@ -125,7 +125,7 @@ public class AdminDao {
|
||||
try {
|
||||
Connection conn = JdbcUtils.getConnection();
|
||||
QueryRunner runner = new QueryRunner();
|
||||
String sql="select * from admin where isValid = 1";
|
||||
String sql="select * from admin";
|
||||
adminEntityList = runner.query(conn,sql,new BeanListHandler<>(adminEntity.class));
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@@ -64,7 +64,7 @@ public class UserDao {
|
||||
connection = JdbcUtils.getConnection();
|
||||
// sql语句写的操作 ----加上事务
|
||||
JdbcUtils.beginTransaction(connection); // 开启事务
|
||||
String insertSql = "INSERT INTO `user` (`userId`, `userName`, `userPassword`,`creatTime`,`isValid`,projectNum,contributionValue,userLevel,userAvatar) VALUES (null, ?, ?,?,1,0,0,1,'E://Desktop//helloGithub//web//uploadFile//69e56c15-20d5-43a4-916b-1d6230a33b8e_default.png');";
|
||||
String insertSql = "INSERT INTO `user` (`userId`, `userName`, `userPassword`,`creatTime`,`isValid`,projectNum,contributionValue,userLevel,userAvatar) VALUES (null, ?, ?,?,1,0,0,1,'\\\\helloGithub\\\\web\\\\uploadFile\\\\69e56c15-20d5-43a4-916b-1d6230a33b8e_default.png');";
|
||||
preparedStatement = connection.prepareStatement(insertSql);
|
||||
preparedStatement.setString(1, userName);
|
||||
preparedStatement.setString(2, userPwd);
|
||||
@@ -388,7 +388,7 @@ public class UserDao {
|
||||
try {
|
||||
Connection conn = JdbcUtils.getConnection();
|
||||
QueryRunner runner = new QueryRunner();
|
||||
String sql="select * from user where isValid = 1";
|
||||
String sql="select * from user ";
|
||||
userEntityList = runner.query(conn,sql,new BeanListHandler<>(userEntity.class));
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@@ -220,7 +220,7 @@ public class articleDao {
|
||||
try {
|
||||
Connection conn = JdbcUtils.getConnection();
|
||||
QueryRunner runner = new QueryRunner();
|
||||
String sql="select * from article where isValid = 1";
|
||||
String sql="select * from article";
|
||||
articleEntityList = runner.query(conn,sql,new BeanListHandler<>(articleEntity.class));
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@@ -54,7 +54,7 @@ public class categoryDao {
|
||||
try {
|
||||
Connection conn = JdbcUtils.getConnection();
|
||||
QueryRunner runner = new QueryRunner();
|
||||
String sql="select * from category where isValid = 1";
|
||||
String sql="select * from category ";
|
||||
categoryEntityList = runner.query(conn,sql,new BeanListHandler<>(categoryEntity.class));
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@@ -114,7 +114,7 @@ public class commentDao {
|
||||
try {
|
||||
Connection conn = JdbcUtils.getConnection();
|
||||
QueryRunner runner = new QueryRunner();
|
||||
String sql="select * from comment where isValid = 1";
|
||||
String sql="select * from comment ";
|
||||
commentEntityList = runner.query(conn,sql,new BeanListHandler<>(commentEntity.class));
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@@ -341,7 +341,7 @@ public class projectDao {
|
||||
try {
|
||||
Connection conn = JdbcUtils.getConnection();
|
||||
QueryRunner runner = new QueryRunner();
|
||||
String sql="select * from project where isValid = 1";
|
||||
String sql="select * from project ";
|
||||
projectEntityList = runner.query(conn,sql,new BeanListHandler<>(projectEntity.class));
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
Reference in New Issue
Block a user