<?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.TechniqueMapper">
|
<!--根据型号id查询所有版本-->
|
<select id="selectVerByTeq" resultType="java.lang.Integer">
|
select distinct version
|
from mom_ocean.technique
|
where state = 1
|
and technology_id in (select id
|
from mom_ocean.technology
|
where technology.state = 1
|
and specifications_id = #{specificationsId})
|
order by version desc
|
</select>
|
|
<!--右侧数据展示 生产工艺-->
|
<resultMap id="oneMap" type="map">
|
<id property="father" column="father"/>
|
<collection property="children" resultMap="twoMap" javaType="List"/>
|
</resultMap>
|
<resultMap id="twoMap" type="map">
|
<id property="name" column="name"/>
|
<collection property="children" resultMap="threeMap" javaType="List"/>
|
</resultMap>
|
<resultMap id="threeMap" type="map">
|
<id property="tqid" column="tqid"/>
|
<result property="device" column="device"/>
|
<result property="productFather" column="product_father"/>
|
<result property="product" column="product"/>
|
<result property="unit" column="unit"/>
|
</resultMap>
|
<select id="selectAllTeq" resultMap="oneMap">
|
select tq.id tqid,
|
device,
|
product_father,
|
product,
|
unit,
|
name,
|
father
|
from mom_ocean.technique tq
|
left join mom_ocean.technology tc on tq.technology_id = tc.id
|
where tq.state = 1
|
and specifications_id = #{specificationsId}
|
and tq.version = #{version}
|
<if test="message!=null and message!=''">
|
and device like concat('%',#{message},'%')
|
</if>
|
</select>
|
</mapper>
|