苍穹外卖--公共字段自动填充功能实现
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.sky.mapper;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.sky.annotation.AutoFill;
|
||||
import com.sky.enumeration.OperationType;
|
||||
import com.sky.dto.CategoryPageQueryDTO;
|
||||
import com.sky.entity.Category;
|
||||
@@ -16,6 +17,7 @@ public interface CategoryMapper {
|
||||
* 插入数据
|
||||
* @param category
|
||||
*/
|
||||
@AutoFill(OperationType.INSERT)
|
||||
@Insert("insert into category(type, name, sort, status, create_time, update_time, create_user, update_user)" +
|
||||
" VALUES" +
|
||||
" (#{type}, #{name}, #{sort}, #{status}, #{createTime}, #{updateTime}, #{createUser}, #{updateUser})")
|
||||
@@ -39,6 +41,7 @@ public interface CategoryMapper {
|
||||
* 根据id修改分类
|
||||
* @param category
|
||||
*/
|
||||
@AutoFill(OperationType.UPDATE)
|
||||
void update(Category category);
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.sky.mapper;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.sky.annotation.AutoFill;
|
||||
import com.sky.dto.EmployeePageQueryDTO;
|
||||
import com.sky.entity.Employee;
|
||||
import com.sky.enumeration.OperationType;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@@ -22,12 +24,14 @@ public interface EmployeeMapper {
|
||||
* 新增员工
|
||||
* @param employee
|
||||
*/
|
||||
@AutoFill(OperationType.INSERT)
|
||||
@Insert("insert into employee (name, username, password, phone, sex, id_number, create_time, update_time, create_user, update_user) " +
|
||||
"values (#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{createTime},#{updateTime},#{createUser},#{updateUser})")
|
||||
void insert(Employee employee);
|
||||
|
||||
Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO);
|
||||
|
||||
@AutoFill(OperationType.UPDATE)
|
||||
void update(Employee employee);
|
||||
|
||||
@Select("select * from employee where id = #{id}")
|
||||
|
||||
Reference in New Issue
Block a user