46 lines
1.4 KiB
Java
Raw Normal View History

2024-03-27 11:12:20 +08:00
package com.sky.mapper;
2024-04-11 12:56:00 +08:00
import com.sky.annotation.AutoFill;
2024-03-29 16:08:30 +08:00
import com.sky.dto.EmployeePageQueryDTO;
2024-03-29 16:25:24 +08:00
import com.sky.dto.StartOrStopDTO;
2024-03-27 11:12:20 +08:00
import com.sky.entity.Employee;
2024-04-11 12:56:00 +08:00
import com.sky.enumeration.OperationType;
2024-03-29 16:08:30 +08:00
import org.apache.ibatis.annotations.Insert;
2024-03-27 11:12:20 +08:00
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
2024-03-29 16:08:30 +08:00
import org.apache.ibatis.annotations.Update;
import java.util.List;
2024-03-27 11:12:20 +08:00
@Mapper
public interface EmployeeMapper {
/**
* 根据用户名查询员工
* @param username
* @return
*/
@Select("select * from employee where username = #{username}")
Employee getByUsername(String username);
2024-03-29 16:08:30 +08:00
/**
* 新增员工
* @param employee
*/
@Insert("insert into employee (name, username, password, phone, sex, id_number, create_time, update_time, create_user, update_user,status) " +
"values " +
"(#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{createTime},#{updateTime},#{createUser},#{updateUser},#{status})")
2024-04-11 12:56:00 +08:00
@AutoFill(OperationType.INSERT)
2024-03-29 16:08:30 +08:00
void save(Employee employee);
/**
* 分页条件查询
* @return
*/
List<Employee> list(EmployeePageQueryDTO employeePageQueryDTO);
2024-04-02 11:38:42 +08:00
@Select("select * from employee where id=#{id};")
Employee queryById(Integer id);
2024-04-11 12:56:00 +08:00
@AutoFill(OperationType.UPDATE)
2024-04-02 11:38:42 +08:00
void update(Employee employee);
2024-03-27 11:12:20 +08:00
}