<?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="com.yuanchu.mom.mapper.ProcessInspectMapper">
|
<!--新增过程检验单-根据订单号选择产品信息和工艺-->
|
<resultMap id="oneMap" type="map">
|
<id property="name" column="material"/>
|
<result property="code" column="code"/>
|
<result property="specifications" column="specifications"/>
|
<result property="unit" column="unit"/>
|
<collection property="children" resultMap="twoMap" javaType="List"/>
|
</resultMap>
|
<resultMap id="twoMap" type="map">
|
<result property="name" column="techfather"/>
|
<collection property="children" resultMap="threeMap" javaType="List"/>
|
</resultMap>
|
<resultMap id="threeMap" type="map">
|
<id property="id" column="technologyId"/>
|
<result property="name" column="techname"/>
|
</resultMap>
|
<select id="chooseMater" resultMap="oneMap">
|
select mo.name material,
|
code,
|
specifications,
|
unit,
|
technology_id technologyId,
|
techfather,
|
techname
|
from mom_ocean.manual_technology mt
|
left join mom_ocean.manufacture_order mo on mt.manufacture_order_id = mo.id
|
left join mom_ocean.material m on m.name = mo.name
|
where mo.state = 1
|
and type = 1
|
and order_code = #{orderNumber}
|
</select>
|
|
<!--根据检验单id查询过程检验单详情-->
|
<resultMap id="seProInsListById" type="map">
|
<id property="name" column="order_number"/>
|
<result property="materialCode" column="material_code"/>
|
<result property="material" column="material"/>
|
<result property="specifications" column="specifications_model"/>
|
<result property="techfather" column="techfather"/>
|
<result property="techname" column="techname"/>
|
<result property="punit" column="punit"/>
|
<result property="quantity" column="quantity"/>
|
<result property="presult" column="presult"/>
|
<collection property="children" resultMap="seProInsListByIdmap" javaType="List"/>
|
</resultMap>
|
<resultMap id="seProInsListByIdmap" type="map">
|
<result property="ifather" column="ifather"/>
|
<collection property="children" resultMap="seProInsListByIdmaps" javaType="List"/>
|
</resultMap>
|
<resultMap id="seProInsListByIdmaps" type="map">
|
<id property="iid" column="iid"/>
|
<result property="iname" column="iname"/>
|
<result property="iunit" column="iunit"/>
|
<result property="required" column="required"/>
|
<result property="internal" column="internal"/>
|
<result property="inspectionValue" column="inspection_value"/>
|
<result property="dname" column="dname"/>
|
<result property="iresult" column="iresult"/>
|
<result property="username" column="username"/>
|
</resultMap>
|
<select id="selectProcessInspectsListById" resultMap="seProInsListById">
|
select order_number,
|
material_code,
|
material,
|
specifications_model,
|
techfather,
|
techname,
|
pi.unit punit,
|
quantity,
|
ii.id iid,
|
ii.father ifather,
|
ii.name iname,
|
ii.unit iunit,
|
required,
|
internal,
|
inspection_value,
|
device.name dname,
|
ii.result iresult,
|
username,
|
pi.result presult
|
from mom_ocean.inspection_item ii
|
left join mom_ocean.process_inspect pi on pi.id = inspect_id
|
left join mom_ocean.device on ii.device_id = device.id
|
where ii.type = 1
|
and ii.state = 1
|
and pi.state = 1
|
and pi.id = #{id}
|
</select>
|
<!--分页查询过程检验单列表-->
|
<select id="selectProcessInspectsList" resultType="java.util.Map">
|
select process_inspect.id,
|
order_number,
|
material_code,
|
material,
|
specifications_model,
|
techfather,
|
techname,
|
unit,
|
quantity,
|
DATE_FORMAT(process_inspect.create_time, '%Y-%m-%d') createTime,
|
name,
|
DATE_FORMAT(process_inspect.update_time, '%Y-%m-%d') updateTime,
|
result
|
from mom_ocean.process_inspect
|
left join mom_ocean.user on process_inspect.user_id = user.id
|
where process_inspect.state = 1
|
<if test="techfather!=null and techfather!=''">
|
and techfather like concat('%',#{techfather},'%')
|
</if>
|
<if test="name!=null and name!=''">
|
and material like concat('%',#{name},'%')
|
</if>
|
<if test="result!=null ">
|
and result =#{result}
|
</if>
|
</select>
|
</mapper>
|