检验项目维护功能

This commit is contained in:
jiangs 2025-06-19 09:17:30 +08:00
parent a38dba2d04
commit 32598d39e4
6 changed files with 264 additions and 9 deletions

View File

@ -27,14 +27,27 @@ public class ReportItemController extends BaseController {
@ApiOperation("查询检验项目列表")
@GetMapping("/query")
public TableDataInfo query(String yq,String xmdh){
public TableDataInfo query(String xmid,String yq,String xmdh){
startPage();
List<XmInfoNew> xmInfoNewList = reportItemService.query(yq,xmdh);
List<XmInfoNew> xmInfoNewList = reportItemService.query(xmid,yq,xmdh);
return getDataTable(xmInfoNewList);
}
@ApiOperation("新增检验项目")
@PostMapping("/add")
public Result add(@RequestBody XmInfoNewDTO xmInfoNewDTO){
return reportItemService.add(xmInfoNewDTO);
}
@ApiOperation("删除检验项目")
@DeleteMapping("/del")
public Result delete(Integer xmid){
return reportItemService.delete(xmid);
}
@ApiOperation("修改检验项目")
@PostMapping("/update")
public Result update(@RequestBody XmInfoNewDTO xmInfoNewDTO){
return reportItemService.update(xmInfoNewDTO);
}
}

View File

@ -6,7 +6,7 @@ import com.czlis.liswork.pojo.DTO.XmInfoNewDTO;
import java.util.List;
public interface ReportItemMapper {
List<XmInfoNew> query(String yq, String xmdh);
List<XmInfoNew> query(String xmid,String yq, String xmdh);
void addXmInfoNew(XmInfoNew xmInfoNew);
void addXmDoubleRow(XmDouble xmDoubleRow);
void addXmInterRow(XmInter xmInterRow);
@ -14,4 +14,19 @@ public interface ReportItemMapper {
void addXmValRow(XmVal xmValRow);
void addXmTextResultRow(XmTextResult xmTextResultRow);
void deleteXmInfoNew(Integer xmid);
void deleteXmDouble(String yq, String xmdh);
void deleteXmInter(Integer xmid);
void deleteXmTextResult(Integer xmid);
void deleteXmRef(Integer xmid);
void deleteXmVal(Integer xmid);
Long getXmInfoVsCount(Integer xmid);
void updateXmInfoNew(XmInfoNew xmInfoNewRow);
void updateXmDoubleRow(XmDouble xmDoubleRow);
void updateXmInterRow(XmInter xmInterRow);
void updateXmRefRow(XmRef xmRefRow);
void updateXmValRow(XmVal xmValRow);
void updateXmTextResultRow(XmTextResult xmTextResultRow);
}

View File

@ -7,8 +7,13 @@ import com.czlis.liswork.pojo.XmInfoNew;
import java.util.List;
public interface ReportItemService {
List<XmInfoNew> query(String yq, String xmdh);
List<XmInfoNew> query(String xmid,String yq, String xmdh);
Result add(XmInfoNewDTO xmInfoNewDTO);
Result delete(Integer xmid);
Result update(XmInfoNewDTO xmInfoNewDTO);
}

View File

@ -21,8 +21,8 @@ public class ReportItemServiceImpl implements ReportItemService {
private ReportItemMapper reportItemMapper;
@Override
public List<XmInfoNew> query(String yq, String xmdh) {
return reportItemMapper.query(yq,xmdh);
public List<XmInfoNew> query(String xmid,String yq, String xmdh) {
return reportItemMapper.query(xmid,yq,xmdh);
}
@Transactional(rollbackFor = Exception.class)
@ -59,4 +59,61 @@ public class ReportItemServiceImpl implements ReportItemService {
}
return new Result("0","添加项目成功!");
}
@Transactional(rollbackFor = Exception.class)
@Override
public Result delete(Integer xmid) {
Long xmInfoVsCount = reportItemMapper.getXmInfoVsCount(xmid);
if(xmInfoVsCount > 0) return new Result("-1","已经有仪器做过这个项目的对照,不允许删除!");
List<XmInfoNew> xmInfoNewList = reportItemMapper.query(String.valueOf(xmid), null, null);
for (XmInfoNew xmInfoNew : xmInfoNewList) {
String yq = xmInfoNew.getYq();
String xmdh = xmInfoNew.getXmdh();
reportItemMapper.deleteXmInfoNew(xmid);
reportItemMapper.deleteXmDouble(yq,xmdh);
reportItemMapper.deleteXmInter(xmid);
reportItemMapper.deleteXmTextResult(xmid);
reportItemMapper.deleteXmRef(xmid);
reportItemMapper.deleteXmVal(xmid);
}
return new Result("0","删除成功!");
}
@Transactional(rollbackFor = Exception.class)
@Override
public Result update(XmInfoNewDTO xmInfoNewDTO) {
List<XmInfoNew> xmInfoNewRows = xmInfoNewDTO.getXmInfoNewRows();
for (XmInfoNew xmInfoNewRow : xmInfoNewRows) {
reportItemMapper.updateXmInfoNew(xmInfoNewRow);
}
List<XmDouble> xmDoubleRows = xmInfoNewDTO.getXmDoubleRows();
for (XmDouble xmDoubleRow : xmDoubleRows) {
reportItemMapper.updateXmDoubleRow(xmDoubleRow);
}
List<XmInter> xmInterRows = xmInfoNewDTO.getXmInterRows();
for (XmInter xmInterRow : xmInterRows) {
reportItemMapper.updateXmInterRow(xmInterRow);
}
List<XmRef> xmRefRows = xmInfoNewDTO.getXmRefRows();
for (XmRef xmRefRow : xmRefRows) {
reportItemMapper.updateXmRefRow(xmRefRow);
}
List<XmVal> xmValRows = xmInfoNewDTO.getXmValRows();
for (XmVal xmValRow : xmValRows) {
reportItemMapper.updateXmValRow(xmValRow);
}
List<XmTextResult> xmTextResultRows = xmInfoNewDTO.getXmTextResultRows();
for (XmTextResult xmTextResultRow : xmTextResultRows) {
reportItemMapper.updateXmTextResultRow(xmTextResultRow);
}
return new Result("0","添加项目成功!");
}
}

View File

@ -6,6 +6,7 @@
<select id="query" resultType="com.czlis.liswork.pojo.XmInfoNew">
select * from xm_info_new
<where>
<if test="xmid != null and xmid != ''">xmid = #{xmid}</if>
<if test="yq != null and yq != ''">yq = #{yq}</if>
<if test="xmdh != null and xmdh != ''">yq = #{xmdh}</if>
</where>
@ -41,7 +42,7 @@
<if test="ygbb != null and ygbb=''">ygbb,</if>
<if test="lcyy != null and lcyy=''">lcyy,</if>
<if test="jgbz != null and jgbz=''">jgbz,</if>
<if test="jgjg != null" >jgbz,</if>
<if test="jgjg != null" >jgjg,</if>
<if test="jgz != null" >jgz,</if>
<if test="csff != null and csff != ''" >csff,</if>
<if test="yymc != null and yymc != ''" >yymc,</if>
@ -100,7 +101,7 @@
<if test="ygbb != null and ygbb=''">#{ygbb},</if>
<if test="lcyy != null and lcyy=''">#{lcyy},</if>
<if test="jgbz != null and jgbz=''">#{jgbz},</if>
<if test="jgjg != null" >#{jgbz},</if>
<if test="jgjg != null" >#{jgjg},</if>
<if test="jgz != null" >#{jgz},</if>
<if test="csff != null and csff != ''" >#{csff},</if>
<if test="yymc != null and yymc != ''" >#{yymc},</if>
@ -190,6 +191,170 @@
</insert>
<insert id="addXmRefRow">
insert into xm_ref_new (
<if test="xb != null and xb != ''">xb,</if>
<if test="nl1 != null">nl1,</if>
<if test="nl2 != null">nl2,</if>
<if test="bblx != null and bblx != ''">bblx,</if>
<if test="cksx != null">cksx,</if>
<if test="ckxx != null">ckxx,</if>
<if test="dyck != null and dyck != ''">dyck,</if>
<if test="nldw != null and nldw != ''">nldw,</if>
<if test="redoxx != null">redoxx,</if>
<if test="redosx != null">redosx,</if>
<if test="alterxx != null">alterxx,</if>
<if test="altersx != null">altersx,</if>
<if test="slzq != null and slzq != ''">slzq,</if>
<if test="zd != null and zd != ''">zd,</if>
<if test="instrid != null and instrid != ''">instrid,</if>
<if test="yq != null and yq != ''">yq,</if>
xmid,xmdh,xh
)values(
<if test="xb != null and xb != ''">#{xb},</if>
<if test="nl1 != null">#{nl1},</if>
<if test="nl2 != null">#{nl2},</if>
<if test="bblx != null and bblx != ''">#{bblx},</if>
<if test="cksx != null">#{cksx},</if>
<if test="ckxx != null">#{ckxx},</if>
<if test="dyck != null and dyck != ''">#{dyck},</if>
<if test="nldw != null and nldw != ''">#{nldw},</if>
<if test="redoxx != null">#{redoxx},</if>
<if test="redosx != null">#{redosx},</if>
<if test="alterxx != null">#{alterxx},</if>
<if test="altersx != null">#{altersx},</if>
<if test="slzq != null and slzq != ''">#{slzq},</if>
<if test="zd != null and zd != ''">#{zd},</if>
<if test="instrid != null and instrid != ''">#{instrid},</if>
<if test="yq != null and yq != ''">#{yq},</if>
#{xmid},#{xmdh},#{xh}
)
</insert>
<insert id="addXmValRow">
insert into xm_val_new(
<if test="srm != null and srm != ''">srm,</if>
<if test="xh != null">xh,</if>
<if test="jgbz != null and jgbz != ''">jgbz,</if>
xmid,xmdh,qz
)values(
<if test="srm != null and srm != ''">#{srm},</if>
<if test="xh != null">#{xh},</if>
<if test="jgbz != null and jgbz != ''">#{jgbz},</if>
#{xmid},#{xmdh},#{qz}
)
</insert>
<insert id="addXmTextResultRow">
insert into xm_textresult_new(
<if test="textresult != null and textresult != ''">textresult,</if>
<if test="reserve != null and reserve != ''">reserve,</if>
<if test="yxjs != null and yxjs != ''">yxjs,</if>
<if test="cjyy != null and cjyy != ''">cjyy,</if>
<if test="zd != null and zd != ''">zd,</if>
xmid,xmdh,xh
)values(
<if test="textresult != null and textresult != ''">#{textresult},</if>
<if test="reserve != null and reserve != ''">#{reserve},</if>
<if test="yxjs != null and yxjs != ''">#{yxjs},</if>
<if test="cjyy != null and cjyy != ''">#{cjyy},</if>
<if test="zd != null and zd != ''">#{zd},</if>
#{xmid},#{xmdh},#{xh}
)
</insert>
<delete id="deleteXmInfoNew">
delete from xm_info_new where xmid = #{xmid}
<if test="yq != null and yq != ''">and yq = #{yq}</if>
<if test="xmdh != null and xmdh != ''">and xmdh = #{xmdh}</if>
</delete>
<delete id="deleteXmDouble">
delete from xm_double where yq = #{yq} and xmdh =#{xmdh}
</delete>
<delete id="deleteXmInter">
delete from xm_inter where xmid = #{xmid}
</delete>
<delete id="deleteXmTextResult">
delete from xm_textresult_new where xmid = #{xmid}
</delete>
<delete id="deleteXmRef">
delete from xm_ref_new where xmid = #{xmid}
</delete>
<delete id="deleteXmVal">
delete from xm_val_new where xmid = #{xmid}
</delete>
<select id="getXmInfoVsCount" resultType="Long">
select count(1) from xm_info_vs where xmid = #{xmid}
</select>
<update id="updateXmInfoNew">
update xm_info_new
<set>
<if test="yq != null and yq != ''">yq = #{yq},</if>
<if test="xmdh != null and xmdh != ''">xmdh = #{xmdh},</if>
<if test="xmmc != null and xmmc != ''">xmmc = #{xmmc},</if>
<if test="zhbdh != null and zhbdh != ''">zhbdh = #{zhbdh},</if>
<if test="bgdh != null and bgdh != ''">bgdh = #{bgdh},</if>
<if test="cksx != null">cksx = #{cksx},</if>
<if test="ckxx != null">ckxx = #{ckxx},</if>
<if test="dyckz != null and dyckz != ''">dyckz = #{dyckz},</if>
<if test="dylx != null and dylx != ''">dylx = #{dylx},</if>
<if test="dyxh != null ">dyxh = #{dylx},</if>
<if test="zjf != null and zjf != ''">zjf = #{zjf},</if>
<if test="xmlb != null and xmlb != ''">xmlb = #{xmlb},</if>
<if test="xs != null ">xs = #{xs},</if>
<if test="xsws != null ">xsws = #{xsws},</if>
<if test="mrz != null and mrz != ''">mrz = #{mrz},</if>
<if test="jg != null ">jg = #{jg},</if>
<if test="cb != null ">cb = #{cb},</if>
<if test="dw != null and dw != ''">dw = #{dw},</if>
<if test="jsxm != null and jsxm != ''">jsxm = #{jsxm},</if>
<if test="jsgs != null and jsgs != ''">jsgs = #{jsgs},</if>
<if test="zkxm != null and zkxm != ''">zkxm = #{zkxm},</if>
<if test="sjx != null ">sjx = #{sjx},</if>
<if test="xjx != null ">xjx = #{xjx},</if>
<if test="ygxb != null and ygxb=''">ygxb = #{ygxb},</if>
<if test="ygnl != null and ygnl=''">ygnl = #{ygnl},</if>
<if test="ygbb != null and ygbb=''">ygbb = #{ygbb},</if>
<if test="lcyy != null and lcyy=''">lcyy = #{lcyy},</if>
<if test="jgbz != null and jgbz=''">jgbz = #{jgbz},</if>
<if test="jgjg != null" >jgjg = #{jgjg},</if>
<if test="jgz != null" >jgz = #{jgz},</if>
<if test="csff != null and csff != ''" >csff = #{csff},</if>
<if test="yymc != null and yymc != ''" >yymc = #{yymc},</if>
<if test="fzdyxh != null" >fzdyxh = #{fzdyxh},</if>
<if test="clinicref != null and clinicref != ''" >clinicref = #{clinicref},</if>
<if test="llimit != null " >llimit = #{llimit},</if>
<if test="hlimit != null " >hlimit = #{hlimit},</if>
<if test="xsbs != null " >xsbs = #{xsbs},</if>
<if test="redoxx != null " >redoxx = #{redoxx},</if>
<if test="redosx != null " >redosx = #{redosx},</if>
<if test="qcuselog != null and qcuselog != ''" >qcuselog = #{qcuselog},</if>
<if test="qcusepos != null and qcusepos != ''" >qcusepos = #{qcusepos},</if>
<if test="itemclass != null and itemclass != ''" >itemclass = #{itemclass},</if>
<if test="whocode != null and whocode != ''" >whocode = #{whocode},</if>
<if test="germflag != null and germflag != ''" >germflag = #{germflag},</if>
<if test="qccv != null " >qccv = #{qccv},</if>
<if test="qcvs != null and qcvs != ''" >qcvs = #{qcvs},</if>
<if test="knowledge != null and knowledge != ''" >knowledge = #{knowledge},</if>
<if test="ygzq != null and ygzq != ''" >ygzq = #{ygzq},</if>
<if test="ygzd != null and ygzd != ''" >ygzd = #{ygzd},</if>
<if test="xmgl != null and xmgl != ''" >xmgl = #{xmgl},</if>
<if test="yqdl != null and yqdl != ''" >yqdl = #{yqdl},</if>
<if test="uflag != null and uflag != ''" >uflag = #{uflag},</if>
<if test="val1 != null and val1 != ''" >val1 = #{val1},</if>
<if test="val2 != null and val2 != ''" >val2 = #{val2},</if>
<if test="val3 != null and val3 != ''" >val3 = #{val3},</if>
<if test="val4 != null and val4 != ''" >val4 = #{val4},</if>
<if test="val5 != null and val5 != ''" >val5 = #{val5},</if>
</set>
where xmid = #{xmid}
</update>
</mapper>

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.czlis.mzcx.mapper.FeeitemClassMapper">
<mapper namespace="com.czlis.mzcx.mapper.FeeitemVsClassMapper">
<select id="query" resultType="com.czlis.mzcx.pojo.LabFeeitemVsClass">
select * from lab_feeitem_vs_class