<?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.aps.core.mapper.ApsStandardProcessMapper">
|
|
<resultMap type="com.aps.core.domain.ApsStandardProcess" id="ApsStandardProcessResult">
|
<result property="id" column="id" />
|
<result property="processNumber" column="process_number" />
|
<result property="processName" column="process_name" />
|
<result property="resourceGroupName" column="resource_group_name" />
|
<result property="model" column="model" />
|
<result property="designCapacity" column="design_capacity" />
|
<result property="plantId" column="plant_id" />
|
<result property="plant" column="plant" />
|
<result property="workShopId" column="work_shop_id" />
|
<result property="workShop" column="work_shop" />
|
<result property="workCalenderId" column="work_calender_id" />
|
<result property="delFlag" column="del_flag" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="modelId" column="model_id" />
|
<result property="workCalender" column="work_calender" />
|
<result property="major" column="major" />
|
</resultMap>
|
|
<sql id="selectApsStandardProcessVo">
|
select id, process_number, process_name, resource_group_name, model, design_capacity, plant_id, plant, work_shop_id, work_shop, work_calender_id, del_flag, create_by, create_time, update_by, update_time, model_id, work_calender,major from aps_standard_process
|
</sql>
|
|
<select id="selectApsStandardProcessList" parameterType="com.aps.core.domain.ApsStandardProcess" resultMap="ApsStandardProcessResult">
|
<include refid="selectApsStandardProcessVo"/>
|
<where>
|
<if test="processNumber != null and processNumber != ''"> and process_number = #{processNumber}</if>
|
<if test="processName != null and processName != ''"> and process_name like '%' || #{processName} || '%'</if>
|
<if test="resourceGroupName != null and resourceGroupName != ''"> and resource_group_name like '%' || #{resourceGroupName} || '%'</if>
|
<if test="model != null and model != ''"> and model = #{model}</if>
|
<if test="designCapacity != null and designCapacity != ''"> and design_capacity = #{designCapacity}</if>
|
<if test="plantId != null and plantId != ''"> and plant_id = #{plantId}</if>
|
<if test="plant != null and plant != ''"> and plant = #{plant}</if>
|
<if test="workShopId != null and workShopId != ''"> and work_shop_id = #{workShopId}</if>
|
<if test="workShop != null and workShop != ''"> and work_shop = #{workShop}</if>
|
<if test="workCalenderId != null "> and work_calender_id = #{workCalenderId}</if>
|
<if test="modelId != null "> and model_id = #{modelId}</if>
|
<if test="workCalender != null and workCalender != ''"> and work_calender = #{workCalender}</if>
|
<if test="major != null and major != ''"> and major = #{major}</if>
|
</where>
|
</select>
|
|
<select id="selectApsStandardProcessById" parameterType="Long" resultMap="ApsStandardProcessResult">
|
<include refid="selectApsStandardProcessVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertApsStandardProcess" parameterType="com.aps.core.domain.ApsStandardProcess">
|
insert into aps_standard_process
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="processNumber != null">process_number,</if>
|
<if test="processName != null">process_name,</if>
|
<if test="resourceGroupName != null">resource_group_name,</if>
|
<if test="model != null">model,</if>
|
<if test="designCapacity != null">design_capacity,</if>
|
<if test="plantId != null">plant_id,</if>
|
<if test="plant != null">plant,</if>
|
<if test="workShopId != null">work_shop_id,</if>
|
<if test="workShop != null">work_shop,</if>
|
<if test="workCalenderId != null">work_calender_id,</if>
|
<if test="delFlag != null">del_flag,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="modelId != null">model_id,</if>
|
<if test="workCalender != null">work_calender,</if>
|
<if test="major != null">major,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="processNumber != null">#{processNumber},</if>
|
<if test="processName != null">#{processName},</if>
|
<if test="resourceGroupName != null">#{resourceGroupName},</if>
|
<if test="model != null">#{model},</if>
|
<if test="designCapacity != null">#{designCapacity},</if>
|
<if test="plantId != null">#{plantId},</if>
|
<if test="plant != null">#{plant},</if>
|
<if test="workShopId != null">#{workShopId},</if>
|
<if test="workShop != null">#{workShop},</if>
|
<if test="workCalenderId != null">#{workCalenderId},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="modelId != null">#{modelId},</if>
|
<if test="workCalender != null">#{workCalender},</if>
|
<if test="major != null">#{major},</if>
|
</trim>
|
</insert>
|
|
<update id="updateApsStandardProcess" parameterType="com.aps.core.domain.ApsStandardProcess">
|
update aps_standard_process
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="processNumber != null">process_number = #{processNumber},</if>
|
<if test="processName != null">process_name = #{processName},</if>
|
<if test="resourceGroupName != null">resource_group_name = #{resourceGroupName},</if>
|
<if test="model != null">model = #{model},</if>
|
<if test="designCapacity != null">design_capacity = #{designCapacity},</if>
|
<if test="plantId != null">plant_id = #{plantId},</if>
|
<if test="plant != null">plant = #{plant},</if>
|
<if test="workShopId != null">work_shop_id = #{workShopId},</if>
|
<if test="workShop != null">work_shop = #{workShop},</if>
|
<if test="workCalenderId != null">work_calender_id = #{workCalenderId},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="modelId != null">model_id = #{modelId},</if>
|
<if test="workCalender != null">work_calender = #{workCalender},</if>
|
<if test="major != null">major = #{major},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteApsStandardProcessById" parameterType="Long">
|
delete from aps_standard_process where id = #{id}
|
</delete>
|
|
<delete id="deleteApsStandardProcessByIds" parameterType="String">
|
delete from aps_standard_process where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|