|
|
@@ -0,0 +1,179 @@
|
|
|
+<?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.ygtx.gxt.mapper.MaintenanceWorkOrderMapper">
|
|
|
+
|
|
|
+ <resultMap type="MaintenanceWorkOrder" id="MaintenanceWorkOrderResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="orderCode" column="order_code" />
|
|
|
+ <result property="orderStatus" column="order_status" />
|
|
|
+ <result property="maintenanceCenter" column="maintenance_center" />
|
|
|
+ <result property="windFarm" column="wind_farm" />
|
|
|
+ <result property="turbineBrandModel" column="turbine_brand_model" />
|
|
|
+ <result property="maintenancePlanCode" column="maintenance_plan_code" />
|
|
|
+ <result property="plannedRepairDate" column="planned_repair_date" />
|
|
|
+ <result property="orderSource" column="order_source" />
|
|
|
+ <result property="assignTime" column="assign_time" />
|
|
|
+ <result property="assignUserId" column="assign_user_id" />
|
|
|
+ <result property="assignUserName" column="assign_user_name" />
|
|
|
+ <result property="acceptTime" column="accept_time" />
|
|
|
+ <result property="acceptUserId" column="accept_user_id" />
|
|
|
+ <result property="acceptUserName" column="accept_user_name" />
|
|
|
+ <result property="teamLeaderId" column="team_leader_id" />
|
|
|
+ <result property="teamLeaderName" column="team_leader_name" />
|
|
|
+ <result property="workGroupMemberId" column="work_group_member_id" />
|
|
|
+ <result property="workGroupMemberName" column="work_group_member_name" />
|
|
|
+ <result property="suspendReason" column="suspend_reason" />
|
|
|
+ <result property="suspendTime" column="suspend_time" />
|
|
|
+ <result property="restartTime" column="restart_time" />
|
|
|
+ <result property="completeTime" column="complete_time" />
|
|
|
+ <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="remark" column="remark" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectMaintenanceWorkOrderVo">
|
|
|
+ select id, order_code, order_status, maintenance_center, wind_farm, turbine_brand_model,
|
|
|
+ maintenance_plan_code, planned_repair_date, order_source, assign_time, assign_user_id,
|
|
|
+ assign_user_name, accept_time, accept_user_id, accept_user_name, team_leader_id,
|
|
|
+ team_leader_name, work_group_member_id, work_group_member_name, suspend_reason,
|
|
|
+ suspend_time, restart_time, complete_time, create_by, create_time, update_by,
|
|
|
+ update_time, remark
|
|
|
+ from wl_maintenance_work_order
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectMaintenanceWorkOrderList" parameterType="MaintenanceWorkOrder" resultMap="MaintenanceWorkOrderResult">
|
|
|
+ <include refid="selectMaintenanceWorkOrderVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if>
|
|
|
+ <if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
|
|
|
+ <if test="maintenanceCenter != null and maintenanceCenter != ''"> and maintenance_center = #{maintenanceCenter}</if>
|
|
|
+ <if test="windFarm != null and windFarm != ''"> and wind_farm = #{windFarm}</if>
|
|
|
+ <if test="orderSource != null and orderSource != ''"> and order_source = #{orderSource}</if>
|
|
|
+ <if test="teamLeaderId != null"> and team_leader_id = #{teamLeaderId}</if>
|
|
|
+ <if test="workGroupMemberId != null"> and work_group_member_id = #{workGroupMemberId}</if>
|
|
|
+ </where>
|
|
|
+ order by create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectMaintenanceWorkOrderById" parameterType="Long" resultMap="MaintenanceWorkOrderResult">
|
|
|
+ <include refid="selectMaintenanceWorkOrderVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectMaintenanceWorkOrderByCode" parameterType="String" resultMap="MaintenanceWorkOrderResult">
|
|
|
+ <include refid="selectMaintenanceWorkOrderVo"/>
|
|
|
+ where order_code = #{orderCode}
|
|
|
+ limit 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertMaintenanceWorkOrder" parameterType="MaintenanceWorkOrder" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into wl_maintenance_work_order
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="orderCode != null and orderCode != ''">order_code,</if>
|
|
|
+ <if test="orderStatus != null and orderStatus != ''">order_status,</if>
|
|
|
+ <if test="maintenanceCenter != null">maintenance_center,</if>
|
|
|
+ <if test="windFarm != null">wind_farm,</if>
|
|
|
+ <if test="turbineBrandModel != null">turbine_brand_model,</if>
|
|
|
+ <if test="maintenancePlanCode != null">maintenance_plan_code,</if>
|
|
|
+ <if test="plannedRepairDate != null">planned_repair_date,</if>
|
|
|
+ <if test="orderSource != null">order_source,</if>
|
|
|
+ <if test="assignTime != null">assign_time,</if>
|
|
|
+ <if test="assignUserId != null">assign_user_id,</if>
|
|
|
+ <if test="assignUserName != null">assign_user_name,</if>
|
|
|
+ <if test="acceptTime != null">accept_time,</if>
|
|
|
+ <if test="acceptUserId != null">accept_user_id,</if>
|
|
|
+ <if test="acceptUserName != null">accept_user_name,</if>
|
|
|
+ <if test="teamLeaderId != null">team_leader_id,</if>
|
|
|
+ <if test="teamLeaderName != null">team_leader_name,</if>
|
|
|
+ <if test="workGroupMemberId != null">work_group_member_id,</if>
|
|
|
+ <if test="workGroupMemberName != null">work_group_member_name,</if>
|
|
|
+ <if test="suspendReason != null">suspend_reason,</if>
|
|
|
+ <if test="suspendTime != null">suspend_time,</if>
|
|
|
+ <if test="restartTime != null">restart_time,</if>
|
|
|
+ <if test="completeTime != null">complete_time,</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="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="orderCode != null and orderCode != ''">#{orderCode},</if>
|
|
|
+ <if test="orderStatus != null and orderStatus != ''">#{orderStatus},</if>
|
|
|
+ <if test="maintenanceCenter != null">#{maintenanceCenter},</if>
|
|
|
+ <if test="windFarm != null">#{windFarm},</if>
|
|
|
+ <if test="turbineBrandModel != null">#{turbineBrandModel},</if>
|
|
|
+ <if test="maintenancePlanCode != null">#{maintenancePlanCode},</if>
|
|
|
+ <if test="plannedRepairDate != null">#{plannedRepairDate},</if>
|
|
|
+ <if test="orderSource != null">#{orderSource},</if>
|
|
|
+ <if test="assignTime != null">#{assignTime},</if>
|
|
|
+ <if test="assignUserId != null">#{assignUserId},</if>
|
|
|
+ <if test="assignUserName != null">#{assignUserName},</if>
|
|
|
+ <if test="acceptTime != null">#{acceptTime},</if>
|
|
|
+ <if test="acceptUserId != null">#{acceptUserId},</if>
|
|
|
+ <if test="acceptUserName != null">#{acceptUserName},</if>
|
|
|
+ <if test="teamLeaderId != null">#{teamLeaderId},</if>
|
|
|
+ <if test="teamLeaderName != null">#{teamLeaderName},</if>
|
|
|
+ <if test="workGroupMemberId != null">#{workGroupMemberId},</if>
|
|
|
+ <if test="workGroupMemberName != null">#{workGroupMemberName},</if>
|
|
|
+ <if test="suspendReason != null">#{suspendReason},</if>
|
|
|
+ <if test="suspendTime != null">#{suspendTime},</if>
|
|
|
+ <if test="restartTime != null">#{restartTime},</if>
|
|
|
+ <if test="completeTime != null">#{completeTime},</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="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateMaintenanceWorkOrder" parameterType="MaintenanceWorkOrder">
|
|
|
+ update wl_maintenance_work_order
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="orderCode != null and orderCode != ''">order_code = #{orderCode},</if>
|
|
|
+ <if test="orderStatus != null and orderStatus != ''">order_status = #{orderStatus},</if>
|
|
|
+ <if test="maintenanceCenter != null">maintenance_center = #{maintenanceCenter},</if>
|
|
|
+ <if test="windFarm != null">wind_farm = #{windFarm},</if>
|
|
|
+ <if test="turbineBrandModel != null">turbine_brand_model = #{turbineBrandModel},</if>
|
|
|
+ <if test="maintenancePlanCode != null">maintenance_plan_code = #{maintenancePlanCode},</if>
|
|
|
+ <if test="plannedRepairDate != null">planned_repair_date = #{plannedRepairDate},</if>
|
|
|
+ <if test="orderSource != null">order_source = #{orderSource},</if>
|
|
|
+ <if test="assignTime != null">assign_time = #{assignTime},</if>
|
|
|
+ <if test="assignUserId != null">assign_user_id = #{assignUserId},</if>
|
|
|
+ <if test="assignUserName != null">assign_user_name = #{assignUserName},</if>
|
|
|
+ <if test="acceptTime != null">accept_time = #{acceptTime},</if>
|
|
|
+ <if test="acceptUserId != null">accept_user_id = #{acceptUserId},</if>
|
|
|
+ <if test="acceptUserName != null">accept_user_name = #{acceptUserName},</if>
|
|
|
+ <if test="teamLeaderId != null">team_leader_id = #{teamLeaderId},</if>
|
|
|
+ <if test="teamLeaderName != null">team_leader_name = #{teamLeaderName},</if>
|
|
|
+ <if test="workGroupMemberId != null">work_group_member_id = #{workGroupMemberId},</if>
|
|
|
+ <if test="workGroupMemberName != null">work_group_member_name = #{workGroupMemberName},</if>
|
|
|
+ <if test="suspendReason != null">suspend_reason = #{suspendReason},</if>
|
|
|
+ <if test="suspendTime != null">suspend_time = #{suspendTime},</if>
|
|
|
+ <if test="restartTime != null">restart_time = #{restartTime},</if>
|
|
|
+ <if test="completeTime != null">complete_time = #{completeTime},</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="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteMaintenanceWorkOrderById" parameterType="Long">
|
|
|
+ delete from wl_maintenance_work_order where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteMaintenanceWorkOrderByIds" parameterType="String">
|
|
|
+ delete from wl_maintenance_work_order where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|