| | |
| | | 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="orderingCustomers" column="ordering_customers" jdbcType="VARCHAR"/> |
| | | <result property="orderingUnit" column="ordering_unit" jdbcType="VARCHAR"/> |
| | | <result property="urgency" column="urgency" jdbcType="VARCHAR"/> |
| | | <result property="appointedTime" column="appointed_time" jdbcType="TIMESTAMP"/> |
| | | <result property="laboratoryName" column="laboratory_name" jdbcType="VARCHAR"/> |
| | | <result property="sampleClassification" column="sample_classification" jdbcType="VARCHAR"/> |
| | | <result property="model" column="model" jdbcType="VARCHAR"/> |
| | | <result property="sample" column="sample" jdbcType="VARCHAR"/> |
| | | <result property="numberSamples" column="number_samples" jdbcType="INTEGER"/> |
| | | <result property="leaveSample" column="leave_sample" jdbcType="VARCHAR"/> |
| | | <result property="retainedSamples" column="retained_samples" jdbcType="INTEGER"/> |
| | | <result property="smapleType" column="smaple_type" jdbcType="VARCHAR"/> |
| | | <result property="entrustCompany" column="entrust_company" jdbcType="VARCHAR"/> |
| | | <result property="entrustName" column="entrust_name" jdbcType="VARCHAR"/> |
| | | <result property="documentTime" column="document_time" jdbcType="TIMESTAMP"/> |
| | | <result property="entrustmentTime" column="entrustment_time" jdbcType="TIMESTAMP"/> |
| | | <result property="inspectionProgress" column="inspection_progress" jdbcType="VARCHAR"/> |
| | | <result property="inspectionResult" column="inspection_result" 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"/> |
| | | <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, |
| | | ordering_customers,ordering_unit,urgency, |
| | | appointed_time,laboratory_name,sample_classification, |
| | | model,sample,number_samples, |
| | | leave_sample,retained_samples,smaple_type, |
| | | entrust_company,entrust_name,document_time, |
| | | entrustment_time,inspection_progress,inspection_result, |
| | | create_user,create_time,update_user, |
| | | update_time |
| | | </sql> |
| | | <resultMap id="OrderThingDto" type="com.yuanchu.mom.dto.OrderThingDto"> |
| | | <result property="id" column="id"/> |
| | | <result property="company" column="company"/> |
| | | <result property="entrustCode" column="entrust_code"/> |
| | | <result property="sampleCode" column="sample_code"/> |
| | | <result property="custom" column="custom"/> |
| | | <result property="sample" column="sample"/> |
| | | <result property="model" column="model"/> |
| | | <result property="sampleNum" column="sample_num"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="insResult" column="ins_result"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <collection property="products" resultMap="ProductThingDto"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ProductThingDto" type="com.yuanchu.mom.dto.ProductThingDto"> |
| | | <result property="productId" column="id"/> |
| | | <result property="inspectionItem" column="inspection_item"/> |
| | | <result property="lastValue" column="last_value"/> |
| | | <result property="insResult" column="ins_result"/> |
| | | <collection property="productResults" resultMap="productResultDto"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="productResultDto" type="com.yuanchu.mom.dto.productResultDto"> |
| | | <result property="id" column="id"/> |
| | | <result property="insValue" column="ins_value"/> |
| | | <result property="insResult" column="ins_result"/> |
| | | <result property="remark" column="remark"/> |
| | | </resultMap> |
| | | |
| | | <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> |