zhubaomin
2025-04-07 1a2b07f01ba4616fd9e894dddf474b56d020158c
pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIntakeOperateMapper.xml
@@ -5,6 +5,8 @@
    <!--@mbg.generated-->
    <!--@Table ir_intake_operate-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="plan_id" jdbcType="BIGINT" property="planId" />
    <result column="operate_type" jdbcType="TINYINT" property="operateType" />
    <result column="command_id" jdbcType="BIGINT" property="commandId" />
    <result column="intake_id" jdbcType="BIGINT" property="intakeId" />
    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
@@ -14,7 +16,8 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, command_id, intake_id, start_time, duration, command_result, failure_factors
    id, plan_id, operate_type, command_id, intake_id, start_time, duration, command_result,
    failure_factors
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -30,12 +33,14 @@
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIntakeOperate">
    <!--@mbg.generated-->
    insert into ir_intake_operate (id, command_id, intake_id,
      start_time, duration, command_result,
      failure_factors)
    values (#{id,jdbcType=BIGINT}, #{commandId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT},
      #{startTime,jdbcType=TIMESTAMP}, #{duration,jdbcType=INTEGER}, #{commandResult,jdbcType=TINYINT},
      #{failureFactors,jdbcType=VARCHAR})
    insert into ir_intake_operate (id, plan_id, operate_type,
      command_id, intake_id, start_time,
      duration, command_result, failure_factors
      )
    values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{operateType,jdbcType=TINYINT},
      #{commandId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{startTime,jdbcType=TIMESTAMP},
      #{duration,jdbcType=INTEGER}, #{commandResult,jdbcType=TINYINT}, #{failureFactors,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIntakeOperate">
    <!--@mbg.generated-->
@@ -43,6 +48,12 @@
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="planId != null">
        plan_id,
      </if>
      <if test="operateType != null">
        operate_type,
      </if>
      <if test="commandId != null">
        command_id,
@@ -66,6 +77,12 @@
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="planId != null">
        #{planId,jdbcType=BIGINT},
      </if>
      <if test="operateType != null">
        #{operateType,jdbcType=TINYINT},
      </if>
      <if test="commandId != null">
        #{commandId,jdbcType=BIGINT},
@@ -91,6 +108,12 @@
    <!--@mbg.generated-->
    update ir_intake_operate
    <set>
      <if test="planId != null">
        plan_id = #{planId,jdbcType=BIGINT},
      </if>
      <if test="operateType != null">
        operate_type = #{operateType,jdbcType=TINYINT},
      </if>
      <if test="commandId != null">
        command_id = #{commandId,jdbcType=BIGINT},
      </if>
@@ -115,7 +138,9 @@
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoIr.IrIntakeOperate">
    <!--@mbg.generated-->
    update ir_intake_operate
    set command_id = #{commandId,jdbcType=BIGINT},
    set plan_id = #{planId,jdbcType=BIGINT},
      operate_type = #{operateType,jdbcType=TINYINT},
      command_id = #{commandId,jdbcType=BIGINT},
      intake_id = #{intakeId,jdbcType=BIGINT},
      start_time = #{startTime,jdbcType=TIMESTAMP},
      duration = #{duration,jdbcType=INTEGER},
@@ -130,4 +155,17 @@
    set command_result = #{commandResult}, failure_factors = #{failureFactors}
    where command_id = #{commandId}
  </update>
  <!--根据计划ID获取待终止的取水口ID(已发布开发命令,无论是否成功)-->
  <select id="getToTerminateIntakeIds" resultType="java.lang.Long">
    SELECT
      intake_id AS intakeId
    FROM ir_intake_operate
    WHERE operate_type = 1 AND plan_id = #{planId}
  </select>
  <!--根据计划ID获取待终止的命令ID-->
  <select id="getTerminateCommandIds" resultType="java.lang.Long">
    SELECT command_id AS commandId FROM ir_intake_operate WHERE operate_type = 1 AND plan_id = #{planId}
  </select>
</mapper>