<?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.ruoyi.production.mapper.ProcessRouteItemParamMapper">
|
|
<resultMap id="ProcessRouteItemParamResultMap" type="com.ruoyi.production.pojo.ProcessRouteItemParam">
|
<id property="id" column="id"/>
|
<result property="routeItemId" column="route_item_id"/>
|
<result property="paramId" column="param_id"/>
|
<result property="processParamId" column="process_param_id"/>
|
<result property="standardValue" column="standard_value"/>
|
<result property="minValue" column="min_value"/>
|
<result property="maxValue" column="max_value"/>
|
<result property="isRequired" column="is_required"/>
|
<result property="sort" column="sort"/>
|
<result property="tenantId" column="tenant_id"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateTime" column="update_time"/>
|
</resultMap>
|
|
<insert id="insertFromProcessTemplate">
|
INSERT INTO process_route_item_param (route_item_id, param_id, process_param_id,
|
standard_value, min_value, max_value,
|
is_required, sort, tenant_id, create_time)
|
SELECT #{routeItemId},
|
param_id,
|
id,
|
standard_value,
|
min_value,
|
max_value,
|
is_required,
|
sort,
|
#{tenantId},
|
NOW()
|
FROM product_process_param
|
WHERE process_id = #{processId}
|
</insert>
|
|
<select id="selectParamPage" resultType="com.ruoyi.production.dto.ProcessRouteItemParamDto">
|
select
|
prip.*,
|
bp.param_name,
|
bp.param_key,
|
bp.unit,
|
bp.param_type,
|
bp.param_format,
|
bp.value_mode
|
from process_route_item_param prip
|
left join base_param bp on prip.param_id = bp.id
|
<where>
|
<if test="p.routeItemId != null">
|
and prip.route_item_id = #{p.routeItemId}
|
</if>
|
<if test="p.tenantId != null">
|
and prip.tenant_id = #{p.tenantId}
|
</if>
|
</where>
|
order by prip.sort asc, prip.id asc
|
</select>
|
|
<select id="selectMaxSortByRouteItemId" resultType="java.lang.Integer">
|
SELECT MAX(sort)
|
FROM process_route_item_param
|
WHERE route_item_id = #{routeItemId}
|
</select>
|
|
</mapper>
|