质控图
This commit is contained in:
parent
9def14daf3
commit
60c88d93f3
@ -19,6 +19,7 @@ public class ComStatsParameter {
|
|||||||
private String paramDefvalue;
|
private String paramDefvalue;
|
||||||
private String paramSql;
|
private String paramSql;
|
||||||
private String paramHide;
|
private String paramHide;
|
||||||
|
private String precondition;
|
||||||
private Long paramSequence;
|
private Long paramSequence;
|
||||||
private Long paramSort;
|
private Long paramSort;
|
||||||
private String status;
|
private String status;
|
||||||
|
|||||||
@ -29,4 +29,9 @@ public class QcGraphController extends BaseController {
|
|||||||
public Result query(QcGraphParamDTO qcGraphParamDTO) {
|
public Result query(QcGraphParamDTO qcGraphParamDTO) {
|
||||||
return qcGraphService.query(qcGraphParamDTO);
|
return qcGraphService.query(qcGraphParamDTO);
|
||||||
}
|
}
|
||||||
|
@ApiOperation("计算靶值")
|
||||||
|
@GetMapping("/calc")
|
||||||
|
public Result calc(QcGraphParamDTO qcGraphParamDTO) {
|
||||||
|
return qcGraphService.calc(qcGraphParamDTO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,5 +17,6 @@ public interface QcGraphMapper {
|
|||||||
List<QcValDTO> query8(QcGraphParamDTO qcGraphParamDTO);
|
List<QcValDTO> query8(QcGraphParamDTO qcGraphParamDTO);
|
||||||
List<QcValDTO> query9(QcGraphParamDTO qcGraphParamDTO);
|
List<QcValDTO> query9(QcGraphParamDTO qcGraphParamDTO);
|
||||||
List<QcValDTO> query0(QcGraphParamDTO qcGraphParamDTO);
|
List<QcValDTO> query0(QcGraphParamDTO qcGraphParamDTO);
|
||||||
|
List<QcMonthstDTO> calc(QcGraphParamDTO qcGraphParamDTO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,7 +56,7 @@ public interface ComStatsParameterMapper {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int updateComStatsParameter(ComStatsParameter Dict);
|
int updateComStatsParameter(ComStatsParameter Dict);
|
||||||
|
int updateComStatsParameterall(ComStatsParameter Dict);
|
||||||
/**
|
/**
|
||||||
* 新增统计参数信息
|
* 新增统计参数信息
|
||||||
*
|
*
|
||||||
|
|||||||
@ -6,5 +6,5 @@ import com.czlis.liswork.pojo.DTO.QcGraphParamDTO;
|
|||||||
public interface QcGraphService {
|
public interface QcGraphService {
|
||||||
Result querysample(QcGraphParamDTO qcGraphParamDTO);
|
Result querysample(QcGraphParamDTO qcGraphParamDTO);
|
||||||
Result query(QcGraphParamDTO qcGraphParamDTO);
|
Result query(QcGraphParamDTO qcGraphParamDTO);
|
||||||
Result queryhead(QcGraphParamDTO qcGraphParamDTO);
|
Result calc(QcGraphParamDTO qcGraphParamDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,18 +66,8 @@ public class QcGraphServiceImpl implements QcGraphService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result queryhead(QcGraphParamDTO qcGraphParamDTO){
|
public Result calc(QcGraphParamDTO qcGraphParamDTO){
|
||||||
List<QcMonthstDTO> QcSamplelist=qcGraphMapper.queryhead(qcGraphParamDTO);
|
List<QcMonthstDTO> QcSamplelist=qcGraphMapper.calc(qcGraphParamDTO);
|
||||||
List<QcMonthstDTO> QcSamplelist3=qcGraphMapper.queryhead3(qcGraphParamDTO);
|
|
||||||
for(QcMonthstDTO qcMonthstDTO:QcSamplelist){
|
|
||||||
String xmdh=qcMonthstDTO.getXmdh();
|
|
||||||
Optional<QcMonthstDTO> monthst0=QcSamplelist3.stream().filter(ss->xmdh.equals(ss.getXmdh())).findAny();
|
|
||||||
if(monthst0.isPresent()) {
|
|
||||||
qcMonthstDTO.setAvg3(monthst0.get().getAvg3());
|
|
||||||
qcMonthstDTO.setCv3(monthst0.get().getCv3());
|
|
||||||
qcMonthstDTO.setSd3(monthst0.get().getSd3());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return new Result("0","成功",QcSamplelist);
|
return new Result("0","成功",QcSamplelist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,6 +139,6 @@ public class ComStatsParameterServiceImpl implements ComStatsParameterService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateParam(ComStatsParameter Param) {
|
public int updateParam(ComStatsParameter Param) {
|
||||||
return comStatsParameterMapper.updateComStatsParameter(Param);
|
return comStatsParameterMapper.updateComStatsParameterall(Param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
<result property="paramSql" column="param_sql" />
|
<result property="paramSql" column="param_sql" />
|
||||||
<result property="paramHide" column="param_hide" />
|
<result property="paramHide" column="param_hide" />
|
||||||
<result property="paramSequence" column="param_sequence" />
|
<result property="paramSequence" column="param_sequence" />
|
||||||
|
<result property="precondition" column="precondition" />
|
||||||
<result property="paramSort" column="param_sort" />
|
<result property="paramSort" column="param_sort" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
@ -23,7 +24,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="selectComStatsParameterVo">
|
<sql id="selectComStatsParameterVo">
|
||||||
select param_id,param_type,param_code,param_name,param_optiontype,param_sql,param_hide,param_sort,stats_code,param_defvalue,param_sequence,
|
select param_id,param_type,param_code,param_name,param_optiontype,param_sql,param_hide,param_sort,stats_code,param_defvalue,param_sequence,
|
||||||
status,create_by,create_time,update_by,update_time,remark from Com_param_Parameter
|
status,create_by,create_time,update_by,update_time,remark,precondition from Com_stats_parameter
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectComStatsParameterList" resultMap="ComStatsParameterResult" parameterType="com.czlis.common.core.domain.entity.lis.ComStatsParameter" >
|
<select id="selectComStatsParameterList" resultMap="ComStatsParameterResult" parameterType="com.czlis.common.core.domain.entity.lis.ComStatsParameter" >
|
||||||
<include refid="selectComStatsParameterVo"></include>
|
<include refid="selectComStatsParameterVo"></include>
|
||||||
@ -50,7 +51,7 @@
|
|||||||
order by param_sort ASC
|
order by param_sort ASC
|
||||||
</select>
|
</select>
|
||||||
<select id="getCountById" resultType="Long">
|
<select id="getCountById" resultType="Long">
|
||||||
select count(1) from Com_param_Parameter where param_id = #{paramId}
|
select count(1) from Com_stats_parameter where param_id = #{paramId}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectComStatsParameterAll" resultMap="ComStatsParameterResult">
|
<select id="selectComStatsParameterAll" resultMap="ComStatsParameterResult">
|
||||||
<include refid="selectComStatsParameterVo"/>
|
<include refid="selectComStatsParameterVo"/>
|
||||||
@ -70,20 +71,20 @@
|
|||||||
|
|
||||||
<select id="checkDictNameUnique" parameterType="String" resultMap="ComStatsParameterResult">
|
<select id="checkDictNameUnique" parameterType="String" resultMap="ComStatsParameterResult">
|
||||||
select top 1 param_id,param_type,param_code,param_name,param_optiontype,param_sql,param_sort,param_hide,stats_code,param_defvalue,param_sequence,
|
select top 1 param_id,param_type,param_code,param_name,param_optiontype,param_sql,param_sort,param_hide,stats_code,param_defvalue,param_sequence,
|
||||||
status,create_by,create_time,update_by,update_time,remark
|
status,create_by,create_time,update_by,update_time,remark,precondition
|
||||||
from Com_param_Parameter
|
from Com_stats_parameter
|
||||||
where param_name=#{paramName} and param_type = #{paramType} and stats_code = #{statsCode}
|
where param_name=#{paramName} and param_type = #{paramType} and stats_code = #{statsCode}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkDictCodeUnique" parameterType="String" resultMap="ComStatsParameterResult">
|
<select id="checkDictCodeUnique" parameterType="String" resultMap="ComStatsParameterResult">
|
||||||
select top 1 param_id,param_type,param_code,param_name,param_optiontype,param_sql,
|
select top 1 param_id,param_type,param_code,param_name,param_optiontype,param_sql,
|
||||||
param_sort,param_hide,stats_code,param_defvalue,param_sequence,
|
param_sort,param_hide,stats_code,param_defvalue,param_sequence,
|
||||||
status,create_by,create_time,update_by,update_time,remark
|
status,create_by,create_time,update_by,update_time,remark,precondition
|
||||||
from Com_param_Parameter
|
from Com_stats_parameter
|
||||||
where param_code=#{paramCode} and param_type = #{paramType} and stats_code = #{statsCode}
|
where param_code=#{paramCode} and param_type = #{paramType} and stats_code = #{statsCode}
|
||||||
</select>
|
</select>
|
||||||
<insert id="insertComStatsParameter" parameterType="com.czlis.common.core.domain.entity.lis.ComStatsParameter" useGeneratedKeys="true" keyProperty="paramId">
|
<insert id="insertComStatsParameter" parameterType="com.czlis.common.core.domain.entity.lis.ComStatsParameter" useGeneratedKeys="true" keyProperty="paramId">
|
||||||
insert into Com_param_Parameter(
|
insert into Com_stats_parameter(
|
||||||
<if test="paramId != null and paramId != 0">param_id,</if>
|
<if test="paramId != null and paramId != 0">param_id,</if>
|
||||||
<if test="statsCode != null and statsCode != ''">stats_code,</if>
|
<if test="statsCode != null and statsCode != ''">stats_code,</if>
|
||||||
<if test="paramType != null and paramType != ''">param_type,</if>
|
<if test="paramType != null and paramType != ''">param_type,</if>
|
||||||
@ -91,6 +92,7 @@
|
|||||||
<if test="paramName != null and paramName != ''">param_name,</if>
|
<if test="paramName != null and paramName != ''">param_name,</if>
|
||||||
<if test="paramOptiontype != null and paramOptiontype != ''">param_optiontype,</if>
|
<if test="paramOptiontype != null and paramOptiontype != ''">param_optiontype,</if>
|
||||||
<if test="paramDefvalue != null and paramDefvalue != ''">param_defvalue,</if>
|
<if test="paramDefvalue != null and paramDefvalue != ''">param_defvalue,</if>
|
||||||
|
<if test="precondition != null and precondition != ''">precondition,</if>
|
||||||
<if test="paramSequence != null ">param_sequence,</if>
|
<if test="paramSequence != null ">param_sequence,</if>
|
||||||
<if test="paramSql != null and paramSql != ''">param_sql,</if>
|
<if test="paramSql != null and paramSql != ''">param_sql,</if>
|
||||||
<if test="paramHide != null and paramHide != ''">param_hide ,</if>
|
<if test="paramHide != null and paramHide != ''">param_hide ,</if>
|
||||||
@ -107,6 +109,7 @@
|
|||||||
<if test="paramName != null and paramName != ''">#{paramName},</if>
|
<if test="paramName != null and paramName != ''">#{paramName},</if>
|
||||||
<if test="paramOptiontype != null and paramOptiontype != ''">#{paramOptiontype},</if>
|
<if test="paramOptiontype != null and paramOptiontype != ''">#{paramOptiontype},</if>
|
||||||
<if test="paramDefvalue != null and paramDefvalue != ''">#{paramDefvalue},</if>
|
<if test="paramDefvalue != null and paramDefvalue != ''">#{paramDefvalue},</if>
|
||||||
|
<if test="precondition != null and precondition != ''">#{precondition},</if>
|
||||||
<if test="paramSequence != null ">#{paramSequence},</if>
|
<if test="paramSequence != null ">#{paramSequence},</if>
|
||||||
<if test="paramSql != null and paramSql != ''">#{paramSql},</if>
|
<if test="paramSql != null and paramSql != ''">#{paramSql},</if>
|
||||||
<if test="paramHide != null and paramHide != ''">#{paramHide},</if>
|
<if test="paramHide != null and paramHide != ''">#{paramHide},</if>
|
||||||
@ -119,18 +122,29 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<delete id="delComStatsParameterById" parameterType="Long">
|
<delete id="delComStatsParameterById" parameterType="Long">
|
||||||
delete from Com_param_Parameter where param_id = #{paramId}
|
delete from Com_stats_parameter where param_id = #{paramId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="delComStatsParameterByIds" parameterType="Long">
|
<delete id="delComStatsParameterByIds" parameterType="Long">
|
||||||
delete from Com_param_Parameter where param_id in
|
delete from Com_stats_parameter where param_id in
|
||||||
<foreach collection="array" item="paramId" open="(" separator="," close=")">
|
<foreach collection="array" item="paramId" open="(" separator="," close=")">
|
||||||
#{paramId}
|
#{paramId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<update id="updateComStatsParameterall" parameterType="com.czlis.common.core.domain.entity.lis.ComStatsParameter">
|
||||||
|
update Com_stats_parameter
|
||||||
|
set param_type = #{paramType}, stats_code= #{statsCode},
|
||||||
|
param_code = #{paramCode},param_name = #{paramName},
|
||||||
|
param_optiontype = #{paramOptiontype},param_defvalue= #{paramDefvalue},
|
||||||
|
param_sequence= #{paramSequence},precondition=#{precondition},
|
||||||
|
param_sql = #{paramSql},param_hide = #{paramHide},
|
||||||
|
param_sort = #{paramSort},status = #{status},
|
||||||
|
remark = #{remark},update_by = #{updateBy},update_time = getdate()
|
||||||
|
where param_id = #{paramId}
|
||||||
|
</update>
|
||||||
<update id="updateComStatsParameter" parameterType="com.czlis.common.core.domain.entity.lis.ComStatsParameter">
|
<update id="updateComStatsParameter" parameterType="com.czlis.common.core.domain.entity.lis.ComStatsParameter">
|
||||||
update Com_param_Parameter
|
update Com_stats_parameter
|
||||||
<set>
|
<set>
|
||||||
<if test="paramType != null and paramType != ''">param_type = #{paramType},</if>
|
<if test="paramType != null and paramType != ''">param_type = #{paramType},</if>
|
||||||
<if test="statsCode != null and statsCode != ''">stats_code= #{statsCode},</if>
|
<if test="statsCode != null and statsCode != ''">stats_code= #{statsCode},</if>
|
||||||
@ -150,5 +164,4 @@
|
|||||||
where param_id = #{paramId}
|
where param_id = #{paramId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -147,7 +147,20 @@
|
|||||||
group by qc_val.yq,qc_val.zkph,qc_val.xmdh,xm_info.xmmc,xm_info.dyxh,qc_sample.zkbz,qc_sample.sd,qc_sample.cv
|
group by qc_val.yq,qc_val.zkph,qc_val.xmdh,xm_info.xmmc,xm_info.dyxh,qc_sample.zkbz,qc_sample.sd,qc_sample.cv
|
||||||
order by xm_info.dyxh,qc_val.zkph
|
order by xm_info.dyxh,qc_val.zkph
|
||||||
</select>
|
</select>
|
||||||
|
<select id="calc" resultType="com.czlis.liswork.pojo.DTO.QcMonthstDTO">
|
||||||
|
SELECT qc_val.yq,qc_val.xmdh,qc_val.zkph,count(1) cnt,
|
||||||
|
cast(avg(zkjg) as decimal(12, 3)) avg1,
|
||||||
|
cast(STDEV(zkjg) as decimal(12, 3)) sd1
|
||||||
|
FROM qc_val
|
||||||
|
<where>
|
||||||
|
<if test="yq != null and yq !=''">and qc_val.yq = #{yq}</if>
|
||||||
|
<if test="xmdh != null and xmdh !=''">and qc_val.xmdh = #{xmdh}</if>
|
||||||
|
<if test="zkph != null ">and qc_val.zkph=#{zkph}</if>
|
||||||
|
<if test="zkrq1 != null">and qc_val.zkrq>= #{zkrq1} </if>
|
||||||
|
<if test="zkrq2 != null">and #{zkrq2}>= qc_val.zkrq </if>
|
||||||
|
</where>
|
||||||
|
group by qc_val.yq,qc_val.zkph,qc_val.xmdh
|
||||||
|
</select>
|
||||||
<select id="queryhead3" resultType="com.czlis.liswork.pojo.DTO.QcMonthstDTO">
|
<select id="queryhead3" resultType="com.czlis.liswork.pojo.DTO.QcMonthstDTO">
|
||||||
SELECT qc_val.yq,qc_val.xmdh,qc_val.zkph,count(1) cnt3,cast(avg(zkjg) as decimal(12, 3)) avg3,
|
SELECT qc_val.yq,qc_val.xmdh,qc_val.zkph,count(1) cnt3,cast(avg(zkjg) as decimal(12, 3)) avg3,
|
||||||
cast(STDEV(zkjg) as decimal(12, 3)) sd3,cast(100*STDEV(zkjg)/avg(zkjg) as decimal(12, 3)) as cv3
|
cast(STDEV(zkjg) as decimal(12, 3)) sd3,cast(100*STDEV(zkjg)/avg(zkjg) as decimal(12, 3)) as cv3
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user