<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
~
|
~ Copyright (c) 2018-2025, ztt All rights reserved.
|
~
|
~ Redistribution and use in source and binary forms, with or without
|
~ modification, are permitted provided that the following conditions are met:
|
~
|
~ Redistributions of source code must retain the above copyright notice,
|
~ this list of conditions and the following disclaimer.
|
~ Redistributions in binary form must reproduce the above copyright
|
~ notice, this list of conditions and the following disclaimer in the
|
~ documentation and/or other materials provided with the distribution.
|
~ Neither the name of the pig4cloud.com developer nor the names of its
|
~ contributors may be used to endorse or promote products derived from
|
~ this software without specific prior written permission.
|
~ Author: ztt
|
~
|
-->
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.chinaztt.mes.basic.mapper.BasicParamTemplateMapper">
|
|
<resultMap id="operationTemplateMap" type="com.chinaztt.mes.basic.entity.Template">
|
<id property="id" column="id"/>
|
<result property="templateName" column="template_name"/>
|
<result property="templateNo" column="template_no"/>
|
<result property="templateType" column="template_type"/>
|
<result property="remark" column="remark"/>
|
<result property="dataType" column="data_type"/>
|
</resultMap>
|
<select id="getOperationTemplate" resultMap="operationTemplateMap">
|
SELECT A.*
|
FROM basic_template A
|
LEFT JOIN technology_join_operation_template B ON B.technology_template_id = A."id"
|
WHERE B.technology_operation_id = #{id}
|
</select>
|
<select id="getTemplate" resultMap="operationTemplateMap">
|
SELECT A.*
|
FROM basic_template A
|
LEFT JOIN technology_join_operation_template B ON B.technology_template_id = A."id"
|
WHERE B.technology_operation_id = #{id}
|
and A.data_type = '生产要求'
|
</select>
|
<select id="getOperationTemplateByType" resultType="com.chinaztt.mes.basic.entity.TemplateTypeRelation">
|
SELECT A.template_type_name
|
FROM basic_template_type_relation A
|
<if test="ew.emptyOfWhere == false">
|
<where>
|
${ew.SqlSegment}
|
</where>
|
</if>
|
GROUP BY A.template_type_name
|
</select>
|
<select id="getTemplateUpdate" resultMap="operationTemplateMap">
|
SELECT
|
A.*
|
FROM
|
basic_template
|
A LEFT JOIN technology_join_operation_template B ON B.technology_template_id = A."id"
|
LEFT JOIN plan_manufacturing_order_rou
|
ting_operation C ON C.operation_id = B.technology_operation_id
|
LEFT JOIN production_operation_task D ON D.mo_routing_operation_id = C."id"
|
WHERE D."id" = #{id}
|
<if test="template.dataType != null and template.dataType != ''">
|
and A.data_type = #{template.dataType}
|
</if>
|
<if test="template.templateType != null and template.templateType != ''">
|
and A.template_type = #{template.templateType}
|
</if>
|
</select>
|
<select id="getTemplateByType" resultMap="operationTemplateMap">
|
SELECT
|
*
|
FROM
|
basic_template
|
<if test="ew.emptyOfWhere == false">
|
<where>
|
${ew.SqlSegment}
|
</where>
|
</if>
|
</select>
|
</mapper>
|