修改判断条件

This commit is contained in:
cyk
2023-07-10 11:01:33 +08:00
parent af7f16c43b
commit 76f4602bca
6 changed files with 7 additions and 7 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);