From 0d98e9c2d06c5d8b7b6de5ec433a12713744ae6b Mon Sep 17 00:00:00 2001
From: 李林 <z1292839451@163.com>
Date: 星期一, 18 三月 2024 01:04:38 +0800
Subject: [PATCH] 功能大调整
---
inspect-server/src/main/resources/mapper/InsOrderMapper.xml | 112 ++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 76 insertions(+), 36 deletions(-)
diff --git a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
index 9b12881..3a6a8cb 100644
--- a/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
+++ b/inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -3,40 +3,22 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.mom.mapper.InsOrderMapper">
-
<resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.InsOrder">
- <id property="id" column="id" jdbcType="INTEGER"/>
- <result property="entrustCode" column="entrust_code" jdbcType="VARCHAR"/>
- <result property="sampleCode" column="sample_code" jdbcType="VARCHAR"/>
- <result property="custom" column="custom" jdbcType="VARCHAR"/>
- <result property="company" column="company" jdbcType="VARCHAR"/>
- <result property="type" column="type" jdbcType="INTEGER"/>
- <result property="appointedTime" column="appointed_time" jdbcType="TIMESTAMP"/>
- <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/>
- <result property="smapleType" column="smaple_type" jdbcType="VARCHAR"/>
- <result property="model" column="model" jdbcType="VARCHAR"/>
- <result property="sample" column="sample" jdbcType="VARCHAR"/>
- <result property="sampleNum" column="sample_num" jdbcType="INTEGER"/>
- <result property="isLeave" column="is_leave" jdbcType="INTEGER"/>
- <result property="leaveNum" column="leave_num" jdbcType="INTEGER"/>
- <result property="insProgress" column="ins_progress" jdbcType="VARCHAR"/>
- <result property="insResult" column="ins_result" jdbcType="VARCHAR"/>
- <result property="state" column="state" jdbcType="INTEGER"/>
- <result property="createUser" column="create_user" jdbcType="INTEGER"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="updateUser" column="update_user" jdbcType="INTEGER"/>
- <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+ <id property="id" column="id" jdbcType="INTEGER"/>
+ <result property="entrustCode" column="entrust_code" jdbcType="VARCHAR"/>
+ <result property="custom" column="custom" jdbcType="VARCHAR"/>
+ <result property="company" column="company" jdbcType="VARCHAR"/>
+ <result property="code" column="code" jdbcType="VARCHAR"/>
+ <result property="type" column="type" jdbcType="INTEGER"/>
+ <result property="appointed" column="appointed" jdbcType="TIMESTAMP"/>
+ <result property="state" column="state" jdbcType="INTEGER"/>
+ <result property="remark" column="remark" jdbcType="VARCHAR"/>
+ <result property="otcCode" column="otc_code" jdbcType="VARCHAR"/>
+ <result property="createUser" column="create_user" jdbcType="INTEGER"/>
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+ <result property="updateUser" column="update_user" jdbcType="INTEGER"/>
+ <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
-
- <sql id="Base_Column_List">
- id,entrust_code,sample_code,
- custom,company,type,
- appointed_time,laboratory,smaple_type,
- model,sample,sample_num,
- is_leave,leave_num,ins_progress,
- ins_result,state,create_user,
- create_time,update_user,update_time
- </sql>
<resultMap id="OrderThingDto" type="com.yuanchu.mom.dto.OrderThingDto">
<result property="id" column="id"/>
@@ -68,9 +50,67 @@
<result property="remark" column="remark"/>
</resultMap>
- <select id="getOrderThing" resultMap="OrderThingDto">
- select * from ins_order io
- left join ins_product ip on ip.ins_order_id = io.id
- left join ins_product_result ipr on ip.id = ipr.ins_product_id
+ <select id="selectInsOrderParameter" resultType="com.yuanchu.mom.pojo.InsOrder">
+ select *
+ from (
+ select
+ id,
+ appointed,
+ user_id,
+ create_user,
+ otc_code,
+ code,
+ custom,
+ update_user,
+ update_time,
+ type,
+ entrust_code,
+ company,
+ remark,
+ create_time,
+ state
+ from ins_order
+ ) a
+ <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
+ ${ew.customSqlSegment}
+ </if>
</select>
+ <select id="selectInsOrderPage" resultType="com.yuanchu.mom.dto.SampleOrderDto">
+ select *
+ from (
+ select io.*,isa.id sampleId,isa.sample_code,isa.sample,isa.ins_progress,ir.id report_id,isa.send_time
+ from ins_order io
+ left join ins_sample isa on io.id = isa.ins_order_id
+ left join (select id, ins_order_id, is_ratify
+ from ins_report
+ where is_ratify = 1) ir on io.id = ir.ins_order_id
+ ) a
+ <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
+ ${ew.customSqlSegment}
+ </if>
+ </select>
+
+ <update id="upInsOrderParameter" parameterType="com.yuanchu.mom.pojo.InsOrder">
+ UPDATE ins_order
+ <set>
+ <if test="appointed!=null and appointed!='' ">appointed=#{appointed},</if>
+ <if test="userId!=null ">user_id=#{userId},</if>
+ <if test="createUser!=null ">create_user=#{createUser}</if>
+ <if test="otcCode!=null ">otc_code=#{otcCode}</if>
+ <if test="code!=null ">code=#{code}</if>
+ <if test="custom!=null ">custom=#{custom}</if>
+ <if test="updateUser!=null ">update_user=#{updateUser}</if>
+ <if test="updateTime!=null ">update_time=#{updateTime}</if>
+ <if test="type!=null ">type=#{type}</if>
+ <if test="entrustCode!=null ">entrust_code=#{entrustCode}</if>
+ <if test="company!=null ">company=#{company}</if>
+ <if test="remark!=null ">remark=#{remark}</if>
+ <if test="createTime!=null ">create_time=#{createTime}</if>
+ <if test="state!=null ">state=#{state}</if>
+ </set>
+ <where>
+ id=#{id}
+ </where>
+ </update>
+
</mapper>
--
Gitblit v1.9.3