| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.whyc.mapper.MapOutlineMapper; |
| | | import com.whyc.pojo.MapOutline; |
| | | import com.whyc.util.ActionUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private MapOutlineMapper mapper; |
| | | |
| | | public List<MapOutline> getAll() { |
| | | return mapper.selectList(null); |
| | | return mapper.selectList((Wrapper<MapOutline>) ActionUtil.objeNull); |
| | | } |
| | | |
| | | public void updateActive(int id) { |
| | |
| | | UpdateWrapper<MapOutline> wrapper = Wrappers.update(); |
| | | UpdateWrapper<MapOutline> wrapper2 = wrapper.clone(); |
| | | wrapper.set("status", 0).eq("status", 1); |
| | | mapper.update(null, wrapper); |
| | | mapper.update((MapOutline) ActionUtil.objeNull, wrapper); |
| | | //再激活当前id说对应的记录 |
| | | wrapper2.set("status", 1).eq("id", id); |
| | | mapper.update(null, wrapper2); |
| | | mapper.update((MapOutline) ActionUtil.objeNull, wrapper2); |
| | | } |
| | | |
| | | public void add(MapOutline mapOutline) { |