wl task3
This commit is contained in:
parent
a780dbfa7c
commit
c42f056b80
|
@ -1,12 +0,0 @@
|
||||||
package com.hnucm.springboot.springboot1.dao;
|
|
||||||
|
|
||||||
import com.hnucm.springboot.springboot1.model.Orders;
|
|
||||||
import com.hnucm.springboot.springboot1.model.StuCard;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface OrdersMapper {
|
|
||||||
public List<Orders> findOrdersByPersonId(int personId);
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
package com.hnucm.springboot.springboot1.dao;
|
|
||||||
|
|
||||||
import com.hnucm.springboot.springboot1.model.Person;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface PersonMapper {
|
|
||||||
public List<Person> getAllPersonStuCard();
|
|
||||||
public List<Person> getAllPerson();
|
|
||||||
//int 表示增加的条数
|
|
||||||
public int addPerson(Person person);
|
|
||||||
public int deletePerson(int id);
|
|
||||||
public int updatePerson(Person person);
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
package com.hnucm.springboot.springboot1.dao;
|
|
||||||
|
|
||||||
import com.hnucm.springboot.springboot1.model.Person;
|
|
||||||
import com.hnucm.springboot.springboot1.model.StuCard;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface StuCardMapper {
|
|
||||||
//根据学生证的主键查询对应的学生证信息
|
|
||||||
public StuCard getStuCardById(int id);
|
|
||||||
//增加成功的条数
|
|
||||||
public int addStuCard(StuCard stuCard);
|
|
||||||
// 删除学生卡 根据id
|
|
||||||
public int deleteStuCard(int id);
|
|
||||||
}
|
|
|
@ -13,10 +13,10 @@ import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
public class PersonServiceImpl implements PersonService {
|
public class PersonServiceImpl implements PersonService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private PersonMapper personMapper3;
|
private PersonMapper personMapper2;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
StuCardMapper stuCardMapper3;
|
StuCardMapper stuCardMapper2;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Person> getAllPerson() {
|
public List<Person> getAllPerson() {
|
||||||
|
@ -29,7 +29,7 @@ public class PersonServiceImpl implements PersonService {
|
||||||
stuCardMapper.addStuCard(person.getStuCard());
|
stuCardMapper.addStuCard(person.getStuCard());
|
||||||
return personMapper.addPerson(person);
|
return personMapper.addPerson(person);
|
||||||
}
|
}
|
||||||
|
// 事务 -》 增删改 多张表 同时操作
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public int deletePerson(int id, int stuid) {
|
public int deletePerson(int id, int stuid) {
|
||||||
|
|
Loading…
Reference in New Issue