<?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.TechnicalModelMapper">
|
<!--查询技术指标维护列表 左边二级展示工序和工艺 -->
|
<resultMap id="selectAllTechTemMap" type="map">
|
<id property="name" column="father"/>
|
<collection property="children" resultMap="selectAllTechTemTowMap" javaType="List"/>
|
</resultMap>
|
<resultMap id="selectAllTechTemTowMap" type="map">
|
<id property="id" column="id"/>
|
<result property="name" column="name"/>
|
</resultMap>
|
<select id="selectAllTechTem" resultMap="selectAllTechTemMap">
|
select id,
|
name,
|
father
|
from mom_ocean.technology_template
|
where state=1
|
and type=#{type}
|
<if test="message!=null and message!=''">
|
and name like concat('%',#{message},'%')
|
</if>
|
</select>
|
|
<!--查询技术指标维护列表 右边展示该工艺下的检验项目-->
|
<resultMap id="selectAllTechNamMap" type="map">
|
<id property="name" column="father"/>
|
<collection property="children" resultMap="selectAllTechNamTowMap" javaType="List"/>
|
</resultMap>
|
<resultMap id="selectAllTechNamTowMap" type="map">
|
<id property="id" column="id"/>
|
<result property="name" column="name"/>
|
<result property="unit" column="unit"/>
|
</resultMap>
|
<select id="selectAllTechNam" resultMap="selectAllTechNamMap">
|
select id,
|
father,
|
name,
|
unit
|
from mom_ocean.technical_model
|
where state = 1
|
and tech_tem_id = #{id}
|
</select>
|
|
<!--新增技术指标维护 选择工序和工艺-->
|
<resultMap id="chooseTechFathMap" type="map">
|
<id property="name" column="techFather"/>
|
<collection property="children" resultMap="chooseTechFathTowMap" javaType="List"/>
|
</resultMap>
|
<resultMap id="chooseTechFathTowMap" type="map">
|
<id property="id" column="techTemId"/>
|
<result property="name" column="techName"/>
|
</resultMap>
|
<select id="chooseTechFath" resultMap="chooseTechFathMap">
|
select id techTemId,
|
name techName,
|
father techFather
|
from mom_ocean.technology_template
|
where state = 1
|
and type = #{type}
|
</select>
|
|
<!--新增技术指标维护 选择项目父类-->
|
<select id="chooseProFath" resultType="java.lang.String">
|
select distinct father
|
from mom_ocean.technical_model
|
where state = 1
|
and tech_tem_id = #{id}
|
</select>
|
|
<!--根据id查询详情-->
|
<select id="selecTechById" resultType="java.util.Map">
|
select technical_model.father,
|
technical_model.name,
|
unit,
|
technology_template.id,
|
technology_template.name techName,
|
technology_template.father techFather,
|
type
|
from mom_ocean.technical_model,
|
mom_ocean.technology_template
|
where technical_model.state = 1
|
and technology_template.id = tech_tem_id
|
and technical_model.id = #{id}
|
</select>
|
|
<!--批量删除根据技术指标id-->
|
<update id="delAllTech">
|
update mom_ocean.technical_model
|
set state=0
|
where id in (${ids})
|
</update>
|
|
<!--删除根据工艺路线id-->
|
<update id="delTeMoByTechId">
|
update mom_ocean.technical_model
|
set state=0
|
where tech_tem_id = #{id}
|
</update>
|
|
<!--批量删除根据工艺路线id-->
|
<update id="delAllByTechId">
|
update mom_ocean.technical_model
|
set state=0
|
where tech_tem_id in (${ids})
|
</update>
|
</mapper>
|