EmployeeMapper.xml
SELECT id,NAME,gender,idcard,nationid FROM employee WHERE 1=1 and NAME LIKE #{p_name}
调用数据层
public interface EmployeeMapper { // 姓名查询员工信息 public List findByName(String name); // 多条件组合查询查询员工信息 public List findByCondition(@Param("id") int id, @Param("name")String name, @Param("idcard")String idcard, @Param("nationid")int nationid); public List findByCondition(Employee employee);}
测试
工程目录:
来源地址:https://blog.csdn.net/qq_45947664/article/details/129403276