专项项目库crud
This commit is contained in:
+76
@@ -0,0 +1,76 @@
|
||||
package com.jero.modules.projectLibrary.service;
|
||||
|
||||
import com.jero.modules.projectLibrary.entity.LawsSpecialProjectLibrary;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 专项项目库
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILawsSpecialProjectLibraryService extends IService<LawsSpecialProjectLibrary> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsSpecialProjectLibrary
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
IPage<LawsSpecialProjectLibrary> queryPage(LawsSpecialProjectLibrary lawsSpecialProjectLibrary, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsSpecialProjectLibrary
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
List<LawsSpecialProjectLibrary> queryList(LawsSpecialProjectLibrary lawsSpecialProjectLibrary, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsSpecialProjectLibrary
|
||||
* @return
|
||||
*/
|
||||
void add(LawsSpecialProjectLibrary lawsSpecialProjectLibrary);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsSpecialProjectLibrary
|
||||
* @return
|
||||
*/
|
||||
void editById(LawsSpecialProjectLibrary lawsSpecialProjectLibrary);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LawsSpecialProjectLibrary queryById(String id);
|
||||
}
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
package com.jero.modules.projectLibrary.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.modules.projectLibrary.entity.LawsSpecialProjectLibrary;
|
||||
import com.jero.modules.projectLibrary.mapper.LawsSpecialProjectLibraryMapper;
|
||||
import com.jero.modules.projectLibrary.service.ILawsSpecialProjectLibraryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 专项项目库
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-09-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class LawsSpecialProjectLibraryServiceImpl extends ServiceImpl<LawsSpecialProjectLibraryMapper, LawsSpecialProjectLibrary> implements ILawsSpecialProjectLibraryService {
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsSpecialProjectLibrary
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<LawsSpecialProjectLibrary> queryPage(LawsSpecialProjectLibrary lawsSpecialProjectLibrary, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<LawsSpecialProjectLibrary> queryWrapper = QueryGenerator.initQueryWrapper(lawsSpecialProjectLibrary, req.getParameterMap());
|
||||
Page<LawsSpecialProjectLibrary> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsSpecialProjectLibrary
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LawsSpecialProjectLibrary> queryList(LawsSpecialProjectLibrary lawsSpecialProjectLibrary, HttpServletRequest req) {
|
||||
return list(QueryGenerator.initQueryWrapper(lawsSpecialProjectLibrary, req.getParameterMap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsSpecialProjectLibrary
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(LawsSpecialProjectLibrary lawsSpecialProjectLibrary) {
|
||||
Date now = new Date();
|
||||
lawsSpecialProjectLibrary.setCreateTime(now);
|
||||
lawsSpecialProjectLibrary.setUpdateTime(now);
|
||||
save(lawsSpecialProjectLibrary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsSpecialProjectLibrary
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(LawsSpecialProjectLibrary lawsSpecialProjectLibrary) {
|
||||
Date now = new Date();
|
||||
lawsSpecialProjectLibrary.setUpdateTime(now);
|
||||
saveOrUpdate(lawsSpecialProjectLibrary);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LawsSpecialProjectLibrary queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user