zhubaomin
2024-11-06 549b9d60edcdb46366c60666ea4ee2c2e4533951
pipIrr-platform/pipIrr-global/src/main/resources/mapper/OpeWorkOrderMapper.xml
@@ -5,22 +5,22 @@
    <!--@mbg.generated-->
    <!--@Table ope_work_order-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="dispatcher" jdbcType="BIGINT" property="dispatcher" />
    <result column="inspector" jdbcType="BIGINT" property="inspector" />
    <result column="task_type" jdbcType="TINYINT" property="taskType" />
    <result column="dispatcher_id" jdbcType="BIGINT" property="dispatcherId" />
    <result column="inspector_id" jdbcType="BIGINT" property="inspectorId" />
    <result column="task_type_id" jdbcType="BIGINT" property="taskTypeId" />
    <result column="task_content" jdbcType="VARCHAR" property="taskContent" />
    <result column="complete_criteria" jdbcType="VARCHAR" property="completeCriteria" />
    <result column="dead_line" jdbcType="TIMESTAMP" property="deadLine" />
    <result column="dispatch_time" jdbcType="TIMESTAMP" property="dispatchTime" />
    <result column="task_result" jdbcType="TINYINT" property="taskResult" />
    <result column="photos" jdbcType="VARCHAR" property="photos" />
    <result column="complete_time" jdbcType="TIMESTAMP" property="completeTime" />
    <result column="dispatch_time" jdbcType="TIMESTAMP" property="dispatchTime" />
    <result column="state" jdbcType="TINYINT" property="state" />
    <result column="reject_times" jdbcType="INTEGER" property="rejectTimes" />
    <result column="deleted" jdbcType="BIGINT" property="deleted" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, dispatcher, inspector, task_type, task_content, complete_criteria, dead_line,
    dispatch_time, task_result, photos, complete_time, deleted
    id, dispatcher_id, inspector_id, task_type_id, task_content, complete_criteria, dead_line,
    complete_time, dispatch_time, `state`, reject_times, deleted
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -36,15 +36,15 @@
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder">
    <!--@mbg.generated-->
    insert into ope_work_order (id, dispatcher, inspector,
      task_type, task_content, complete_criteria,
      dead_line, dispatch_time, task_result,
      photos, complete_time, deleted
    insert into ope_work_order (id, dispatcher_id, inspector_id,
      task_type_id, task_content, complete_criteria,
      dead_line, complete_time, dispatch_time,
      `state`, reject_times, deleted
      )
    values (#{id,jdbcType=BIGINT}, #{dispatcher,jdbcType=BIGINT}, #{inspector,jdbcType=BIGINT},
      #{taskType,jdbcType=TINYINT}, #{taskContent,jdbcType=VARCHAR}, #{completeCriteria,jdbcType=VARCHAR},
      #{deadLine,jdbcType=TIMESTAMP}, #{dispatchTime,jdbcType=TIMESTAMP}, #{taskResult,jdbcType=TINYINT},
      #{photos,jdbcType=VARCHAR}, #{completeTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIGINT}
    values (#{id,jdbcType=BIGINT}, #{dispatcherId,jdbcType=BIGINT}, #{inspectorId,jdbcType=BIGINT},
      #{taskTypeId,jdbcType=BIGINT}, #{taskContent,jdbcType=VARCHAR}, #{completeCriteria,jdbcType=VARCHAR},
      #{deadLine,jdbcType=TIMESTAMP}, #{completeTime,jdbcType=TIMESTAMP}, #{dispatchTime,jdbcType=TIMESTAMP},
      #{state,jdbcType=TINYINT}, #{rejectTimes,jdbcType=INTEGER}, #{deleted,jdbcType=BIGINT}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder">
@@ -54,14 +54,14 @@
      <if test="id != null">
        id,
      </if>
      <if test="dispatcher != null">
        dispatcher,
      <if test="dispatcherId != null">
        dispatcher_id,
      </if>
      <if test="inspector != null">
        inspector,
      <if test="inspectorId != null">
        inspector_id,
      </if>
      <if test="taskType != null">
        task_type,
      <if test="taskTypeId != null">
        task_type_id,
      </if>
      <if test="taskContent != null">
        task_content,
@@ -72,17 +72,17 @@
      <if test="deadLine != null">
        dead_line,
      </if>
      <if test="completeTime != null">
        complete_time,
      </if>
      <if test="dispatchTime != null">
        dispatch_time,
      </if>
      <if test="taskResult != null">
        task_result,
      <if test="state != null">
        `state`,
      </if>
      <if test="photos != null">
        photos,
      </if>
      <if test="completeTime != null">
        complete_time,
      <if test="rejectTimes != null">
        reject_times,
      </if>
      <if test="deleted != null">
        deleted,
@@ -92,14 +92,14 @@
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="dispatcher != null">
        #{dispatcher,jdbcType=BIGINT},
      <if test="dispatcherId != null">
        #{dispatcherId,jdbcType=BIGINT},
      </if>
      <if test="inspector != null">
        #{inspector,jdbcType=BIGINT},
      <if test="inspectorId != null">
        #{inspectorId,jdbcType=BIGINT},
      </if>
      <if test="taskType != null">
        #{taskType,jdbcType=TINYINT},
      <if test="taskTypeId != null">
        #{taskTypeId,jdbcType=BIGINT},
      </if>
      <if test="taskContent != null">
        #{taskContent,jdbcType=VARCHAR},
@@ -110,17 +110,17 @@
      <if test="deadLine != null">
        #{deadLine,jdbcType=TIMESTAMP},
      </if>
      <if test="completeTime != null">
        #{completeTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dispatchTime != null">
        #{dispatchTime,jdbcType=TIMESTAMP},
      </if>
      <if test="taskResult != null">
        #{taskResult,jdbcType=TINYINT},
      <if test="state != null">
        #{state,jdbcType=TINYINT},
      </if>
      <if test="photos != null">
        #{photos,jdbcType=VARCHAR},
      </if>
      <if test="completeTime != null">
        #{completeTime,jdbcType=TIMESTAMP},
      <if test="rejectTimes != null">
        #{rejectTimes,jdbcType=INTEGER},
      </if>
      <if test="deleted != null">
        #{deleted,jdbcType=BIGINT},
@@ -131,14 +131,14 @@
    <!--@mbg.generated-->
    update ope_work_order
    <set>
      <if test="dispatcher != null">
        dispatcher = #{dispatcher,jdbcType=BIGINT},
      <if test="dispatcherId != null">
        dispatcher_id = #{dispatcherId,jdbcType=BIGINT},
      </if>
      <if test="inspector != null">
        inspector = #{inspector,jdbcType=BIGINT},
      <if test="inspectorId != null">
        inspector_id = #{inspectorId,jdbcType=BIGINT},
      </if>
      <if test="taskType != null">
        task_type = #{taskType,jdbcType=TINYINT},
      <if test="taskTypeId != null">
        task_type_id = #{taskTypeId,jdbcType=BIGINT},
      </if>
      <if test="taskContent != null">
        task_content = #{taskContent,jdbcType=VARCHAR},
@@ -149,17 +149,17 @@
      <if test="deadLine != null">
        dead_line = #{deadLine,jdbcType=TIMESTAMP},
      </if>
      <if test="completeTime != null">
        complete_time = #{completeTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dispatchTime != null">
        dispatch_time = #{dispatchTime,jdbcType=TIMESTAMP},
      </if>
      <if test="taskResult != null">
        task_result = #{taskResult,jdbcType=TINYINT},
      <if test="state != null">
        `state` = #{state,jdbcType=TINYINT},
      </if>
      <if test="photos != null">
        photos = #{photos,jdbcType=VARCHAR},
      </if>
      <if test="completeTime != null">
        complete_time = #{completeTime,jdbcType=TIMESTAMP},
      <if test="rejectTimes != null">
        reject_times = #{rejectTimes,jdbcType=INTEGER},
      </if>
      <if test="deleted != null">
        deleted = #{deleted,jdbcType=BIGINT},
@@ -170,17 +170,37 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoOp.OpeWorkOrder">
    <!--@mbg.generated-->
    update ope_work_order
    set dispatcher = #{dispatcher,jdbcType=BIGINT},
      inspector = #{inspector,jdbcType=BIGINT},
      task_type = #{taskType,jdbcType=TINYINT},
    set dispatcher_id = #{dispatcherId,jdbcType=BIGINT},
      inspector_id = #{inspectorId,jdbcType=BIGINT},
      task_type_id = #{taskTypeId,jdbcType=BIGINT},
      task_content = #{taskContent,jdbcType=VARCHAR},
      complete_criteria = #{completeCriteria,jdbcType=VARCHAR},
      dead_line = #{deadLine,jdbcType=TIMESTAMP},
      dispatch_time = #{dispatchTime,jdbcType=TIMESTAMP},
      task_result = #{taskResult,jdbcType=TINYINT},
      photos = #{photos,jdbcType=VARCHAR},
      complete_time = #{completeTime,jdbcType=TIMESTAMP},
      dispatch_time = #{dispatchTime,jdbcType=TIMESTAMP},
      `state` = #{state,jdbcType=TINYINT},
      reject_times = #{rejectTimes,jdbcType=INTEGER},
      deleted = #{deleted,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据主键获取工单视图对象-->
  <select id="getWorkOrderById" resultType="com.dy.pipIrrGlobal.voOp.VoWorkOrder">
    SELECT
        ord.dispatcher_id AS dispatcherId,
        us1.name AS dispatcher,
        ord.inspector_id AS inspectorId,
        us2.name AS inspector,
        typ.task_type AS taskType,
        ord.task_content AS taskContent,
        ord.complete_criteria AS completeCriteria,
        ord.dead_line AS deadLine,
        ord.dispatch_time AS dispatchTime,
        ord.reject_times AS rejectTimes
    FROM ope_work_order ord
        INNER JOIN ba_user us1 ON us1.id = ord.dispatcher_id
        INNER JOIN ba_user us2 ON us2.id = ord.inspector_id
        INNER JOIN ope_task_type typ ON typ.id = ord.task_type_id
    WHERE ord.deleted = 0 AND ord.id = #{workOrderId}
  </select>
</mapper>