Commit b4418eed authored by shiyu's avatar shiyu

后台新增用户

parent 535f55bf
...@@ -11,6 +11,7 @@ import org.springframework.util.StringUtils; ...@@ -11,6 +11,7 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
...@@ -57,7 +58,7 @@ public class DtsAdminDaoImpl implements DtsAdminDao { ...@@ -57,7 +58,7 @@ public class DtsAdminDaoImpl implements DtsAdminDao {
@Override @Override
public int updateById(Admin admin) { public int updateById(Admin admin) {
admin.setUpdateTime(LocalDateTime.now()); admin.setUpdateTime(new Date());
return adminMapper.updateByPrimaryKeySelective(admin); return adminMapper.updateByPrimaryKeySelective(admin);
} }
...@@ -68,8 +69,9 @@ public class DtsAdminDaoImpl implements DtsAdminDao { ...@@ -68,8 +69,9 @@ public class DtsAdminDaoImpl implements DtsAdminDao {
@Override @Override
public void add(Admin admin) { public void add(Admin admin) {
admin.setAddTime(LocalDateTime.now()); Date now = new Date();
admin.setUpdateTime(LocalDateTime.now()); admin.setAddTime(now);
admin.setUpdateTime(now);
adminMapper.insertSelective(admin); adminMapper.insertSelective(admin);
} }
......
...@@ -6,49 +6,19 @@ import java.util.List; ...@@ -6,49 +6,19 @@ import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
public interface AdminMapper { public interface AdminMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
*/
long countByExample(AdminExample example); long countByExample(AdminExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
*/
int deleteByExample(AdminExample example); int deleteByExample(AdminExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
*/
int insert(Admin record); int insert(Admin record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
*/
int insertSelective(Admin record); int insertSelective(Admin record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin * This method corresponds to the database table admin
* *
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
...@@ -57,7 +27,7 @@ public interface AdminMapper { ...@@ -57,7 +27,7 @@ public interface AdminMapper {
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin * This method corresponds to the database table admin
* *
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
...@@ -66,82 +36,46 @@ public interface AdminMapper { ...@@ -66,82 +36,46 @@ public interface AdminMapper {
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin * This method corresponds to the database table admin
* *
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
List<Admin> selectByExampleSelective(@Param("example") AdminExample example, @Param("selective") Admin.Column ... selective); List<Admin> selectByExampleSelective(@Param("example") AdminExample example, @Param("selective") Admin.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
*/
List<Admin> selectByExample(AdminExample example); List<Admin> selectByExample(AdminExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin * This method corresponds to the database table admin
* *
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
Admin selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") Admin.Column ... selective); Admin selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") Admin.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
*/
Admin selectByPrimaryKey(Integer id); Admin selectByPrimaryKey(Integer id);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin * This method corresponds to the database table admin
* *
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
Admin selectByPrimaryKeyWithLogicalDelete(@Param("id") Integer id, @Param("andLogicalDeleted") boolean andLogicalDeleted); Admin selectByPrimaryKeyWithLogicalDelete(@Param("id") Integer id, @Param("andLogicalDeleted") boolean andLogicalDeleted);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example); int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
*/
int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example); int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(Admin record); int updateByPrimaryKeySelective(Admin record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin
*
* @mbg.generated
*/
int updateByPrimaryKey(Admin record); int updateByPrimaryKey(Admin record);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin * This method corresponds to the database table admin
* *
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
...@@ -150,7 +84,7 @@ public interface AdminMapper { ...@@ -150,7 +84,7 @@ public interface AdminMapper {
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_admin * This method corresponds to the database table admin
* *
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment