<?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">
<!--  Copyright (c) 京北方信息技术股份有限公司 Corporation 2023 . All rights reserved. -->
<!--  Mybatis数据库持久层（底层映射文件）：执行计划表 -->
<!--  version: 1.0  -->
<!--  author:  maven-cctp-plugin    -->
<!--  date:  2023-08-30 10:30:29  -->
<mapper namespace="net.northking.cctp.executePlan.db.dao.AtuPlanInfoDao">
  <resultMap id="BaseResultMap" type="net.northking.cctp.executePlan.db.entity.AtuPlanInfo">
      <!-- 主键 -->
    <id column="id" jdbcType="VARCHAR" property="id"/>
                                                                                        <!-- 租户主键 -->
    <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
        <!-- 系统主键 -->
    <result column="project_id" jdbcType="VARCHAR" property="projectId"/>
        <!-- 计划名称 -->
    <result column="plan_name" jdbcType="VARCHAR" property="planName"/>
        <!-- 计划描述 -->
    <result column="plan_desc" jdbcType="VARCHAR" property="planDesc"/>
        <!-- 是否启用;0-否，1-是 -->
    <result column="is_enabled" jdbcType="BIT" property="enabled"/>
        <!-- 状态;0-新建，1-等待中，2-执行中，3-已完成，4-已取消 -->
    <result column="status" jdbcType="CHAR" property="status"/>
        <!-- 应用设置;1-清除数据，2-卸载安装，3-清除并卸载 -->
    <result column="app_set" jdbcType="CHAR" property="appSet"/>
        <!-- 录屏设置;0-不保存，1-全部保存，2-出错保存 -->
    <result column="screen_record_set" jdbcType="CHAR" property="screenRecordSet"/>
        <!-- 截图设置;0-不保存，1-全部保存，2-出错保存 -->
    <result column="screenshot_set" jdbcType="CHAR" property="screenshotSet"/>
        <!-- 优先级;0-低，1-高 -->
    <result column="priority" jdbcType="CHAR" property="priority"/>
        <!-- Cron表达式 -->
    <result column="cron_expr" jdbcType="VARCHAR" property="cronExpr"/>
        <!-- 前置计划ID -->
    <result column="up_front_plan_id" jdbcType="VARCHAR" property="upFrontPlanId"/>
        <!-- 触发链接 -->
    <result column="webhook_url" jdbcType="VARCHAR" property="webhookUrl"/>
        <!-- 密保令牌 -->
    <result column="webhook_token" jdbcType="VARCHAR" property="webhookToken"/>
        <!-- 是否发送邮件;0-否，1-是 -->
    <result column="is_send_mail" jdbcType="BIT" property="sendMail"/>
        <!-- 邮件地址;当需要发送邮件时不能为空 -->
    <result column="mail_address" jdbcType="VARCHAR" property="mailAddress"/>
        <!-- 是否失败重试;0-否，1-是 -->
    <result column="is_fail_retry" jdbcType="BIT" property="failRetry"/>
        <!-- 失败重试次数 -->
    <result column="fail_retry_count" jdbcType="INTEGER" property="failRetryCount"/>
        <!-- 是否失败生成计划;0-否，1-是 -->
    <result column="is_fail_create_plan" jdbcType="BIT" property="failCreatePlan"/>
        <!-- 最近执行时间 -->
    <result column="last_exec_time" jdbcType="TIMESTAMP" property="lastExecTime"/>
        <!-- 下次执行时间 -->
    <result column="next_exec_time" jdbcType="TIMESTAMP" property="nextExecTime"/>
        <!-- 最后批次号 -->
    <result column="last_batch_id" jdbcType="VARCHAR" property="lastBatchId"/>
        <!-- 最后批次等待中任务数 -->
    <result column="waiting_num" jdbcType="INTEGER" property="waitingNum"/>
        <!-- 最后批次执行中任务数 -->
    <result column="running_num" jdbcType="INTEGER" property="runningNum"/>
        <!-- 最后批次成功任务数 -->
    <result column="success_num" jdbcType="INTEGER" property="successNum"/>
        <!-- 最后批次执行失败任务数 -->
    <result column="exec_fail_num" jdbcType="INTEGER" property="execFailNum"/>
        <!-- 最后批次断言失败任务数 -->
    <result column="assert_fail_num" jdbcType="INTEGER" property="assertFailNum"/>
        <!-- 最后批次超时任务数 -->
    <result column="timeout_num" jdbcType="INTEGER" property="timeoutNum"/>
        <!-- 最后批次取消任务数 -->
    <result column="cancel_num" jdbcType="INTEGER" property="cancelNum"/>
        <!-- 创建人 -->
    <result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
        <!-- 创建时间 -->
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
        <!-- 更新人 -->
    <result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
        <!-- 更新时间 -->
    <result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime"/>
        <!-- 是否删除;0-否，1-是 -->
    <result column="is_deleted" jdbcType="BIT" property="deleted"/>
        <!-- 是否定时触发 0-否，1-是 -->
    <result column="has_corn" jdbcType="BIT" property="hasCorn"/>
        <!-- 是否存在前置计划 0-否，1-是 -->
    <result column="has_up_front" jdbcType="BIT" property="hasUpFront"/>
        <!-- 是否勾选webhook触发 0-否，1-是 -->
    <result column="has_webhook" jdbcType="BIT" property="hasWebhook"/>
        <!-- 用例变更标识;0-无，1-是 -->
    <result column="case_change_flag" jdbcType="BIT" property="caseChangeFlag"/>

    <result column="principal_id" jdbcType="VARCHAR" property="principalId"/>
    </resultMap>

  <sql id="Base_Column_List">
    id
    ,tenant_id
    ,project_id
    ,plan_name
    ,plan_desc
    ,is_enabled
    ,status
    ,app_set
    ,screen_record_set
    ,screenshot_set
    ,priority
    ,cron_expr
    ,up_front_plan_id
    ,webhook_url
    ,webhook_token
    ,is_send_mail
    ,mail_address
    ,is_fail_retry
    ,fail_retry_count
    ,is_fail_create_plan
    ,last_exec_time
    ,next_exec_time
    ,last_batch_id
    ,waiting_num
    ,running_num
    ,success_num
    ,exec_fail_num
    ,assert_fail_num
    ,timeout_num
    ,cancel_num
    ,created_by
    ,created_time
    ,updated_by
    ,updated_time
    ,is_deleted
    ,has_corn
    ,has_up_front
    ,has_webhook
    ,case_change_flag
    ,principal_id
  </sql>

  <sql id="Table_Name">
    ${defaultSchema}.atu_plan_info
  </sql>

  <select id="findByPrimaryKey" parameterType="String" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List"/>
    from
    <include refid="Table_Name"/>
    where id = #{id,jdbcType=VARCHAR}
  </select>

  <select id="findByPrimaryKeys" parameterType="java.util.List">
    select
    <include refid="Base_Column_List"/>
    from
    <include refid="Table_Name"/>
    where id in
    <foreach collection="list" item="idItem" open="(" separator="," close=")">
      #{idItem, jdbcType=VARCHAR}
    </foreach>
  </select>

  <delete id="deleteByPrimaryKey" parameterType="String">
    delete from
    <include refid="Table_Name"/>
    where id = #{id,jdbcType=VARCHAR}
  </delete>

  <delete id="deleteByPrimaryKeys" parameterType="String">
    delete from
    <include refid="Table_Name"/>
    where id in
    <foreach collection="list" item="idItem" open="(" separator="," close=")">
      #{idItem, jdbcType=VARCHAR}
    </foreach>
  </delete>

  <delete id="deleteByExample" parameterType="net.northking.cctp.executePlan.db.entity.AtuPlanInfo">
    delete from
    <include refid="Table_Name"/>
    <trim prefix="WHERE" prefixOverrides="AND" >
      <choose>
        <when test="id != null">
          id = #{id,jdbcType=VARCHAR}
        </when>
      </choose>
              <if test="id != null">
          AND id=#{id,jdbcType=VARCHAR}
        </if>
              <if test="tenantId != null">
          AND tenant_id=#{tenantId,jdbcType=VARCHAR}
        </if>
              <if test="projectId != null">
          AND project_id=#{projectId,jdbcType=VARCHAR}
        </if>
              <if test="planName != null">
          AND plan_name=#{planName,jdbcType=VARCHAR}
        </if>
              <if test="planDesc != null">
          AND plan_desc=#{planDesc,jdbcType=VARCHAR}
        </if>
              <if test="enabled != null">
          AND is_enabled=#{enabled,jdbcType=BIT}
        </if>
              <if test="status != null">
          AND status=#{status,jdbcType=CHAR}
        </if>
              <if test="appSet != null">
          AND app_set=#{appSet,jdbcType=CHAR}
        </if>
              <if test="screenRecordSet != null">
          AND screen_record_set=#{screenRecordSet,jdbcType=CHAR}
        </if>
              <if test="screenshotSet != null">
          AND screenshot_set=#{screenshotSet,jdbcType=CHAR}
        </if>
              <if test="priority != null">
          AND priority=#{priority,jdbcType=CHAR}
        </if>
              <if test="cronExpr != null">
          AND cron_expr=#{cronExpr,jdbcType=VARCHAR}
        </if>
              <if test="upFrontPlanId != null">
          AND up_front_plan_id=#{upFrontPlanId,jdbcType=VARCHAR}
        </if>
              <if test="webhookUrl != null">
          AND webhook_url=#{webhookUrl,jdbcType=VARCHAR}
        </if>
              <if test="webhookToken != null">
          AND webhook_token=#{webhookToken,jdbcType=VARCHAR}
        </if>
              <if test="sendMail != null">
          AND is_send_mail=#{sendMail,jdbcType=BIT}
        </if>
              <if test="mailAddress != null">
          AND mail_address=#{mailAddress,jdbcType=VARCHAR}
        </if>
              <if test="failRetry != null">
          AND is_fail_retry=#{failRetry,jdbcType=BIT}
        </if>
              <if test="failRetryCount != null">
          AND fail_retry_count=#{failRetryCount,jdbcType=INTEGER}
        </if>
              <if test="failCreatePlan != null">
          AND is_fail_create_plan=#{failCreatePlan,jdbcType=BIT}
        </if>
              <if test="lastExecTime != null">
          AND last_exec_time=#{lastExecTime,jdbcType=TIMESTAMP}
        </if>
              <if test="nextExecTime != null">
          AND next_exec_time=#{nextExecTime,jdbcType=TIMESTAMP}
        </if>
              <if test="lastBatchId != null">
          AND last_batch_id=#{lastBatchId,jdbcType=VARCHAR}
        </if>
              <if test="waitingNum != null">
          AND waiting_num=#{waitingNum,jdbcType=INTEGER}
        </if>
              <if test="runningNum != null">
          AND running_num=#{runningNum,jdbcType=INTEGER}
        </if>
              <if test="successNum != null">
          AND success_num=#{successNum,jdbcType=INTEGER}
        </if>
              <if test="execFailNum != null">
          AND exec_fail_num=#{execFailNum,jdbcType=INTEGER}
        </if>
              <if test="assertFailNum != null">
          AND assert_fail_num=#{assertFailNum,jdbcType=INTEGER}
        </if>
              <if test="timeoutNum != null">
          AND timeout_num=#{timeoutNum,jdbcType=INTEGER}
        </if>
              <if test="cancelNum != null">
          AND cancel_num=#{cancelNum,jdbcType=INTEGER}
        </if>
              <if test="createdBy != null">
          AND created_by=#{createdBy,jdbcType=VARCHAR}
        </if>
              <if test="createdTime != null">
          AND created_time=#{createdTime,jdbcType=TIMESTAMP}
        </if>
              <if test="updatedBy != null">
          AND updated_by=#{updatedBy,jdbcType=VARCHAR}
        </if>
              <if test="updatedTime != null">
          AND updated_time=#{updatedTime,jdbcType=TIMESTAMP}
        </if>
              <if test="deleted != null">
          AND is_deleted=#{deleted,jdbcType=BIT}
        </if>
              <if test="hasCorn != null">
          AND has_corn=#{hasCorn,jdbcType=BIT}
        </if>
              <if test="hasUpFront != null">
          AND has_up_front=#{hasUpFront,jdbcType=BIT}
        </if>
              <if test="hasWebhook != null">
          AND has_webhook=#{hasWebhook,jdbcType=BIT}
        </if>
              <if test="caseChangeFlag != null">
          AND case_change_flag=#{caseChangeFlag,jdbcType=BIT}
        </if>
              <if test="principalId != null">
          AND principal_id=#{principalId,jdbcType=VARCHAR}
        </if>
          </trim>
  </delete>

  <insert id="insert" parameterType="net.northking.cctp.executePlan.db.entity.AtuPlanInfo">
    insert into
    <include refid="Table_Name"/>
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="tenantId != null">
        tenant_id,
      </if>
      <if test="projectId != null">
        project_id,
      </if>
      <if test="planName != null">
        plan_name,
      </if>
      <if test="planDesc != null">
        plan_desc,
      </if>
      <if test="enabled != null">
        is_enabled,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="appSet != null">
        app_set,
      </if>
      <if test="screenRecordSet != null">
        screen_record_set,
      </if>
      <if test="screenshotSet != null">
        screenshot_set,
      </if>
      <if test="priority != null">
        priority,
      </if>
      <if test="cronExpr != null">
        cron_expr,
      </if>
      <if test="upFrontPlanId != null">
        up_front_plan_id,
      </if>
      <if test="webhookUrl != null">
        webhook_url,
      </if>
      <if test="webhookToken != null">
        webhook_token,
      </if>
      <if test="sendMail != null">
        is_send_mail,
      </if>
      <if test="mailAddress != null">
        mail_address,
      </if>
      <if test="failRetry != null">
        is_fail_retry,
      </if>
      <if test="failRetryCount != null">
        fail_retry_count,
      </if>
      <if test="failCreatePlan != null">
        is_fail_create_plan,
      </if>
      <if test="lastExecTime != null">
        last_exec_time,
      </if>
      <if test="nextExecTime != null">
        next_exec_time,
      </if>
      <if test="lastBatchId != null">
        last_batch_id,
      </if>
      <if test="waitingNum != null">
        waiting_num,
      </if>
      <if test="runningNum != null">
        running_num,
      </if>
      <if test="successNum != null">
        success_num,
      </if>
      <if test="execFailNum != null">
        exec_fail_num,
      </if>
      <if test="assertFailNum != null">
        assert_fail_num,
      </if>
      <if test="timeoutNum != null">
        timeout_num,
      </if>
      <if test="cancelNum != null">
        cancel_num,
      </if>
      <if test="createdBy != null">
        created_by,
      </if>
      <if test="createdTime != null">
        created_time,
      </if>
      <if test="updatedBy != null">
        updated_by,
      </if>
      <if test="updatedTime != null">
        updated_time,
      </if>
      <if test="deleted != null">
        is_deleted,
      </if>
      <if test="hasCorn != null">
        has_corn,
      </if>
      <if test="hasUpFront != null">
        has_up_front,
      </if>
      <if test="hasWebhook != null">
        has_webhook,
      </if>
      <if test="caseChangeFlag != null">
        case_change_flag,
      </if>
      <if test="principalId != null">
        principal_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
          #{id, jdbcType=VARCHAR},
      </if>
      <if test="tenantId != null">
          #{tenantId, jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
          #{projectId, jdbcType=VARCHAR},
      </if>
      <if test="planName != null">
          #{planName, jdbcType=VARCHAR},
      </if>
      <if test="planDesc != null">
          #{planDesc, jdbcType=VARCHAR},
      </if>
      <if test="enabled != null">
          #{enabled, jdbcType=BIT},
      </if>
      <if test="status != null">
          #{status, jdbcType=CHAR},
      </if>
      <if test="appSet != null">
          #{appSet, jdbcType=CHAR},
      </if>
      <if test="screenRecordSet != null">
          #{screenRecordSet, jdbcType=CHAR},
      </if>
      <if test="screenshotSet != null">
          #{screenshotSet, jdbcType=CHAR},
      </if>
      <if test="priority != null">
          #{priority, jdbcType=CHAR},
      </if>
      <if test="cronExpr != null">
          #{cronExpr, jdbcType=VARCHAR},
      </if>
      <if test="upFrontPlanId != null">
          #{upFrontPlanId, jdbcType=VARCHAR},
      </if>
      <if test="webhookUrl != null">
          #{webhookUrl, jdbcType=VARCHAR},
      </if>
      <if test="webhookToken != null">
          #{webhookToken, jdbcType=VARCHAR},
      </if>
      <if test="sendMail != null">
          #{sendMail, jdbcType=BIT},
      </if>
      <if test="mailAddress != null">
          #{mailAddress, jdbcType=VARCHAR},
      </if>
      <if test="failRetry != null">
          #{failRetry, jdbcType=BIT},
      </if>
      <if test="failRetryCount != null">
          #{failRetryCount, jdbcType=INTEGER},
      </if>
      <if test="failCreatePlan != null">
          #{failCreatePlan, jdbcType=BIT},
      </if>
      <if test="lastExecTime != null">
          #{lastExecTime, jdbcType=TIMESTAMP},
      </if>
      <if test="nextExecTime != null">
          #{nextExecTime, jdbcType=TIMESTAMP},
      </if>
      <if test="lastBatchId != null">
          #{lastBatchId, jdbcType=VARCHAR},
      </if>
      <if test="waitingNum != null">
          #{waitingNum, jdbcType=INTEGER},
      </if>
      <if test="runningNum != null">
          #{runningNum, jdbcType=INTEGER},
      </if>
      <if test="successNum != null">
          #{successNum, jdbcType=INTEGER},
      </if>
      <if test="execFailNum != null">
          #{execFailNum, jdbcType=INTEGER},
      </if>
      <if test="assertFailNum != null">
          #{assertFailNum, jdbcType=INTEGER},
      </if>
      <if test="timeoutNum != null">
          #{timeoutNum, jdbcType=INTEGER},
      </if>
      <if test="cancelNum != null">
          #{cancelNum, jdbcType=INTEGER},
      </if>
      <if test="createdBy != null">
          #{createdBy, jdbcType=VARCHAR},
      </if>
      <if test="createdTime != null">
          #{createdTime, jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
          #{updatedBy, jdbcType=VARCHAR},
      </if>
      <if test="updatedTime != null">
          #{updatedTime, jdbcType=TIMESTAMP},
      </if>
      <if test="deleted != null">
          #{deleted, jdbcType=BIT},
      </if>
      <if test="hasCorn != null">
          #{hasCorn, jdbcType=BIT},
      </if>
      <if test="hasUpFront != null">
          #{hasUpFront, jdbcType=BIT},
      </if>
      <if test="hasWebhook != null">
          #{hasWebhook, jdbcType=BIT},
      </if>
      <if test="caseChangeFlag != null">
          #{caseChangeFlag, jdbcType=BIT},
      </if>
      <if test="principalId != null">
        #{principalId, jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>

  <insert id="insertByBatch" parameterType="java.util.List">
    insert into
    <include refid="Table_Name"/>
    <trim prefix="(" suffix=")" suffixOverrides=",">
    id,
    tenant_id,
    project_id,
    plan_name,
    plan_desc,
    is_enabled,
    status,
    app_set,
    screen_record_set,
    screenshot_set,
    priority,
    cron_expr,
    up_front_plan_id,
    webhook_url,
    webhook_token,
    is_send_mail,
    mail_address,
    is_fail_retry,
    fail_retry_count,
    is_fail_create_plan,
    last_exec_time,
    next_exec_time,
    last_batch_id,
    waiting_num,
    running_num,
    success_num,
    exec_fail_num,
    assert_fail_num,
    timeout_num,
    cancel_num,
    created_by,
    created_time,
    updated_by,
    updated_time,
    is_deleted,
    has_corn,
    has_up_front,
    has_webhook,
    case_change_flag,
    principal_id,
    </trim>
    values
    <foreach collection="list" item="item" index="index" separator=",">
      <trim prefix="(" suffix=")" suffixOverrides=",">
    #{item.id, jdbcType=VARCHAR},
    #{item.tenantId, jdbcType=VARCHAR},
    #{item.projectId, jdbcType=VARCHAR},
    #{item.planName, jdbcType=VARCHAR},
    #{item.planDesc, jdbcType=VARCHAR},
    #{item.enabled, jdbcType=BIT},
    #{item.status, jdbcType=CHAR},
    #{item.appSet, jdbcType=CHAR},
    #{item.screenRecordSet, jdbcType=CHAR},
    #{item.screenshotSet, jdbcType=CHAR},
    #{item.priority, jdbcType=CHAR},
    #{item.cronExpr, jdbcType=VARCHAR},
    #{item.upFrontPlanId, jdbcType=VARCHAR},
    #{item.webhookUrl, jdbcType=VARCHAR},
    #{item.webhookToken, jdbcType=VARCHAR},
    #{item.sendMail, jdbcType=BIT},
    #{item.mailAddress, jdbcType=VARCHAR},
    #{item.failRetry, jdbcType=BIT},
    #{item.failRetryCount, jdbcType=INTEGER},
    #{item.failCreatePlan, jdbcType=BIT},
    #{item.lastExecTime, jdbcType=TIMESTAMP},
    #{item.nextExecTime, jdbcType=TIMESTAMP},
    #{item.lastBatchId, jdbcType=VARCHAR},
    #{item.waitingNum, jdbcType=INTEGER},
    #{item.runningNum, jdbcType=INTEGER},
    #{item.successNum, jdbcType=INTEGER},
    #{item.execFailNum, jdbcType=INTEGER},
    #{item.assertFailNum, jdbcType=INTEGER},
    #{item.timeoutNum, jdbcType=INTEGER},
    #{item.cancelNum, jdbcType=INTEGER},
    #{item.createdBy, jdbcType=VARCHAR},
    #{item.createdTime, jdbcType=TIMESTAMP},
    #{item.updatedBy, jdbcType=VARCHAR},
    #{item.updatedTime, jdbcType=TIMESTAMP},
    #{item.deleted, jdbcType=BIT},
    #{item.hasCorn, jdbcType=BIT},
    #{item.hasUpFront, jdbcType=BIT},
    #{item.hasWebhook, jdbcType=BIT},
    #{item.caseChangeFlag, jdbcType=BIT},
    #{item.principalId, jdbcType=VARCHAR},
      </trim>
    </foreach>
  </insert>

  <update id="updateByPrimaryKey" parameterType="net.northking.cctp.executePlan.db.entity.AtuPlanInfo">
    update
    <include refid="Table_Name"/>
    <set>
      <if test="tenantId != null">
        tenant_id = #{tenantId, jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        project_id = #{projectId, jdbcType=VARCHAR},
      </if>
      <if test="planName != null">
        plan_name = #{planName, jdbcType=VARCHAR},
      </if>
      <if test="planDesc != null">
        plan_desc = #{planDesc, jdbcType=VARCHAR},
      </if>
      <if test="enabled != null">
        is_enabled = #{enabled, jdbcType=BIT},
      </if>
      <if test="status != null">
        status = #{status, jdbcType=CHAR},
      </if>
      <if test="appSet != null">
        app_set = #{appSet, jdbcType=CHAR},
      </if>
      <if test="screenRecordSet != null">
        screen_record_set = #{screenRecordSet, jdbcType=CHAR},
      </if>
      <if test="screenshotSet != null">
        screenshot_set = #{screenshotSet, jdbcType=CHAR},
      </if>
      <if test="priority != null">
        priority = #{priority, jdbcType=CHAR},
      </if>
      <if test="cronExpr != null">
        cron_expr = #{cronExpr, jdbcType=VARCHAR},
      </if>
      <if test="upFrontPlanId != null">
        up_front_plan_id = #{upFrontPlanId, jdbcType=VARCHAR},
      </if>
      <if test="webhookUrl != null">
        webhook_url = #{webhookUrl, jdbcType=VARCHAR},
      </if>
      <if test="webhookToken != null">
        webhook_token = #{webhookToken, jdbcType=VARCHAR},
      </if>
      <if test="sendMail != null">
        is_send_mail = #{sendMail, jdbcType=BIT},
      </if>
      <if test="mailAddress != null">
        mail_address = #{mailAddress, jdbcType=VARCHAR},
      </if>
      <if test="failRetry != null">
        is_fail_retry = #{failRetry, jdbcType=BIT},
      </if>
      <if test="failRetryCount != null">
        fail_retry_count = #{failRetryCount, jdbcType=INTEGER},
      </if>
      <if test="failCreatePlan != null">
        is_fail_create_plan = #{failCreatePlan, jdbcType=BIT},
      </if>
      <if test="lastExecTime != null">
        last_exec_time = #{lastExecTime, jdbcType=TIMESTAMP},
      </if>
      <if test="nextExecTime != null">
        next_exec_time = #{nextExecTime, jdbcType=TIMESTAMP},
      </if>
      <if test="lastBatchId != null">
        last_batch_id = #{lastBatchId, jdbcType=VARCHAR},
      </if>
      <if test="waitingNum != null">
        waiting_num = #{waitingNum, jdbcType=INTEGER},
      </if>
      <if test="runningNum != null">
        running_num = #{runningNum, jdbcType=INTEGER},
      </if>
      <if test="successNum != null">
        success_num = #{successNum, jdbcType=INTEGER},
      </if>
      <if test="execFailNum != null">
        exec_fail_num = #{execFailNum, jdbcType=INTEGER},
      </if>
      <if test="assertFailNum != null">
        assert_fail_num = #{assertFailNum, jdbcType=INTEGER},
      </if>
      <if test="timeoutNum != null">
        timeout_num = #{timeoutNum, jdbcType=INTEGER},
      </if>
      <if test="cancelNum != null">
        cancel_num = #{cancelNum, jdbcType=INTEGER},
      </if>
      <if test="createdBy != null">
        created_by = #{createdBy, jdbcType=VARCHAR},
      </if>
      <if test="createdTime != null">
        created_time = #{createdTime, jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
        updated_by = #{updatedBy, jdbcType=VARCHAR},
      </if>
      <if test="updatedTime != null">
        updated_time = #{updatedTime, jdbcType=TIMESTAMP},
      </if>
      <if test="deleted != null">
        is_deleted = #{deleted, jdbcType=BIT},
      </if>
      <if test="hasCorn != null">
        has_corn = #{hasCorn, jdbcType=BIT},
      </if>
      <if test="hasUpFront != null">
        has_up_front = #{hasUpFront, jdbcType=BIT},
      </if>
      <if test="hasWebhook != null">
        has_webhook = #{hasWebhook, jdbcType=BIT},
      </if>
      <if test="caseChangeFlag != null">
        case_change_flag = #{caseChangeFlag, jdbcType=BIT},
      </if>
      <if test="principalId != null">
        principal_id = #{principalId, jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>

  <select id="query" resultMap="BaseResultMap" parameterType="net.northking.cctp.executePlan.db.entity.AtuPlanInfo">
    select
    <include refid="Base_Column_List" />
    from
    <include refid="Table_Name"/>
    <trim prefix="WHERE" prefixOverrides="AND" >
      <if test="id != null">
        AND id = #{id,jdbcType=VARCHAR}
      </if>
      <if test="tenantId != null">
        AND tenant_id = #{tenantId,jdbcType=VARCHAR}
      </if>
      <if test="projectId != null">
        AND project_id = #{projectId,jdbcType=VARCHAR}
      </if>
      <if test="planName != null">
        AND plan_name = #{planName,jdbcType=VARCHAR}
      </if>
      <if test="planDesc != null">
        AND plan_desc = #{planDesc,jdbcType=VARCHAR}
      </if>
      <if test="enabled != null">
        AND is_enabled = #{enabled,jdbcType=BIT}
      </if>
      <if test="status != null">
        AND status = #{status,jdbcType=CHAR}
      </if>
      <if test="appSet != null">
        AND app_set = #{appSet,jdbcType=CHAR}
      </if>
      <if test="screenRecordSet != null">
        AND screen_record_set = #{screenRecordSet,jdbcType=CHAR}
      </if>
      <if test="screenshotSet != null">
        AND screenshot_set = #{screenshotSet,jdbcType=CHAR}
      </if>
      <if test="priority != null">
        AND priority = #{priority,jdbcType=CHAR}
      </if>
      <if test="cronExpr != null">
        AND cron_expr = #{cronExpr,jdbcType=VARCHAR}
      </if>
      <if test="upFrontPlanId != null">
        AND up_front_plan_id = #{upFrontPlanId,jdbcType=VARCHAR}
      </if>
      <if test="webhookUrl != null">
        AND webhook_url = #{webhookUrl,jdbcType=VARCHAR}
      </if>
      <if test="webhookToken != null">
        AND webhook_token = #{webhookToken,jdbcType=VARCHAR}
      </if>
      <if test="sendMail != null">
        AND is_send_mail = #{sendMail,jdbcType=BIT}
      </if>
      <if test="mailAddress != null">
        AND mail_address = #{mailAddress,jdbcType=VARCHAR}
      </if>
      <if test="failRetry != null">
        AND is_fail_retry = #{failRetry,jdbcType=BIT}
      </if>
      <if test="failRetryCount != null">
        AND fail_retry_count = #{failRetryCount,jdbcType=INTEGER}
      </if>
      <if test="failCreatePlan != null">
        AND is_fail_create_plan = #{failCreatePlan,jdbcType=BIT}
      </if>
      <if test="lastExecTime != null">
        AND last_exec_time = #{lastExecTime,jdbcType=TIMESTAMP}
      </if>
      <if test="nextExecTime != null">
        AND next_exec_time = #{nextExecTime,jdbcType=TIMESTAMP}
      </if>
      <if test="lastBatchId != null">
        AND last_batch_id = #{lastBatchId,jdbcType=VARCHAR}
      </if>
      <if test="waitingNum != null">
        AND waiting_num = #{waitingNum,jdbcType=INTEGER}
      </if>
      <if test="runningNum != null">
        AND running_num = #{runningNum,jdbcType=INTEGER}
      </if>
      <if test="successNum != null">
        AND success_num = #{successNum,jdbcType=INTEGER}
      </if>
      <if test="execFailNum != null">
        AND exec_fail_num = #{execFailNum,jdbcType=INTEGER}
      </if>
      <if test="assertFailNum != null">
        AND assert_fail_num = #{assertFailNum,jdbcType=INTEGER}
      </if>
      <if test="timeoutNum != null">
        AND timeout_num = #{timeoutNum,jdbcType=INTEGER}
      </if>
      <if test="cancelNum != null">
        AND cancel_num = #{cancelNum,jdbcType=INTEGER}
      </if>
      <if test="createdBy != null">
        AND created_by = #{createdBy,jdbcType=VARCHAR}
      </if>
      <if test="createdTime != null">
        AND created_time = #{createdTime,jdbcType=TIMESTAMP}
      </if>
      <if test="updatedBy != null">
        AND updated_by = #{updatedBy,jdbcType=VARCHAR}
      </if>
      <if test="updatedTime != null">
        AND updated_time = #{updatedTime,jdbcType=TIMESTAMP}
      </if>
      <if test="deleted != null">
        AND is_deleted = #{deleted,jdbcType=BIT}
      </if>
      <if test="hasCorn != null">
        AND has_corn = #{hasCorn,jdbcType=BIT}
      </if>
      <if test="hasUpFront != null">
        AND has_up_front = #{hasUpFront,jdbcType=BIT}
      </if>
      <if test="hasWebhook != null">
        AND has_webhook = #{hasWebhook,jdbcType=BIT}
      </if>
      <if test="caseChangeFlag != null">
        AND case_change_flag = #{caseChangeFlag,jdbcType=BIT}
      </if>
      <if test="principalId != null">
        AND principal_id = #{principalId,jdbcType=VARCHAR}
      </if>
    </trim>
  </select>

  <select id="queryCount" resultType="java.lang.Long" parameterType="net.northking.cctp.executePlan.db.entity.AtuPlanInfo">
    select count(*) from
    <include refid="Table_Name"/>
    <trim prefix="WHERE" prefixOverrides="AND" >
      <if test="id != null">
        AND id=#{id,jdbcType=VARCHAR}
      </if>
      <if test="tenantId != null">
        AND tenant_id=#{tenantId,jdbcType=VARCHAR}
      </if>
      <if test="projectId != null">
        AND project_id=#{projectId,jdbcType=VARCHAR}
      </if>
      <if test="planName != null">
        AND plan_name=#{planName,jdbcType=VARCHAR}
      </if>
      <if test="planDesc != null">
        AND plan_desc=#{planDesc,jdbcType=VARCHAR}
      </if>
      <if test="enabled != null">
        AND is_enabled=#{enabled,jdbcType=BIT}
      </if>
      <if test="status != null">
        AND status=#{status,jdbcType=CHAR}
      </if>
      <if test="appSet != null">
        AND app_set=#{appSet,jdbcType=CHAR}
      </if>
      <if test="screenRecordSet != null">
        AND screen_record_set=#{screenRecordSet,jdbcType=CHAR}
      </if>
      <if test="screenshotSet != null">
        AND screenshot_set=#{screenshotSet,jdbcType=CHAR}
      </if>
      <if test="priority != null">
        AND priority=#{priority,jdbcType=CHAR}
      </if>
      <if test="cronExpr != null">
        AND cron_expr=#{cronExpr,jdbcType=VARCHAR}
      </if>
      <if test="upFrontPlanId != null">
        AND up_front_plan_id=#{upFrontPlanId,jdbcType=VARCHAR}
      </if>
      <if test="webhookUrl != null">
        AND webhook_url=#{webhookUrl,jdbcType=VARCHAR}
      </if>
      <if test="webhookToken != null">
        AND webhook_token=#{webhookToken,jdbcType=VARCHAR}
      </if>
      <if test="sendMail != null">
        AND is_send_mail=#{sendMail,jdbcType=BIT}
      </if>
      <if test="mailAddress != null">
        AND mail_address=#{mailAddress,jdbcType=VARCHAR}
      </if>
      <if test="failRetry != null">
        AND is_fail_retry=#{failRetry,jdbcType=BIT}
      </if>
      <if test="failRetryCount != null">
        AND fail_retry_count=#{failRetryCount,jdbcType=INTEGER}
      </if>
      <if test="failCreatePlan != null">
        AND is_fail_create_plan=#{failCreatePlan,jdbcType=BIT}
      </if>
      <if test="lastExecTime != null">
        AND last_exec_time=#{lastExecTime,jdbcType=TIMESTAMP}
      </if>
      <if test="nextExecTime != null">
        AND next_exec_time=#{nextExecTime,jdbcType=TIMESTAMP}
      </if>
      <if test="lastBatchId != null">
        AND last_batch_id=#{lastBatchId,jdbcType=VARCHAR}
      </if>
      <if test="waitingNum != null">
        AND waiting_num=#{waitingNum,jdbcType=INTEGER}
      </if>
      <if test="runningNum != null">
        AND running_num=#{runningNum,jdbcType=INTEGER}
      </if>
      <if test="successNum != null">
        AND success_num=#{successNum,jdbcType=INTEGER}
      </if>
      <if test="execFailNum != null">
        AND exec_fail_num=#{execFailNum,jdbcType=INTEGER}
      </if>
      <if test="assertFailNum != null">
        AND assert_fail_num=#{assertFailNum,jdbcType=INTEGER}
      </if>
      <if test="timeoutNum != null">
        AND timeout_num=#{timeoutNum,jdbcType=INTEGER}
      </if>
      <if test="cancelNum != null">
        AND cancel_num=#{cancelNum,jdbcType=INTEGER}
      </if>
      <if test="createdBy != null">
        AND created_by=#{createdBy,jdbcType=VARCHAR}
      </if>
      <if test="createdTime != null">
        AND created_time=#{createdTime,jdbcType=TIMESTAMP}
      </if>
      <if test="updatedBy != null">
        AND updated_by=#{updatedBy,jdbcType=VARCHAR}
      </if>
      <if test="updatedTime != null">
        AND updated_time=#{updatedTime,jdbcType=TIMESTAMP}
      </if>
      <if test="deleted != null">
        AND is_deleted=#{deleted,jdbcType=BIT}
      </if>
      <if test="hasCorn != null">
        AND has_corn=#{hasCorn,jdbcType=BIT}
      </if>
      <if test="hasUpFront != null">
        AND has_up_front=#{hasUpFront,jdbcType=BIT}
      </if>
      <if test="hasWebhook != null">
        AND has_webhook=#{hasWebhook,jdbcType=BIT}
      </if>
      <if test="caseChangeFlag != null">
        AND case_change_flag=#{caseChangeFlag,jdbcType=BIT}
      </if>
      <if test="principalId != null">
        AND principal_id = #{principalId,jdbcType=VARCHAR}
      </if>
    </trim>
  </select>

</mapper>