|
@@ -0,0 +1,154 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="org.springblade.business.mapper.EntrustInfoMapper">
|
|
|
+
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="entrustInfoResultMap" type="org.springblade.business.entity.EntrustInfo">
|
|
|
+ <result column="id" property="id"/>
|
|
|
+ <result column="create_user" property="createUser"/>
|
|
|
+ <result column="create_dept" property="createDept"/>
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
+ <result column="update_user" property="updateUser"/>
|
|
|
+ <result column="update_time" property="updateTime"/>
|
|
|
+ <result column="status" property="status"/>
|
|
|
+ <result column="is_deleted" property="isDeleted"/>
|
|
|
+ <result column="contract_id" property="contractId"/>
|
|
|
+ <result column="sample_id" property="sampleId"/>
|
|
|
+ <result column="entrust_info" property="entrustInfo"/>
|
|
|
+ <result column="entrust_no" property="entrustNo"/>
|
|
|
+ <result column="entrust_name" property="entrustName"/>
|
|
|
+ <result column="entrust_pdf" property="entrustPdf"/>
|
|
|
+ <result column="entrust_e_pdf" property="entrustEPdf"/>
|
|
|
+ <result column="exp_count" property="expCount"/>
|
|
|
+ <result column="entrust_time" property="entrustTime"/>
|
|
|
+ <result column="sample_time" property="sampleTime"/>
|
|
|
+ <result column="ctest_time" property="ctestTime"/>
|
|
|
+ <result column="repeal_reason" property="repealReason"/>
|
|
|
+ <result column="repeal_type" property="repealType"/>
|
|
|
+ <result column="resam_start_time" property="resamStartTime"/>
|
|
|
+ <result column="resam_end_time" property="resamEndTime"/>
|
|
|
+ <result column="repeal_time" property="repealTime"/>
|
|
|
+ <result column="sample_status" property="sampleStatus"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap id="entrustInfoResultVoMap" type="org.springblade.business.vo.EntrustInfoVO">
|
|
|
+ <result column="id" property="id"/>
|
|
|
+ <result column="create_user" property="createUser"/>
|
|
|
+ <result column="create_dept" property="createDept"/>
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
+ <result column="update_user" property="updateUser"/>
|
|
|
+ <result column="update_time" property="updateTime"/>
|
|
|
+ <result column="status" property="status"/>
|
|
|
+ <result column="is_deleted" property="isDeleted"/>
|
|
|
+ <result column="contract_id" property="contractId"/>
|
|
|
+ <result column="sample_id" property="sampleId"/>
|
|
|
+ <result column="entrust_info" property="entrustInfo"/>
|
|
|
+ <result column="entrust_no" property="entrustNo"/>
|
|
|
+ <result column="entrust_name" property="entrustName"/>
|
|
|
+ <result column="entrust_pdf" property="entrustPdf"/>
|
|
|
+ <result column="entrust_e_pdf" property="entrustEPdf"/>
|
|
|
+ <result column="exp_count" property="expCount"/>
|
|
|
+ <result column="nodeId" property="nodeId"/>
|
|
|
+ <result column="materialName" property="materialName"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectEntrustInfoPage" resultMap="entrustInfoResultVoMap">
|
|
|
+ SELECT a.*,b.node_id as nodeId,b.material_name as materialName ,
|
|
|
+ (SELECT max(c.id) from u_trial_self_inspection_record c where c.entrust_id = a.id) as testId
|
|
|
+ from u_entrust_info a LEFT JOIN u_trial_sample_info b on a.sample_id=b.id
|
|
|
+ where a.is_deleted = 0 and b.is_deleted=0
|
|
|
+ <if test="param2.nodeId != null">
|
|
|
+ and b.node_id = #{param2.nodeId}
|
|
|
+ </if>
|
|
|
+ <if test="param2.contractId != null">
|
|
|
+ and a.contract_id = #{param2.contractId}
|
|
|
+ </if>
|
|
|
+ <if test="param2.status != null">
|
|
|
+ and a.status = #{param2.status}
|
|
|
+ </if>
|
|
|
+ <if test="param2.entrustName != null and param2.entrustName != ''">
|
|
|
+ AND a.entrust_name like CONCAT(CONCAT('%', #{param2.entrustName}), '%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getReportDetail" resultType="org.springblade.business.vo.EntrustDataInfoVO">
|
|
|
+ SELECT a.id as id,a.entrust_info as entrustInfo,a.entrust_name as entrustName,b.material_name as materialName,
|
|
|
+ b.material_count as materialCount,b.specification_number as specificationNumber,a.exp_count as expCount,
|
|
|
+ b.specification_model as specificationModel, b.calculation_unit as calculationUnit
|
|
|
+ from u_entrust_info a , u_trial_sample_info b
|
|
|
+ where a.sample_id=b.id and a.is_deleted = 0 and b.is_deleted=0
|
|
|
+ and a.id=#{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="samplePage" resultType="org.springblade.business.vo.TrialSampleDataInfoVO">
|
|
|
+ SELECT a.id,b.*,(SELECT name from blade_user c where c.id=b.user_id) as userName,
|
|
|
+ a.ctest_time as ctestTime,a.exp_count as expCount, b.material_count-a.exp_count as sxCount,
|
|
|
+ CONCAT_WS('-', resam_start_time, resam_end_time) as resamTime,IF(resam_start_time is NULL,'否','是') as isSample,
|
|
|
+ a.repeal_reason as repealReason,a.repeal_time as repealTime,
|
|
|
+ (SELECT max(task_status) from u_trial_self_inspection_record c where c.entrust_id = a.id) as entrustStatusName,
|
|
|
+ (SELECT IF((max(task_status)) ='已审批',4,1) from u_trial_self_inspection_record c where c.entrust_id = a.id) as entrustStatus,
|
|
|
+ (SELECT max(c.id) from u_trial_self_inspection_record c where c.entrust_id = a.id) as testId
|
|
|
+ from u_entrust_info a , u_trial_sample_info b
|
|
|
+ where a.sample_id=b.id and a.is_deleted = 0 and b.is_deleted=0
|
|
|
+ and a.sample_status=#{param2.status}
|
|
|
+ <if test="param2.materialName != null and param2.materialName != ''">
|
|
|
+ AND b.material_name like CONCAT(CONCAT('%', #{param2.materialName}), '%')
|
|
|
+ </if>
|
|
|
+ <if test="param2.nodeId != null and param2.nodeId != ''">
|
|
|
+ AND b.node_id = #{param2.nodeId}
|
|
|
+ </if>
|
|
|
+ <if test="param2.contractId != null and param2.contractId != ''">
|
|
|
+ AND a.contract_id = #{param2.contractId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="selectDataInfoPage" resultType="org.springblade.business.vo.LoadDataInfoVO">
|
|
|
+ select * from u_view_gather_data_info a where 1=1
|
|
|
+
|
|
|
+ <if test="param2.testTypeName != null and param2.testTypeName != ''">
|
|
|
+ AND a.testTypeName like CONCAT(CONCAT('%', #{param2.testTypeName}), '%')
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="param2.startTime != null and param2.startTime != '' ">
|
|
|
+ and a.playTime >= #{param2.startTime}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="param2.endTime != null and param2.endTime != '' ">
|
|
|
+ and a.playTime <= #{param2.endTime}
|
|
|
+ </if>
|
|
|
+ <!-- 引用 –>
|
|
|
+ <if test="param2.dataStatus != null and param2.dataStatus != '' ">
|
|
|
+ and a.playTime <= #{param2.endTime}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <!– 合格 –>
|
|
|
+ <if test="param2.dataQualified != null and param2.dataQualified != '' ">
|
|
|
+ and a.dataStatus <= #{param2.endTime}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <!– 合同段 –>
|
|
|
+ <if test="param2.contractId != null and param2.contractId != '' ">
|
|
|
+ and a.dataStatus <= #{param2.endTime}
|
|
|
+ </if>-->
|
|
|
+
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDataInfoById" resultType="org.springblade.business.vo.LoadDataInfoVO">
|
|
|
+ select a.*,(SELECT dict_key from blade_dict_biz where id=(SELECT parent_id from blade_dict_biz where code='test_data_type' and dict_value=a.testTypeName)) as testTypePId
|
|
|
+ from u_view_gather_data_info a where a.id=#{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <delete id="delEntrustInfo" >
|
|
|
+ delete from u_entrust_info where id in
|
|
|
+ <foreach collection="ids" item="id" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ and status !=2
|
|
|
+ and id not in(SELECT entrust_id from u_trial_self_inspection_record where is_deleted=0)
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|