| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.InsOrderStateMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.InsOrderState"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="insOrderId" column="ins_order_id" jdbcType="INTEGER"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="insState" column="ins_state" jdbcType="INTEGER"/> |
| | | <result property="sort" column="sort" 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"/> |
| | | <result property="sortTime" column="sort_time" jdbcType="TIMESTAMP"/> |
| | | <id property="id" column="idd" jdbcType="INTEGER"/> |
| | | <result property="insOrderId" column="ins_order_id" jdbcType="INTEGER"/> |
| | | <result property="insSampleId" column="ins_sample_id" jdbcType="INTEGER"/> |
| | | <result property="laboratory" column="laboratory" jdbcType="VARCHAR"/> |
| | | <result property="insState" column="ins_state" jdbcType="INTEGER"/> |
| | | <result property="sort" column="sort" jdbcType="INTEGER"/> |
| | | <result property="version" column="version" 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"/> |
| | | <result property="sortTime" column="sort_time" jdbcType="TIMESTAMP"/> |
| | | <collection property="insOrderUserList" resultMap="insOrderUsers"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,ins_order_id,laboratory, |
| | | ins_state,create_user,create_time, |
| | | update_user,update_time,sort,sort_time |
| | | </sql> |
| | | <resultMap id="insOrderUsers" type="com.yuanchu.mom.pojo.InsOrderUser"> |
| | | <id column="id" property="id"/> |
| | | <result column="submit_user" property="submitUser"/> |
| | | <result column="submitUserName" property="submitUserName"/> |
| | | <result column="submit_time" property="submitTime"/> |
| | | <result column="num" property="num"/> |
| | | <result column="note" property="note"/> |
| | | <result column="term" property="term"/> |
| | | <result column="tell" property="tell"/> |
| | | </resultMap> |
| | | <select id="getInsOrderStateCount" resultMap="BaseResultMap"> |
| | | select ios.id idd, laboratory, version, iou.*, name submitUserName |
| | | from ins_order_state ios |
| | | left join ins_order_user iou on ios.id = iou.ins_order_state_id |
| | | left join user on submit_user = user.id |
| | | where ios.ins_order_id = #{id} |
| | | and ios.ins_sample_id = #{sampleId} |
| | | </select> |
| | | </mapper> |