<?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 2021 . All rights reserved. -->
<!--  Mybatis数据库持久层（底层映射文件）：缺陷管理 -->
<!--  version: 1.0  -->
<!--  author:  maven-cctp-plugin    -->
<!--  date:  2021-12-09 10:41:46  -->
<mapper namespace="net.northking.cctp.testbug.db.dao.BugManagementDao">
  <resultMap id="BaseResultMap" type="net.northking.cctp.testbug.db.entity.BugManagement">
      <!-- 缺陷id -->
    <id column="bug_id" jdbcType="VARCHAR" property="bugId"/>
                                                                                                      <!-- 缺陷标题 -->
    <result column="bug_title" jdbcType="VARCHAR" property="bugTitle"/>
        <!-- 严重程度:   建议性错误-E类、警告性错误-D类、一般性错误-C类、严重性错误-B类、致命性错误-A类
 -->
    <result column="bug_grade" jdbcType="CHAR" property="bugGrade"/>
        <!-- 缺陷分类:  1.需求缺陷、2.设计缺陷、3.编码缺陷、4.UI缺陷、5.兼容性缺陷、6.环境缺陷、7.用户体验、8移植缺陷 -->
    <result column="bug_type" jdbcType="VARCHAR" property="bugType"/>
        <!-- 缺陷编码 -->
    <result column="bug_order" jdbcType="VARCHAR" property="bugOrder"/>
        <!-- 缺陷来源：1.手动提交,2.自动化提交,3.测试执行提交 -->
    <result column="bug_from" jdbcType="VARCHAR" property="bugFrom"/>
        <!-- 紧急程度：1.高、2.中、3.低 -->
    <result column="emergency" jdbcType="VARCHAR" property="emergency"/>
        <!-- 可重现：Y是、N否 -->
    <result column="is_reappear" jdbcType="CHAR" property="isReappear"/>
        <!-- 缺陷状态：1.新建、2.打开、3.已分配、4.拒绝、5.待验证、6.处理中、7.延迟、8.已修复、9.关闭、10.无效、11.重新打开、12.挂起、13.待裁决、14.待完善、15.待分配、16.待修复、17.待审核 -->
    <result column="bug_status" jdbcType="VARCHAR" property="bugStatus"/>
        <!-- 分配给，缺陷接收人 -->
    <result column="receiver" jdbcType="VARCHAR" property="receiver"/>
        <!-- 修复时间 -->
    <result column="repair_time" jdbcType="TIMESTAMP" property="repairTime"/>
        <!-- 修复人 -->
    <result column="repair_user" jdbcType="VARCHAR" property="repairUser"/>
        <!-- 关闭日期 -->
    <result column="close_time" jdbcType="TIMESTAMP" property="closeTime"/>
        <!-- 错误信息描述 -->
    <result column="error_message" jdbcType="LONGVARCHAR" property="errorMessage"/>
        <!-- 自定义字段 -->
    <result column="expands" jdbcType="LONGVARCHAR" property="expands"/>
        <!-- 注释 -->
    <result column="message" jdbcType="LONGVARCHAR" property="message"/>
        <!-- 系统id -->
    <result column="system_id" jdbcType="VARCHAR" property="systemId"/>
        <!-- 轮次id -->
    <result column="round_id" jdbcType="VARCHAR" property="roundId"/>
        <!-- 模块id -->
    <result column="module_id" jdbcType="VARCHAR" property="moduleId"/>
        <!-- 关联用例数 -->
    <result column="case_num" jdbcType="INTEGER" property="caseNum"/>
        <!-- 项目id -->
    <result column="pro_id" jdbcType="VARCHAR" property="proId"/>
        <!-- 创建发现人 -->
    <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"/>
        <!-- 租户id -->
    <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
        <!-- 排序 -->
    <result column="order_seq" jdbcType="INTEGER" property="orderSeq"/>
        <!--  -->
    <result column="USER_DEFINED_IDX1" jdbcType="VARCHAR" property="userDefinedIdx1"/>
        <!--  -->
    <result column="USER_DEFINED_IDX2" jdbcType="VARCHAR" property="userDefinedIdx2"/>
        <!--  -->
    <result column="USER_DEFINED_IDX3" jdbcType="VARCHAR" property="userDefinedIdx3"/>
        <!--  -->
    <result column="USER_DEFINED_IDX4" jdbcType="VARCHAR" property="userDefinedIdx4"/>
        <!--  -->
    <result column="USER_DEFINED_IDX5" jdbcType="VARCHAR" property="userDefinedIdx5"/>
        <!--  -->
    <result column="USER_DEFINED_IDX6" jdbcType="VARCHAR" property="userDefinedIdx6"/>
        <!--  -->
    <result column="USER_DEFINED_IDX7" jdbcType="VARCHAR" property="userDefinedIdx7"/>
        <!--  -->
    <result column="USER_DEFINED_IDX8" jdbcType="VARCHAR" property="userDefinedIdx8"/>
        <!--  -->
    <result column="USER_DEFINED_IDX9" jdbcType="VARCHAR" property="userDefinedIdx9"/>
        <!--  -->
    <result column="USER_DEFINED_IDX10" jdbcType="VARCHAR" property="userDefinedIdx10"/>
        <!--  -->
    <result column="USER_DEFINED_IDX11" jdbcType="VARCHAR" property="userDefinedIdx11"/>
        <!--  -->
    <result column="USER_DEFINED_IDX12" jdbcType="VARCHAR" property="userDefinedIdx12"/>
        <!--  -->
    <result column="USER_DEFINED_IDX13" jdbcType="VARCHAR" property="userDefinedIdx13"/>
        <!--  -->
    <result column="USER_DEFINED_IDX14" jdbcType="VARCHAR" property="userDefinedIdx14"/>
        <!--  -->
    <result column="USER_DEFINED_IDX15" jdbcType="VARCHAR" property="userDefinedIdx15"/>
        <!--  -->
    <result column="USER_DEFINED_IDX16" jdbcType="VARCHAR" property="userDefinedIdx16"/>
        <!--  -->
    <result column="USER_DEFINED_IDX17" jdbcType="VARCHAR" property="userDefinedIdx17"/>
        <!--  -->
    <result column="USER_DEFINED_IDX18" jdbcType="VARCHAR" property="userDefinedIdx18"/>
        <!--  -->
    <result column="USER_DEFINED_IDX19" jdbcType="VARCHAR" property="userDefinedIdx19"/>
        <!--  -->
    <result column="USER_DEFINED_IDX20" jdbcType="VARCHAR" property="userDefinedIdx20"/>
    </resultMap>

  <sql id="Base_Column_List">
    bug_id
    ,bug_title
    ,bug_grade
    ,bug_type
    ,bug_order
    ,bug_from
    ,emergency
    ,is_reappear
    ,bug_status
    ,receiver
    ,repair_time
    ,repair_user
    ,close_time
    ,error_message
    ,expands
    ,message
    ,system_id
    ,round_id
    ,module_id
    ,case_num
    ,pro_id
    ,created_by
    ,created_time
    ,updated_by
    ,updated_time
    ,tenant_id
    ,order_seq
    ,USER_DEFINED_IDX1
    ,USER_DEFINED_IDX2
    ,USER_DEFINED_IDX3
    ,USER_DEFINED_IDX4
    ,USER_DEFINED_IDX5
    ,USER_DEFINED_IDX6
    ,USER_DEFINED_IDX7
    ,USER_DEFINED_IDX8
    ,USER_DEFINED_IDX9
    ,USER_DEFINED_IDX10
    ,USER_DEFINED_IDX11
    ,USER_DEFINED_IDX12
    ,USER_DEFINED_IDX13
    ,USER_DEFINED_IDX14
    ,USER_DEFINED_IDX15
    ,USER_DEFINED_IDX16
    ,USER_DEFINED_IDX17
    ,USER_DEFINED_IDX18
    ,USER_DEFINED_IDX19
    ,USER_DEFINED_IDX20
  </sql>

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

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

  <select id="findByPrimaryKeys" parameterType="java.util.List">
    select
    <include refid="Base_Column_List"/>
    from
    <include refid="Table_Name"/>
    where bug_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 bug_id = #{bugId,jdbcType=VARCHAR}
  </delete>

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

  <delete id="deleteByExample" parameterType="net.northking.cctp.testbug.db.entity.BugManagement">
    delete from
    <include refid="Table_Name"/>
    <trim prefix="WHERE" prefixOverrides="AND" >
      <if test="bugId != null">
          AND bug_id=#{bugId,jdbcType=VARCHAR}
      </if>
      <if test="bugTitle != null">
          AND bug_title=#{bugTitle,jdbcType=VARCHAR}
      </if>
      <if test="bugGrade != null">
          AND bug_grade=#{bugGrade,jdbcType=CHAR}
      </if>
      <if test="bugType != null">
          AND bug_type=#{bugType,jdbcType=VARCHAR}
      </if>
      <if test="bugOrder != null">
          AND bug_order=#{bugOrder,jdbcType=VARCHAR}
      </if>
      <if test="bugFrom != null">
          AND bug_from=#{bugFrom,jdbcType=VARCHAR}
      </if>
      <if test="emergency != null">
          AND emergency=#{emergency,jdbcType=VARCHAR}
      </if>
      <if test="isReappear != null">
          AND is_reappear=#{isReappear,jdbcType=CHAR}
      </if>
      <if test="bugStatus != null">
          AND bug_status=#{bugStatus,jdbcType=VARCHAR}
      </if>
      <if test="receiver != null">
          AND receiver=#{receiver,jdbcType=VARCHAR}
      </if>
      <if test="repairTime != null">
          AND repair_time=#{repairTime,jdbcType=TIMESTAMP}
      </if>
      <if test="repairUser != null">
          AND repair_user=#{repairUser,jdbcType=VARCHAR}
      </if>
      <if test="closeTime != null">
          AND close_time=#{closeTime,jdbcType=TIMESTAMP}
      </if>
      <if test="errorMessage != null">
          AND error_message=#{errorMessage,jdbcType=LONGVARCHAR}
      </if>
      <if test="expands != null">
          AND expands=#{expands,jdbcType=LONGVARCHAR}
      </if>
      <if test="message != null">
          AND message=#{message,jdbcType=LONGVARCHAR}
      </if>
      <if test="systemId != null">
          AND system_id=#{systemId,jdbcType=VARCHAR}
      </if>
      <if test="roundId != null">
          AND round_id=#{roundId,jdbcType=VARCHAR}
      </if>
      <if test="moduleId != null">
          AND module_id=#{moduleId,jdbcType=VARCHAR}
      </if>
      <if test="caseNum != null">
          AND case_num=#{caseNum,jdbcType=INTEGER}
      </if>
      <if test="proId != null">
          AND pro_id=#{proId,jdbcType=VARCHAR}
      </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="tenantId != null">
          AND tenant_id=#{tenantId,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx1 != null">
          AND USER_DEFINED_IDX1=#{userDefinedIdx1,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx2 != null">
          AND USER_DEFINED_IDX2=#{userDefinedIdx2,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx3 != null">
          AND USER_DEFINED_IDX3=#{userDefinedIdx3,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx4 != null">
          AND USER_DEFINED_IDX4=#{userDefinedIdx4,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx5 != null">
          AND USER_DEFINED_IDX5=#{userDefinedIdx5,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx6 != null">
          AND USER_DEFINED_IDX6=#{userDefinedIdx6,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx7 != null">
          AND USER_DEFINED_IDX7=#{userDefinedIdx7,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx8 != null">
          AND USER_DEFINED_IDX8=#{userDefinedIdx8,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx9 != null">
          AND USER_DEFINED_IDX9=#{userDefinedIdx9,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx10 != null">
          AND USER_DEFINED_IDX10=#{userDefinedIdx10,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx11 != null">
          AND USER_DEFINED_IDX11=#{userDefinedIdx11,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx12 != null">
          AND USER_DEFINED_IDX12=#{userDefinedIdx12,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx13 != null">
          AND USER_DEFINED_IDX13=#{userDefinedIdx13,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx14 != null">
          AND USER_DEFINED_IDX14=#{userDefinedIdx14,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx15 != null">
          AND USER_DEFINED_IDX15=#{userDefinedIdx15,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx16 != null">
          AND USER_DEFINED_IDX16=#{userDefinedIdx16,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx17 != null">
          AND USER_DEFINED_IDX17=#{userDefinedIdx17,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx18 != null">
          AND USER_DEFINED_IDX18=#{userDefinedIdx18,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx19 != null">
          AND USER_DEFINED_IDX19=#{userDefinedIdx19,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx20 != null">
          AND USER_DEFINED_IDX20=#{userDefinedIdx20,jdbcType=VARCHAR}
      </if>
    </trim>
  </delete>

  <insert id="insert" parameterType="net.northking.cctp.testbug.db.entity.BugManagement">
    insert into
    <include refid="Table_Name"/>
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="bugId != null">
        bug_id,
      </if>
      <if test="bugTitle != null">
        bug_title,
      </if>
      <if test="bugGrade != null">
        bug_grade,
      </if>
      <if test="bugType != null">
        bug_type,
      </if>
      <if test="bugOrder != null">
        bug_order,
      </if>
      <if test="bugFrom != null">
        bug_from,
      </if>
      <if test="emergency != null">
        emergency,
      </if>
      <if test="isReappear != null">
        is_reappear,
      </if>
      <if test="bugStatus != null">
        bug_status,
      </if>
      <if test="receiver != null">
        receiver,
      </if>
      <if test="repairTime != null">
        repair_time,
      </if>
      <if test="repairUser != null">
        repair_user,
      </if>
      <if test="closeTime != null">
        close_time,
      </if>
      <if test="errorMessage != null">
        error_message,
      </if>
      <if test="expands != null">
        expands,
      </if>
      <if test="message != null">
        message,
      </if>
      <if test="systemId != null">
        system_id,
      </if>
      <if test="roundId != null">
        round_id,
      </if>
      <if test="moduleId != null">
        module_id,
      </if>
      <if test="caseNum != null">
        case_num,
      </if>
      <if test="proId != null">
        pro_id,
      </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="tenantId != null">
        tenant_id,
      </if>
      <if test="orderSeq != null">
        order_seq,
      </if>
      <if test="userDefinedIdx1 != null">
        USER_DEFINED_IDX1,
      </if>
      <if test="userDefinedIdx2 != null">
        USER_DEFINED_IDX2,
      </if>
      <if test="userDefinedIdx3 != null">
        USER_DEFINED_IDX3,
      </if>
      <if test="userDefinedIdx4 != null">
        USER_DEFINED_IDX4,
      </if>
      <if test="userDefinedIdx5 != null">
        USER_DEFINED_IDX5,
      </if>
      <if test="userDefinedIdx6 != null">
        USER_DEFINED_IDX6,
      </if>
      <if test="userDefinedIdx7 != null">
        USER_DEFINED_IDX7,
      </if>
      <if test="userDefinedIdx8 != null">
        USER_DEFINED_IDX8,
      </if>
      <if test="userDefinedIdx9 != null">
        USER_DEFINED_IDX9,
      </if>
      <if test="userDefinedIdx10 != null">
        USER_DEFINED_IDX10,
      </if>
      <if test="userDefinedIdx11 != null">
        USER_DEFINED_IDX11,
      </if>
      <if test="userDefinedIdx12 != null">
        USER_DEFINED_IDX12,
      </if>
      <if test="userDefinedIdx13 != null">
        USER_DEFINED_IDX13,
      </if>
      <if test="userDefinedIdx14 != null">
        USER_DEFINED_IDX14,
      </if>
      <if test="userDefinedIdx15 != null">
        USER_DEFINED_IDX15,
      </if>
      <if test="userDefinedIdx16 != null">
        USER_DEFINED_IDX16,
      </if>
      <if test="userDefinedIdx17 != null">
        USER_DEFINED_IDX17,
      </if>
      <if test="userDefinedIdx18 != null">
        USER_DEFINED_IDX18,
      </if>
      <if test="userDefinedIdx19 != null">
        USER_DEFINED_IDX19,
      </if>
      <if test="userDefinedIdx20 != null">
        USER_DEFINED_IDX20,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="bugId != null">
          #{bugId, jdbcType=VARCHAR},
      </if>
      <if test="bugTitle != null">
          #{bugTitle, jdbcType=VARCHAR},
      </if>
      <if test="bugGrade != null">
          #{bugGrade, jdbcType=CHAR},
      </if>
      <if test="bugType != null">
          #{bugType, jdbcType=VARCHAR},
      </if>
      <if test="bugOrder != null">
          #{bugOrder, jdbcType=VARCHAR},
      </if>
      <if test="bugFrom != null">
          #{bugFrom, jdbcType=VARCHAR},
      </if>
      <if test="emergency != null">
          #{emergency, jdbcType=VARCHAR},
      </if>
      <if test="isReappear != null">
          #{isReappear, jdbcType=CHAR},
      </if>
      <if test="bugStatus != null">
          #{bugStatus, jdbcType=VARCHAR},
      </if>
      <if test="receiver != null">
          #{receiver, jdbcType=VARCHAR},
      </if>
      <if test="repairTime != null">
          #{repairTime, jdbcType=TIMESTAMP},
      </if>
      <if test="repairUser != null">
          #{repairUser, jdbcType=VARCHAR},
      </if>
      <if test="closeTime != null">
          #{closeTime, jdbcType=TIMESTAMP},
      </if>
      <if test="errorMessage != null">
          #{errorMessage, jdbcType=LONGVARCHAR},
      </if>
      <if test="expands != null">
          #{expands, jdbcType=LONGVARCHAR},
      </if>
      <if test="message != null">
          #{message, jdbcType=LONGVARCHAR},
      </if>
      <if test="systemId != null">
          #{systemId, jdbcType=VARCHAR},
      </if>
      <if test="roundId != null">
          #{roundId, jdbcType=VARCHAR},
      </if>
      <if test="moduleId != null">
          #{moduleId, jdbcType=VARCHAR},
      </if>
      <if test="caseNum != null">
          #{caseNum, jdbcType=INTEGER},
      </if>
      <if test="proId != null">
          #{proId, jdbcType=VARCHAR},
      </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="tenantId != null">
          #{tenantId, jdbcType=VARCHAR},
      </if>
      <if test="orderSeq != null">
          #{orderSeq, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx1 != null">
          #{userDefinedIdx1, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx2 != null">
          #{userDefinedIdx2, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx3 != null">
          #{userDefinedIdx3, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx4 != null">
          #{userDefinedIdx4, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx5 != null">
          #{userDefinedIdx5, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx6 != null">
          #{userDefinedIdx6, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx7 != null">
          #{userDefinedIdx7, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx8 != null">
          #{userDefinedIdx8, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx9 != null">
          #{userDefinedIdx9, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx10 != null">
          #{userDefinedIdx10, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx11 != null">
          #{userDefinedIdx11, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx12 != null">
          #{userDefinedIdx12, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx13 != null">
          #{userDefinedIdx13, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx14 != null">
          #{userDefinedIdx14, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx15 != null">
          #{userDefinedIdx15, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx16 != null">
          #{userDefinedIdx16, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx17 != null">
          #{userDefinedIdx17, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx18 != null">
          #{userDefinedIdx18, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx19 != null">
          #{userDefinedIdx19, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx20 != null">
          #{userDefinedIdx20, jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>

  <insert id="insertByBatch" parameterType="java.util.List">
    insert into
    <include refid="Table_Name"/>
    <trim prefix="(" suffix=")" suffixOverrides=",">
    bug_id,
    bug_title,
    bug_grade,
    bug_type,
    bug_order,
    bug_from,
    emergency,
    is_reappear,
    bug_status,
    receiver,
    repair_time,
    repair_user,
    close_time,
    error_message,
    expands,
    message,
    system_id,
    round_id,
    module_id,
    case_num,
    pro_id,
    created_by,
    created_time,
    updated_by,
    updated_time,
    tenant_id,
    USER_DEFINED_IDX1,
    USER_DEFINED_IDX2,
    USER_DEFINED_IDX3,
    USER_DEFINED_IDX4,
    USER_DEFINED_IDX5,
    USER_DEFINED_IDX6,
    USER_DEFINED_IDX7,
    USER_DEFINED_IDX8,
    USER_DEFINED_IDX9,
    USER_DEFINED_IDX10,
    USER_DEFINED_IDX11,
    USER_DEFINED_IDX12,
    USER_DEFINED_IDX13,
    USER_DEFINED_IDX14,
    USER_DEFINED_IDX15,
    USER_DEFINED_IDX16,
    USER_DEFINED_IDX17,
    USER_DEFINED_IDX18,
    USER_DEFINED_IDX19,
    USER_DEFINED_IDX20,
    </trim>
    values
    <foreach collection="list" item="item" index="index" separator=",">
      <trim prefix="(" suffix=")" suffixOverrides=",">
    #{item.bugId, jdbcType=VARCHAR},
    #{item.bugTitle, jdbcType=VARCHAR},
    #{item.bugGrade, jdbcType=CHAR},
    #{item.bugType, jdbcType=VARCHAR},
    #{item.bugOrder, jdbcType=VARCHAR},
    #{item.bugFrom, jdbcType=VARCHAR},
    #{item.emergency, jdbcType=VARCHAR},
    #{item.isReappear, jdbcType=CHAR},
    #{item.bugStatus, jdbcType=VARCHAR},
    #{item.receiver, jdbcType=VARCHAR},
    #{item.repairTime, jdbcType=TIMESTAMP},
    #{item.repairUser, jdbcType=VARCHAR},
    #{item.closeTime, jdbcType=TIMESTAMP},
    #{item.errorMessage, jdbcType=LONGVARCHAR},
    #{item.expands, jdbcType=LONGVARCHAR},
    #{item.message, jdbcType=LONGVARCHAR},
    #{item.systemId, jdbcType=VARCHAR},
    #{item.roundId, jdbcType=VARCHAR},
    #{item.moduleId, jdbcType=VARCHAR},
    #{item.caseNum, jdbcType=INTEGER},
    #{item.proId, jdbcType=VARCHAR},
    #{item.createdBy, jdbcType=VARCHAR},
    #{item.createdTime, jdbcType=TIMESTAMP},
    #{item.updatedBy, jdbcType=VARCHAR},
    #{item.updatedTime, jdbcType=TIMESTAMP},
    #{item.tenantId, jdbcType=VARCHAR},
    #{item.userDefinedIdx1, jdbcType=VARCHAR},
    #{item.userDefinedIdx2, jdbcType=VARCHAR},
    #{item.userDefinedIdx3, jdbcType=VARCHAR},
    #{item.userDefinedIdx4, jdbcType=VARCHAR},
    #{item.userDefinedIdx5, jdbcType=VARCHAR},
    #{item.userDefinedIdx6, jdbcType=VARCHAR},
    #{item.userDefinedIdx7, jdbcType=VARCHAR},
    #{item.userDefinedIdx8, jdbcType=VARCHAR},
    #{item.userDefinedIdx9, jdbcType=VARCHAR},
    #{item.userDefinedIdx10, jdbcType=VARCHAR},
    #{item.userDefinedIdx11, jdbcType=VARCHAR},
    #{item.userDefinedIdx12, jdbcType=VARCHAR},
    #{item.userDefinedIdx13, jdbcType=VARCHAR},
    #{item.userDefinedIdx14, jdbcType=VARCHAR},
    #{item.userDefinedIdx15, jdbcType=VARCHAR},
    #{item.userDefinedIdx16, jdbcType=VARCHAR},
    #{item.userDefinedIdx17, jdbcType=VARCHAR},
    #{item.userDefinedIdx18, jdbcType=VARCHAR},
    #{item.userDefinedIdx19, jdbcType=VARCHAR},
    #{item.userDefinedIdx20, jdbcType=VARCHAR},
      </trim>
    </foreach>
  </insert>

  <update id="updateByPrimaryKey" parameterType="net.northking.cctp.testbug.db.entity.BugManagement">
    update
    <include refid="Table_Name"/>
    <set>
      <if test="bugTitle != null">
        bug_title = #{bugTitle, jdbcType=VARCHAR},
      </if>
      <if test="bugGrade != null">
        bug_grade = #{bugGrade, jdbcType=CHAR},
      </if>
      <if test="bugType != null">
        bug_type = #{bugType, jdbcType=VARCHAR},
      </if>
      <if test="bugOrder != null">
        bug_order = #{bugOrder, jdbcType=VARCHAR},
      </if>
      <if test="bugFrom != null">
        bug_from = #{bugFrom, jdbcType=VARCHAR},
      </if>
      <if test="emergency != null">
        emergency = #{emergency, jdbcType=VARCHAR},
      </if>
      <if test="isReappear != null">
        is_reappear = #{isReappear, jdbcType=CHAR},
      </if>
      <if test="bugStatus != null">
        bug_status = #{bugStatus, jdbcType=VARCHAR},
      </if>
      <if test="receiver != null">
        receiver = #{receiver, jdbcType=VARCHAR},
      </if>
      <if test="repairTime != null">
        repair_time = #{repairTime, jdbcType=TIMESTAMP},
      </if>
      <if test="repairUser != null">
        repair_user = #{repairUser, jdbcType=VARCHAR},
      </if>
      <if test="closeTime != null">
        close_time = #{closeTime, jdbcType=TIMESTAMP},
      </if>
      <if test="errorMessage != null">
        error_message = #{errorMessage, jdbcType=LONGVARCHAR},
      </if>
      <if test="expands != null">
        expands = #{expands, jdbcType=LONGVARCHAR},
      </if>
      <if test="message != null">
        message = #{message, jdbcType=LONGVARCHAR},
      </if>
      <if test="systemId != null">
        system_id = #{systemId, jdbcType=VARCHAR},
      </if>
      <if test="roundId != null">
        round_id = #{roundId, jdbcType=VARCHAR},
      </if>
      <if test="moduleId != null">
        module_id = #{moduleId, jdbcType=VARCHAR},
      </if>
      <if test="caseNum != null">
        case_num = #{caseNum, jdbcType=INTEGER},
      </if>
      <if test="proId != null">
        pro_id = #{proId, jdbcType=VARCHAR},
      </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="userDefinedIdx1 != null">
        USER_DEFINED_IDX1 = #{userDefinedIdx1, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx2 != null">
        USER_DEFINED_IDX2 = #{userDefinedIdx2, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx3 != null">
        USER_DEFINED_IDX3 = #{userDefinedIdx3, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx4 != null">
        USER_DEFINED_IDX4 = #{userDefinedIdx4, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx5 != null">
        USER_DEFINED_IDX5 = #{userDefinedIdx5, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx6 != null">
        USER_DEFINED_IDX6 = #{userDefinedIdx6, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx7 != null">
        USER_DEFINED_IDX7 = #{userDefinedIdx7, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx8 != null">
        USER_DEFINED_IDX8 = #{userDefinedIdx8, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx9 != null">
        USER_DEFINED_IDX9 = #{userDefinedIdx9, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx10 != null">
        USER_DEFINED_IDX10 = #{userDefinedIdx10, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx11 != null">
        USER_DEFINED_IDX11 = #{userDefinedIdx11, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx12 != null">
        USER_DEFINED_IDX12 = #{userDefinedIdx12, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx13 != null">
        USER_DEFINED_IDX13 = #{userDefinedIdx13, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx14 != null">
        USER_DEFINED_IDX14 = #{userDefinedIdx14, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx15 != null">
        USER_DEFINED_IDX15 = #{userDefinedIdx15, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx16 != null">
        USER_DEFINED_IDX16 = #{userDefinedIdx16, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx17 != null">
        USER_DEFINED_IDX17 = #{userDefinedIdx17, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx18 != null">
        USER_DEFINED_IDX18 = #{userDefinedIdx18, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx19 != null">
        USER_DEFINED_IDX19 = #{userDefinedIdx19, jdbcType=VARCHAR},
      </if>
      <if test="userDefinedIdx20 != null">
        USER_DEFINED_IDX20 = #{userDefinedIdx20, jdbcType=VARCHAR},
      </if>
    </set>
    where bug_id = #{bugId,jdbcType=VARCHAR}
    AND tenant_id = #{tenantId,jdbcType=VARCHAR}
  </update>

  <select id="query" resultMap="BaseResultMap" parameterType="net.northking.cctp.testbug.db.entity.BugManagement">
    select
    <include refid="Base_Column_List" />
    from
    <include refid="Table_Name"/>
    <trim prefix="WHERE" prefixOverrides="AND" >
      <if test="bugId != null">
        AND bug_id = #{bugId,jdbcType=VARCHAR}
      </if>
      <if test="bugTitle != null">
        AND bug_title = #{bugTitle,jdbcType=VARCHAR}
      </if>
      <if test="bugGrade != null">
        AND bug_grade = #{bugGrade,jdbcType=CHAR}
      </if>
      <if test="bugType != null">
        AND bug_type = #{bugType,jdbcType=VARCHAR}
      </if>
      <if test="bugOrder != null">
        AND bug_order = #{bugOrder,jdbcType=VARCHAR}
      </if>
      <if test="bugFrom != null">
        AND bug_from = #{bugFrom,jdbcType=VARCHAR}
      </if>
      <if test="emergency != null">
        AND emergency = #{emergency,jdbcType=VARCHAR}
      </if>
      <if test="isReappear != null">
        AND is_reappear = #{isReappear,jdbcType=CHAR}
      </if>
      <if test="bugStatus != null">
        AND bug_status = #{bugStatus,jdbcType=VARCHAR}
      </if>
      <if test="receiver != null">
        AND receiver = #{receiver,jdbcType=VARCHAR}
      </if>
      <if test="repairTime != null">
        AND repair_time = #{repairTime,jdbcType=TIMESTAMP}
      </if>
      <if test="repairUser != null">
        AND repair_user = #{repairUser,jdbcType=VARCHAR}
      </if>
      <if test="closeTime != null">
        AND close_time = #{closeTime,jdbcType=TIMESTAMP}
      </if>
      <if test="errorMessage != null">
        AND error_message = #{errorMessage,jdbcType=LONGVARCHAR}
      </if>
      <if test="expands != null">
        AND expands = #{expands,jdbcType=LONGVARCHAR}
      </if>
      <if test="message != null">
        AND message = #{message,jdbcType=LONGVARCHAR}
      </if>
      <if test="systemId != null">
        AND system_id = #{systemId,jdbcType=VARCHAR}
      </if>
      <if test="roundId != null">
        AND round_id = #{roundId,jdbcType=VARCHAR}
      </if>
      <if test="moduleId != null">
        AND module_id = #{moduleId,jdbcType=VARCHAR}
      </if>
      <if test="caseNum != null">
        AND case_num = #{caseNum,jdbcType=INTEGER}
      </if>
      <if test="proId != null">
        AND pro_id = #{proId,jdbcType=VARCHAR}
      </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="tenantId != null">
        AND tenant_id = #{tenantId,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx1 != null">
        AND USER_DEFINED_IDX1 = #{userDefinedIdx1,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx2 != null">
        AND USER_DEFINED_IDX2 = #{userDefinedIdx2,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx3 != null">
        AND USER_DEFINED_IDX3 = #{userDefinedIdx3,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx4 != null">
        AND USER_DEFINED_IDX4 = #{userDefinedIdx4,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx5 != null">
        AND USER_DEFINED_IDX5 = #{userDefinedIdx5,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx6 != null">
        AND USER_DEFINED_IDX6 = #{userDefinedIdx6,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx7 != null">
        AND USER_DEFINED_IDX7 = #{userDefinedIdx7,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx8 != null">
        AND USER_DEFINED_IDX8 = #{userDefinedIdx8,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx9 != null">
        AND USER_DEFINED_IDX9 = #{userDefinedIdx9,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx10 != null">
        AND USER_DEFINED_IDX10 = #{userDefinedIdx10,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx11 != null">
        AND USER_DEFINED_IDX11 = #{userDefinedIdx11,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx12 != null">
        AND USER_DEFINED_IDX12 = #{userDefinedIdx12,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx13 != null">
        AND USER_DEFINED_IDX13 = #{userDefinedIdx13,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx14 != null">
        AND USER_DEFINED_IDX14 = #{userDefinedIdx14,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx15 != null">
        AND USER_DEFINED_IDX15 = #{userDefinedIdx15,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx16 != null">
        AND USER_DEFINED_IDX16 = #{userDefinedIdx16,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx17 != null">
        AND USER_DEFINED_IDX17 = #{userDefinedIdx17,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx18 != null">
        AND USER_DEFINED_IDX18 = #{userDefinedIdx18,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx19 != null">
        AND USER_DEFINED_IDX19 = #{userDefinedIdx19,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx20 != null">
        AND USER_DEFINED_IDX20 = #{userDefinedIdx20,jdbcType=VARCHAR}
      </if>
    </trim>
  </select>

  <select id="queryCount" resultType="java.lang.Long" parameterType="net.northking.cctp.testbug.db.entity.BugManagement">
    select count(*) from
    <include refid="Table_Name"/>
    <trim prefix="WHERE" prefixOverrides="AND" >
      <if test="bugId != null">
        AND bug_id=#{bugId,jdbcType=VARCHAR}
      </if>
      <if test="bugTitle != null">
        AND bug_title=#{bugTitle,jdbcType=VARCHAR}
      </if>
      <if test="bugGrade != null">
        AND bug_grade=#{bugGrade,jdbcType=CHAR}
      </if>
      <if test="bugType != null">
        AND bug_type=#{bugType,jdbcType=VARCHAR}
      </if>
      <if test="bugOrder != null">
        AND bug_order=#{bugOrder,jdbcType=VARCHAR}
      </if>
      <if test="bugFrom != null">
        AND bug_from=#{bugFrom,jdbcType=VARCHAR}
      </if>
      <if test="emergency != null">
        AND emergency=#{emergency,jdbcType=VARCHAR}
      </if>
      <if test="isReappear != null">
        AND is_reappear=#{isReappear,jdbcType=CHAR}
      </if>
      <if test="bugStatus != null">
        AND bug_status=#{bugStatus,jdbcType=VARCHAR}
      </if>
      <if test="receiver != null">
        AND receiver=#{receiver,jdbcType=VARCHAR}
      </if>
      <if test="repairTime != null">
        AND repair_time=#{repairTime,jdbcType=TIMESTAMP}
      </if>
      <if test="repairUser != null">
        AND repair_user=#{repairUser,jdbcType=VARCHAR}
      </if>
      <if test="closeTime != null">
        AND close_time=#{closeTime,jdbcType=TIMESTAMP}
      </if>
      <if test="errorMessage != null">
        AND error_message=#{errorMessage,jdbcType=LONGVARCHAR}
      </if>
      <if test="expands != null">
        AND expands=#{expands,jdbcType=LONGVARCHAR}
      </if>
      <if test="message != null">
        AND message=#{message,jdbcType=LONGVARCHAR}
      </if>
      <if test="systemId != null">
        AND system_id=#{systemId,jdbcType=VARCHAR}
      </if>
      <if test="roundId != null">
        AND round_id=#{roundId,jdbcType=VARCHAR}
      </if>
      <if test="moduleId != null">
        AND module_id=#{moduleId,jdbcType=VARCHAR}
      </if>
      <if test="caseNum != null">
        AND case_num=#{caseNum,jdbcType=INTEGER}
      </if>
      <if test="proId != null">
        AND pro_id=#{proId,jdbcType=VARCHAR}
      </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="tenantId != null">
        AND tenant_id=#{tenantId,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx1 != null">
        AND USER_DEFINED_IDX1=#{userDefinedIdx1,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx2 != null">
        AND USER_DEFINED_IDX2=#{userDefinedIdx2,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx3 != null">
        AND USER_DEFINED_IDX3=#{userDefinedIdx3,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx4 != null">
        AND USER_DEFINED_IDX4=#{userDefinedIdx4,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx5 != null">
        AND USER_DEFINED_IDX5=#{userDefinedIdx5,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx6 != null">
        AND USER_DEFINED_IDX6=#{userDefinedIdx6,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx7 != null">
        AND USER_DEFINED_IDX7=#{userDefinedIdx7,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx8 != null">
        AND USER_DEFINED_IDX8=#{userDefinedIdx8,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx9 != null">
        AND USER_DEFINED_IDX9=#{userDefinedIdx9,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx10 != null">
        AND USER_DEFINED_IDX10=#{userDefinedIdx10,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx11 != null">
        AND USER_DEFINED_IDX11=#{userDefinedIdx11,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx12 != null">
        AND USER_DEFINED_IDX12=#{userDefinedIdx12,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx13 != null">
        AND USER_DEFINED_IDX13=#{userDefinedIdx13,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx14 != null">
        AND USER_DEFINED_IDX14=#{userDefinedIdx14,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx15 != null">
        AND USER_DEFINED_IDX15=#{userDefinedIdx15,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx16 != null">
        AND USER_DEFINED_IDX16=#{userDefinedIdx16,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx17 != null">
        AND USER_DEFINED_IDX17=#{userDefinedIdx17,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx18 != null">
        AND USER_DEFINED_IDX18=#{userDefinedIdx18,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx19 != null">
        AND USER_DEFINED_IDX19=#{userDefinedIdx19,jdbcType=VARCHAR}
      </if>
      <if test="userDefinedIdx20 != null">
        AND USER_DEFINED_IDX20=#{userDefinedIdx20,jdbcType=VARCHAR}
      </if>
    </trim>
  </select>

</mapper>