Commit b9f2d478 by Jiang

案事件模块sql语句添加模糊查询

parent 958cd3cc
......@@ -53,7 +53,9 @@ public class BladeConfiguration implements WebMvcConfigurer {
secureRegistry.excludePathPatterns("/reloadShceDict");
secureRegistry.excludePathPatterns("/xttg/**");
secureRegistry.excludePathPatterns("/xgxb/**");
secureRegistry.excludePathPatterns("/**");
secureRegistry.excludePathPatterns("/asj/**");
secureRegistry.excludePathPatterns("/ss*/**");
// secureRegistry.excludePathPatterns("/**");
/*secureRegistry.excludePathPatterns("/**");
secureRegistry.excludePathPatterns("/ajDetail/**");
secureRegistry.excludePathPatterns("/tbstAsj/stasj*");
......
......@@ -22,10 +22,17 @@ public class AsjVO {
private String ladwGajgmc;//立案单位_公安机关名称
private String sldwGajgjgdm;//受理单位_公安机关机构代码
private String sldwGajgmc;//受理单位_公安机关名称
private String jyaq;//简要案情
public AsjVO(){}
public AsjVO(TbStAsjQgccj tbStAsjQgccj){
BeanCopyUtil.copy(tbStAsjQgccj,this, BeanCopyUtil.OperationType.QUERY);
if (tbStAsjQgccj!=null){
BeanCopyUtil.copy(tbStAsjQgccj,this, BeanCopyUtil.OperationType.QUERY);
} else {
tbStAsjQgccj=new TbStAsjQgccj();
BeanCopyUtil.copy(tbStAsjQgccj,this, BeanCopyUtil.OperationType.QUERY);
}
}
}
......@@ -52,9 +52,9 @@ public class TbStAsjController {
* @return 单条数据
*/
@PostMapping("queryAll")
public R queryById(@RequestParam(required = false) String ajmc,Integer page,Integer limit) {
public R queryById(@RequestParam(required = false) String asjbh,@RequestParam(required = false) String ajmc,Integer page,Integer limit) {
try{
Map<String,Object> map=tbStAsjService.queryAll(ajmc, page, limit);
Map<String,Object> map=tbStAsjService.queryAll(asjbh,ajmc, page, limit);
return R.ok().data(map);
}catch (Exception e){
e.printStackTrace();
......
......@@ -8,80 +8,72 @@ import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* (TbStAsj)表数据库访问层
* 案事件基本信息(TbStAsj)表数据库访问层
*
* @author jlt
* @since 2021-11-10 17:36:38
* @since 2021-11-12 09:37:39
*/
@Mapper
public interface TbStAsjMapper {
/**
* 通过ID查询单条数据
*
* @param asjbh 主键
* @return 实例对象
*/
TbStAsjQgccj queryById(String asjbh);
/**
* 通过ID查询单条数据
*
* @param asjbh 主键
* @return 实例对象
*/
TbStAsjQgccj queryById(String asjbh);
/**
* 查询指定行数据
*
* @param tbStAsj 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TbStAsjQgccj> queryAllByLimit(TbStAsjQgccj tbStAsj, @Param("pageable") Pageable pageable);
List<TbStAsjQgccj> queryAll(@Param("asjbh") String asjbh, @Param("ajmc") String ajmc, @Param("page") Integer page, @Param("limit") Integer limit);
/**
* 统计总行数
*
* @param tbStAsj 查询条件
* @return 总行数
*/
int count(TbStAsjQgccj tbStAsj);
/**
* 统计总行数
*
* @param tbStAsj 查询条件
* @return 总行数
*/
int count(TbStAsjQgccj tbStAsj);
/**
* 新增数据
*
* @param tbStAsj 实例对象
* @return 影响行数
*/
int insert(TbStAsjQgccj tbStAsj);
/**
* 新增数据
*
* @param tbStAsj 实例对象
* @return 影响行数
*/
int insert(TbStAsjQgccj tbStAsj);
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<TbStAsj> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbStAsjQgccj> entities);
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<TbStAsj> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbStAsjQgccj> entities);
/**
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
*
* @param entities List<TbStAsj> 实例对象列表
* @return 影响行数
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
*/
int insertOrUpdateBatch(@Param("entities") List<TbStAsjQgccj> entities);
/**
* 批量新增或按主键更新数据(MyBatis原生foreach方法)
*
* @param entities List<TbStAsj> 实例对象列表
* @return 影响行数
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
*/
int insertOrUpdateBatch(@Param("entities") List<TbStAsjQgccj> entities);
/**
* 修改数据
*
* @param tbStAsj 实例对象
* @return 影响行数
*/
int update(TbStAsjQgccj tbStAsj);
/**
* 修改数据
*
* @param tbStAsj 实例对象
* @return 影响行数
*/
int update(TbStAsjQgccj tbStAsj);
/**
* 通过主键删除数据
*
* @param asjbh 主键
* @return 影响行数
*/
int deleteById(String asjbh);
/**
* 通过主键删除数据
*
* @param asjbh 主键
* @return 影响行数
*/
int deleteById(String asjbh);
List<TbStAsjQgccj> queryAll(String ajmc, Integer page, Integer limit);
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -22,14 +22,6 @@ public interface TbStAsjService {
*/
TbStAsjQgccj queryById(String asjbh);
/**
* 分页查询
*
* @param tbStAsj 筛选条件
* @param pageRequest 分页对象
* @return 查询结果
*/
Page<TbStAsjQgccj> queryByPage(TbStAsjQgccj tbStAsj, PageRequest pageRequest);
/**
* 新增数据
......@@ -55,5 +47,5 @@ public interface TbStAsjService {
*/
boolean deleteById(String asjbh);
Map<String, Object> queryAll(String ajmc,Integer page,Integer limit);
Map<String, Object> queryAll(String asjbh,String ajmc,Integer page,Integer limit);
}
......@@ -10,7 +10,6 @@ import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -38,18 +37,7 @@ public class TbStAsjServiceImpl implements TbStAsjService {
return this.tbStAsjDao.queryById(asjbh);
}
/**
* 分页查询
*
* @param tbStAsj 筛选条件
* @param pageRequest 分页对象
* @return 查询结果
*/
@Override
public Page<TbStAsjQgccj> queryByPage(TbStAsjQgccj tbStAsj, PageRequest pageRequest) {
long total = this.tbStAsjDao.count(tbStAsj);
return new PageImpl<>(this.tbStAsjDao.queryAllByLimit(tbStAsj, pageRequest), pageRequest, total);
}
/**
* 新增数据
......@@ -87,17 +75,19 @@ public class TbStAsjServiceImpl implements TbStAsjService {
}
@Override
public Map<String, Object> queryAll(String ajmc, Integer page, Integer limit) {
public Map<String, Object> queryAll(String asjbh,String ajmc, Integer page, Integer limit) {
page = (page-1) * limit;
limit = page +limit;
Map<String,Object> map=new HashMap<>();
List<TbStAsjQgccj> tbStAsjQgccjList= tbStAsjDao.queryAll(ajmc,page,limit);
TbStAsjQgccj tbStAsjQgccj=new TbStAsjQgccj();
tbStAsjQgccj.setAjmc(ajmc);
tbStAsjQgccj.setAsjbh(asjbh);
List<TbStAsjQgccj> tbStAsjQgccjList= tbStAsjDao.queryAll(asjbh,ajmc,page,limit);
List<AsjVO> asjVOS=new ArrayList<>();
for (TbStAsjQgccj t :tbStAsjQgccjList) {
asjVOS.add(new AsjVO(t));
}
TbStAsjQgccj tbStAsjQgccj=new TbStAsjQgccj();
tbStAsjQgccj.setAjmc(ajmc);
int count=tbStAsjDao.count(tbStAsjQgccj);
map.put("rows",asjVOS);
map.put("total",count);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment