Browse Source

feat:[试验管理][细胞、细菌管理]

master
HanLong 1 month ago
parent
commit
fd58cd1110
4 changed files with 20 additions and 22 deletions
  1. +9
    -10
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/BacteriaServiceImpl.java
  2. +3
    -4
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/CellServiceImpl.java
  3. +4
    -4
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/BacteriaMapper.xml
  4. +4
    -4
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/CellMapper.xml

+ 9
- 10
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/BacteriaServiceImpl.java View File

@ -42,30 +42,29 @@ public class BacteriaServiceImpl extends ServiceImpl i
@Override @Override
public List<Bacteria> queryStudyList(StudyCellSearchForm form) { public List<Bacteria> queryStudyList(StudyCellSearchForm form) {
QueryWrapper<Bacteria> queryWrapper = Wrappers.query(); QueryWrapper<Bacteria> queryWrapper = Wrappers.query();
queryWrapper.eq("sb.del_flag", 0)
.eq("c.del_flag", 0);
queryWrapper.eq("b.del_flag", 0);
if(form.getStudyId() != null) { if(form.getStudyId() != null) {
queryWrapper.eq("sb.study_id", form.getStudyId());
queryWrapper.eq("b.study_id", form.getStudyId());
} }
if(StringUtils.isNotEmpty(form.getMc())) { if(StringUtils.isNotEmpty(form.getMc())) {
queryWrapper.like("c.mc", form.getMc());
queryWrapper.like("b.mc", form.getMc());
} }
if(StringUtils.isNotEmpty(form.getBh())) { if(StringUtils.isNotEmpty(form.getBh())) {
queryWrapper.like("c.bh", form.getBh());
queryWrapper.like("b.bh", form.getBh());
} }
if(StringUtils.isNotEmpty(form.getLy())) { if(StringUtils.isNotEmpty(form.getLy())) {
queryWrapper.like("c.ly", form.getLy());
queryWrapper.like("b.ly", form.getLy());
} }
if(StringUtils.isNotEmpty(form.getStartDate())) { if(StringUtils.isNotEmpty(form.getStartDate())) {
queryWrapper.ge("c.sxr", form.getStartDate());
queryWrapper.ge("b.sxr", form.getStartDate());
} }
if(StringUtils.isNotEmpty(form.getEndDate())) { if(StringUtils.isNotEmpty(form.getEndDate())) {
queryWrapper.le("c.sxr", form.getEndDate());
queryWrapper.le("b.sxr", form.getEndDate());
} }
if(StringUtils.isNotEmpty(form.getStudyName())) { if(StringUtils.isNotEmpty(form.getStudyName())) {
queryWrapper.like("t.name", form.getStudyName());
queryWrapper.like("s.name", form.getStudyName());
} }
queryWrapper.orderByDesc("c.bh");
queryWrapper.orderByDesc("b.bh");
return baseMapper.queryStudyList(queryWrapper); return baseMapper.queryStudyList(queryWrapper);
} }

+ 3
- 4
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/CellServiceImpl.java View File

@ -40,10 +40,9 @@ public class CellServiceImpl extends ServiceImpl implements IC
@Override @Override
public List<Cell> queryStudyList(StudyCellSearchForm form) { public List<Cell> queryStudyList(StudyCellSearchForm form) {
QueryWrapper<Cell> queryWrapper = Wrappers.query(); QueryWrapper<Cell> queryWrapper = Wrappers.query();
queryWrapper.eq("sc.del_flag", 0)
.eq("c.del_flag", 0);
queryWrapper.eq("c.del_flag", 0);
if(form.getStudyId() != null) { if(form.getStudyId() != null) {
queryWrapper.eq("sc.study_id", form.getStudyId());
queryWrapper.eq("c.study_id", form.getStudyId());
} }
if(StringUtils.isNotEmpty(form.getMc())) { if(StringUtils.isNotEmpty(form.getMc())) {
queryWrapper.like("c.mc", form.getMc()); queryWrapper.like("c.mc", form.getMc());
@ -61,7 +60,7 @@ public class CellServiceImpl extends ServiceImpl implements IC
queryWrapper.le("c.sxr", form.getEndDate()); queryWrapper.le("c.sxr", form.getEndDate());
} }
if(StringUtils.isNotEmpty(form.getStudyName())) { if(StringUtils.isNotEmpty(form.getStudyName())) {
queryWrapper.like("t.name", form.getStudyName());
queryWrapper.like("s.name", form.getStudyName());
} }
queryWrapper.orderByDesc("c.bh"); queryWrapper.orderByDesc("c.bh");
return baseMapper.queryStudyList(queryWrapper); return baseMapper.queryStudyList(queryWrapper);

+ 4
- 4
hxhq-modules/hxhq-system/src/main/resources/mapper/business/BacteriaMapper.xml View File

@ -4,10 +4,10 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hxhq.business.mapper.BacteriaMapper"> <mapper namespace="com.hxhq.business.mapper.BacteriaMapper">
<select id="queryStudyList" resultType="com.hxhq.business.domain.Bacteria"> <select id="queryStudyList" resultType="com.hxhq.business.domain.Bacteria">
select c.*, s.name as studyName
FROM `t_study_bacteria` sb
join `t_bacteria` c on c.id=sb.resource_id
LEFT JOIN `t_study` s on s.id = sb.study_id
SELECT b.*, s.name AS studyName
FROM `t_bacteria` b
LEFT JOIN `t_study_bacteria` sb ON b.id=sb.resource_id
LEFT JOIN `t_study` s ON s.id = b.study_id
<if test="ew.sqlSegment != '' and ew.sqlSegment != null"> <if test="ew.sqlSegment != '' and ew.sqlSegment != null">
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}

+ 4
- 4
hxhq-modules/hxhq-system/src/main/resources/mapper/business/CellMapper.xml View File

@ -4,10 +4,10 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hxhq.business.mapper.CellMapper"> <mapper namespace="com.hxhq.business.mapper.CellMapper">
<select id="queryStudyList" resultType="com.hxhq.business.domain.Cell"> <select id="queryStudyList" resultType="com.hxhq.business.domain.Cell">
select c.*, s.name as studyName
FROM `t_study_cell` sc
join `t_cell` c on c.id=sc.resource_id
LEFT JOIN `t_study` s on s.id = sc.study_id
SELECT c.*, s.name as studyName
FROM `t_cell` c
LEFT JOIN `t_study_cell` sc on c.id=sc.resource_id
LEFT JOIN `t_study` s on s.id = c.study_id
<if test="ew.sqlSegment != '' and ew.sqlSegment != null"> <if test="ew.sqlSegment != '' and ew.sqlSegment != null">
<where> <where>
${ew.sqlSegment} ${ew.sqlSegment}

Loading…
Cancel
Save