zss
2023-09-01 6a19365f5dea396622b32afe28b3e4b9b067e0e1
standard-server/src/main/resources/mapper/TechniqueMapper.xml
@@ -46,4 +46,67 @@
            and device like concat('%',#{message},'%')
        </if>
    </select>
    <!--右上角新增-生产工艺-选择设备-->
    <select id="chooseDev" resultType="java.util.Map">
        select name device
        from mom_ocean.device
        where state = 1
          and device_status in (1, 5)
          and father = (select distinct device_group
                        from mom_ocean.technology
                        where technology.state = 1
                          and technology.id = #{technologyId})
    </select>
    <!--右上角新增-生产工艺-选择项目(父子),单位-->
    <resultMap id="chooseProMap" type="map">
        <id property="name" column="productFather"/>
        <collection property="children" resultMap="chooseProMaps" javaType="List"/>
    </resultMap>
    <resultMap id="chooseProMaps" type="map">
        <id property="name" column="product"/>
        <result property="unit" column="unit"/>
    </resultMap>
    <select id="choosePro" resultMap="chooseProMap">
        select name   product,
               father productFather,
               unit
        from mom_ocean.product
        where state = 1
          and technology_id = #{technologyId}
    </select>
    <!--根据型号id查询该型号下所有工艺的生产工艺-->
    <select id="selAllBySpeId" resultType="com.yuanchu.mom.pojo.Technique">
        select *
        from mom_ocean.technique
        where state = 1
          and version = #{version}
          and technology_id in (select id
                                from mom_ocean.technology
                                where technology.state = 1
                                  and specifications_id = #{specificationsId})
    </select>
    <!--根据工艺路线id删除生产工艺-->
    <update id="delTeqByTecId">
        update mom_ocean.technique
        set state=0
        where technology_id = #{id}
    </update>
    <!--根据工艺路线id批量删除-->
    <update id="delAllByTecId">
        update mom_ocean.technique
        set state=0
        where technology_id in (${ids})
    </update>
    <!--根据生产工艺id批量删除-->
    <update id="delAllTeq">
        update mom_ocean.technique
        set state=0
        where id in (${ids})
    </update>
</mapper>