Commit e0fe1f97 authored by shiyu's avatar shiyu

类目新增字段

parent be9309db
...@@ -14,6 +14,7 @@ import javax.annotation.Resource; ...@@ -14,6 +14,7 @@ import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
@Service @Service
...@@ -94,7 +95,7 @@ public class CategoryDaoImpl implements CategoryDao { ...@@ -94,7 +95,7 @@ public class CategoryDaoImpl implements CategoryDao {
} }
public int updateById(Category category) { public int updateById(Category category) {
category.setUpdated(LocalDateTime.now()); category.setUpdated(new Date());
return categoryMapper.updateByPrimaryKeySelective(category); return categoryMapper.updateByPrimaryKeySelective(category);
} }
...@@ -103,8 +104,8 @@ public class CategoryDaoImpl implements CategoryDao { ...@@ -103,8 +104,8 @@ public class CategoryDaoImpl implements CategoryDao {
} }
public void add(Category category) { public void add(Category category) {
category.setCreated(LocalDateTime.now()); category.setCreated(new Date());
category.setUpdated(LocalDateTime.now()); category.setUpdated(new Date());
categoryMapper.insertSelective(category); categoryMapper.insertSelective(category);
} }
......
...@@ -6,46 +6,17 @@ import java.util.List; ...@@ -6,46 +6,17 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface CategoryMapper { public interface CategoryMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table category
*
* @mbg.generated
*/
long countByExample(CategoryExample example); long countByExample(CategoryExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table category
*
* @mbg.generated
*/
int deleteByExample(CategoryExample example); int deleteByExample(CategoryExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table category
*
* @mbg.generated
*/
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table category
*
* @mbg.generated
*/
int insert(Category record); int insert(Category record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table category
*
* @mbg.generated
*/
int insertSelective(Category record); int insertSelective(Category record);
/** /**
...@@ -73,14 +44,19 @@ public interface CategoryMapper { ...@@ -73,14 +44,19 @@ public interface CategoryMapper {
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin * @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
List<Category> selectByExampleSelective(@Param("example") CategoryExample example, @Param("selective") Category.Column ... selective); Category selectOneByExampleWithBLOBs(CategoryExample example);
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method corresponds to the database table category * This method corresponds to the database table category
* *
* @mbg.generated * @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/ */
List<Category> selectByExampleSelective(@Param("example") CategoryExample example, @Param("selective") Category.Column ... selective);
List<Category> selectByExampleWithBLOBs(CategoryExample example);
List<Category> selectByExample(CategoryExample example); List<Category> selectByExample(CategoryExample example);
/** /**
...@@ -92,44 +68,18 @@ public interface CategoryMapper { ...@@ -92,44 +68,18 @@ public interface CategoryMapper {
*/ */
Category selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") Category.Column ... selective); Category selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") Category.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table category
*
* @mbg.generated
*/
Category selectByPrimaryKey(Integer id); Category selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table category
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") Category record, @Param("example") CategoryExample example); int updateByExampleSelective(@Param("record") Category record, @Param("example") CategoryExample example);
/** int updateByExampleWithBLOBs(@Param("record") Category record, @Param("example") CategoryExample example);
* This method was generated by MyBatis Generator.
* This method corresponds to the database table category
*
* @mbg.generated
*/
int updateByExample(@Param("record") Category record, @Param("example") CategoryExample example); int updateByExample(@Param("record") Category record, @Param("example") CategoryExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table category
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(Category record); int updateByPrimaryKeySelective(Category record);
/** int updateByPrimaryKeyWithBLOBs(Category record);
* This method was generated by MyBatis Generator.
* This method corresponds to the database table category
*
* @mbg.generated
*/
int updateByPrimaryKey(Category record); int updateByPrimaryKey(Category record);
/** /**
......
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