<?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.TechniqueModelMapper">
|
<!--查询生产工艺维护列表 右边展示该工艺下能使用的设备所能做的项目-->
|
<resultMap id="selectAllTequeMap" type="map">
|
<id property="name" column="dname"/>
|
<collection property="children" resultMap="selectAllTequeMaps" javaType="List"/>
|
</resultMap>
|
<resultMap id="selectAllTequeMaps" type="map">
|
<id property="id" column="id"/>
|
<result property="father" column="father"/>
|
<result property="unit" column="unit"/>
|
<result property="name" column="name"/>
|
</resultMap>
|
<select id="selectAllTeque" resultMap="selectAllTequeMap">
|
select d.name dname,
|
qm.id,
|
cm.father,
|
unit,
|
cm.name
|
from mom_ocean.technique_model qm,
|
mom_ocean.technical_model cm,
|
mom_ocean.device d,
|
mom_ocean.technology_template tt
|
where qm.state = 1
|
and d.id = qm.device_id
|
and cm.id = qm.technical_model_id
|
and tt.id = qm.tech_tem_id
|
and qm.tech_tem_id = #{id}
|
</select>
|
|
<!--新增生产工艺维护 选择项目父类,子类,带出单位-->
|
<resultMap id="chooseProMap" type="map">
|
<id property="name" column="father"/>
|
<collection property="children" resultMap="chooseProMaps" javaType="List"/>
|
</resultMap>
|
<resultMap id="chooseProMaps" type="map">
|
<id property="id" column="technicalModelId"/>
|
<result property="name" column="name"/>
|
<result property="unit" column="unit"/>
|
</resultMap>
|
<select id="choosePro" resultMap="chooseProMap">
|
select father,
|
id technicalModelId,
|
name,
|
unit
|
from mom_ocean.technical_model
|
where state = 1
|
and tech_tem_id = #{id}
|
</select>
|
|
<!--新增生产工艺维护 选择设备-->
|
<select id="chooseDeiv" resultType="java.util.Map">
|
select id devId,
|
name
|
from mom_ocean.device
|
where state = 1
|
and device_status in (1, 5)
|
and father = (select device_group
|
from mom_ocean.technology_template
|
where technology_template.state = 1
|
and technology_template.id = #{id})
|
</select>
|
|
<!--根据生产工艺id查看详情-->
|
<select id="selecQueById" resultType="java.util.Map">
|
select tt.type,
|
tt.father techFather,
|
tt.name techName,
|
d.name dname,
|
cm.father,
|
cm.name,
|
unit
|
from mom_ocean.technique_model qm,
|
mom_ocean.technology_template tt,
|
mom_ocean.device d,
|
mom_ocean.technical_model cm
|
where qm.tech_tem_id = tt.id
|
and device_id = d.id
|
and cm.id = qm.technical_model_id
|
and qm.id = #{id}
|
</select>
|
|
<!--批量删除-->
|
<update id="delAllQue">
|
update mom_ocean.technique_model
|
set state=0
|
where id in (${ids})
|
</update>
|
|
<!--根据工艺路线id删除-->
|
<update id="delQueByTechId">
|
update mom_ocean.technique_model
|
set state=0
|
where tech_tem_id = #{id}
|
</update>
|
|
<!--根据工艺路线id批量删除-->
|
<update id="delAllByTechId">
|
update mom_ocean.technique_model
|
set state=0
|
where tech_tem_id in (${ids})
|
</update>
|
</mapper>
|