| | |
| | | <?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.TechnologyMapper"> |
| | | <!--根据型号id查询版本--> |
| | | <select id="selectVerByTec" resultType="java.lang.Integer"> |
| | | select distinct version |
| | | from mom_ocean.technology |
| | | where state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | order by version desc |
| | | </select> |
| | | |
| | | <!--右侧数据展示 工艺路线--> |
| | | <resultMap id="selectAllTecMap" type="map"> |
| | | <id property="father" column="father"/> |
| | | <collection property="children" resultMap="selectAllTecMaps" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="selectAllTecMaps" type="map"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | <result property="dg" column="dg"/> |
| | | <result property="pq" column="pq"/> |
| | | </resultMap> |
| | | <select id="selectAllTec" resultMap="selectAllTecMap"> |
| | | select id, |
| | | name, |
| | | father, |
| | | device_group dg, |
| | | production_quota pq |
| | | from mom_ocean.technology |
| | | where state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | and version = #{version} |
| | | <if test="message!=null and message!=''"> |
| | | and name like concat('%',#{message},'%') |
| | | </if> |
| | | </select> |
| | | |
| | | <!--右上角新增-工艺路线-选择工序--> |
| | | <select id="chooseFather" resultType="java.util.Map"> |
| | | select distinct father |
| | | from mom_ocean.technology |
| | | where state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | and version = #{version} |
| | | </select> |
| | | |
| | | <!--右上角新增-技术指标-选择工序,工艺--> |
| | | <resultMap id="chooseTechMap" type="map"> |
| | | <id property="name" column="father"/> |
| | | <collection property="children" resultMap="chooseTechMaps" javaType="List"/> |
| | | </resultMap> |
| | | <resultMap id="chooseTechMaps" type="map"> |
| | | <id property="id" column="id"/> |
| | | <result property="name" column="name"/> |
| | | </resultMap> |
| | | <select id="chooseTech" resultMap="chooseTechMap"> |
| | | select id, |
| | | name, |
| | | father |
| | | from mom_ocean.technology |
| | | where state = 1 |
| | | and specifications_id = #{specificationsId} |
| | | and version = #{version} |
| | | </select> |
| | | <!--查询该型号工艺下最新版本的工艺id--> |
| | | <select id="selTech" resultType="java.lang.Integer"> |
| | | select id |
| | | from mom_ocean.technology |
| | | where state = 1 |
| | | and father = #{techfather} |
| | | and name = #{techname} |
| | | and specifications_id = #{specificationId} |
| | | and version = #{version} |
| | | </select> |
| | | |
| | | <!--查询该型号下版本下的所有数据--> |
| | | <select id="selAllByVerSpId" resultType="com.yuanchu.mom.pojo.Technology"> |
| | | select * |
| | | from mom_ocean.technology |
| | | where state = 1 |
| | | and specifications_id = #{spId} |
| | | and version = #{ver} |
| | | </select> |
| | | |
| | | <!--批量删除--> |
| | | <update id="delAllTech"> |
| | | update mom_ocean.technology |
| | | set state=0 |
| | | where id in (${ids}) |
| | | </update> |
| | | </mapper> |