Merge pull request '合并' (#6) from pnxqwic3z/ssm:master into master
commit
f4b37c21d1
@ -0,0 +1,68 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.dao.IDepartmentDao;
|
||||
import com.entity.Department;
|
||||
import com.service.IDeptService;
|
||||
import com.utils.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.management.ObjectName;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName DeptServiceImpl
|
||||
* @Description TODO
|
||||
* @Author YHT
|
||||
* @Date 2021/5/30 16:02
|
||||
*/
|
||||
@Service
|
||||
public class DeptServiceImpl implements IDeptService {
|
||||
@Autowired
|
||||
private IDepartmentDao departmentDao;
|
||||
@Override
|
||||
public List<Department> findAllDepartment() {
|
||||
return departmentDao.findAllDepartment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDept(Department department) {
|
||||
departmentDao.insertDept(department);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Department> findDeptByName(String deptName, Page page) {
|
||||
deptName = "%" + deptName + "%";
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("deptName", deptName);
|
||||
map.put("page", page);
|
||||
return departmentDao.searchByName(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDeptTotal() {
|
||||
return departmentDao.getDeptTotal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Department> listDept(Page page) {
|
||||
return departmentDao.listDept(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Department findDeptById(int id) {
|
||||
return departmentDao.findDeptById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyDept(Department department) {
|
||||
departmentDao.modifyDept(department);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDept(int id) {
|
||||
departmentDao.deleteDept(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.dao.IUserDao;
|
||||
import com.entity.User;
|
||||
import com.service.IUserService;
|
||||
import com.utils.MD5Utils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName UserServiceImpl
|
||||
* @Description TODO
|
||||
* @Author YHT
|
||||
* @Date 2021/5/28 17:41
|
||||
*/
|
||||
@Service
|
||||
public class UserServiceImpl implements IUserService {
|
||||
@Autowired
|
||||
private IUserDao userDao;
|
||||
|
||||
public User findById(Integer id) {
|
||||
return userDao.findById(id);
|
||||
}
|
||||
|
||||
public User findByNameAndPwd(String name, String password) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("name", name);
|
||||
map.put("password", password);
|
||||
return userDao.findByNameAndPwd(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertUser(User user) {
|
||||
return userDao.insertUser(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyUser(User user) {
|
||||
userDao.modifyUser(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyPwd(String password, Integer id) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
password = MD5Utils.stringToMD5(password);
|
||||
map.put("id", id);
|
||||
map.put("password", password);
|
||||
userDao.modifyPwd(map);
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.dao.IVisitorDao;
|
||||
import com.entity.Visitor;
|
||||
import com.service.IVisitorService;
|
||||
import com.utils.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName VisitorServiceImpl
|
||||
* @Description TODO
|
||||
* @Author YHT
|
||||
* @Date 2021/7/9 21:47
|
||||
*/
|
||||
@Service
|
||||
public class VisitorServiceImpl implements IVisitorService {
|
||||
@Autowired
|
||||
private IVisitorDao visitorDao;
|
||||
@Override
|
||||
public List<Visitor> listVisitor(Page page) {
|
||||
return visitorDao.listVisitor(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisitorTotal() {
|
||||
return visitorDao.getVisitorTotal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addVisitor(Visitor visitor) {
|
||||
visitorDao.addVisitor(visitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Visitor> searchByName(String name, Page page) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("name", name);
|
||||
map.put("page", page);
|
||||
return visitorDao.searchByName(map);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue