1.补充补单设置相关接口

master
x_z 2 years ago
parent d179dbbf49
commit af87625995

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.BasicBusTypePreEntity;
import com.glxp.api.req.basic.FilterBusTypeChangeRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -14,4 +15,13 @@ import java.util.List;
public interface BasicBusTypePreDao extends BaseMapper<BasicBusTypePreEntity> {
List<BasicBusTypePreEntity> selectList(FilterBusTypeChangeRequest busTypeChangeFilterRequest);
/**
*
*
* @param action
* @return
*/
boolean deleteByAction(@Param("action") String action);
}

@ -34,22 +34,24 @@ public class BasicBusTypePreServiceImpl implements IBasicBusTypePreService {
@Override
public boolean deleteById(String id) {
return false;
return basicBusTypePreDao.deleteById(id) != 0;
}
@Override
public boolean deleteByAction(String action) {
return false;
return basicBusTypePreDao.deleteByAction(action);
}
@Override
public boolean updateBusChangeType(BasicBusTypePreEntity basicBusTypePreEntity) {
return false;
setUpdateInfo(basicBusTypePreEntity);
return basicBusTypePreDao.updateById(basicBusTypePreEntity) != 0;
}
@Override
public boolean insertBusChangeType(BasicBusTypePreEntity basicBusTypePreEntity) {
return false;
setUpdateInfo(basicBusTypePreEntity);
return basicBusTypePreDao.insert(basicBusTypePreEntity) != 0;
}
/**
@ -59,6 +61,12 @@ public class BasicBusTypePreServiceImpl implements IBasicBusTypePreService {
*/
private void setUpdateInfo(BasicBusTypePreEntity basicBusTypePreEntity) {
Date now = new Date();
String userId = customerService.getUserIdStr();
if (null == basicBusTypePreEntity.getId()) {
basicBusTypePreEntity.setCreateUser(userId);
basicBusTypePreEntity.setCreateTime(now);
}
basicBusTypePreEntity.setUpdateUser(userId);
basicBusTypePreEntity.setUpdateTime(now);
}
}

@ -1,8 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.basic.BasicBusTypePreDao">
<select id="selectList" resultType="com.glxp.api.entity.basic.BasicBusTypePreEntity">
select * from basic_bustype_pre
select *
from basic_bustype_pre
</select>
<delete id="deleteByAction">
delete
from basic_bustype_pre
where action = #{action}
</delete>
</mapper>
Loading…
Cancel
Save