<?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.cku.dao.CkuDogMapper" >
  <resultMap id="BaseResultMap" type="com.cku.model.CkuDog" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="dogvalid" property="dogvalid" jdbcType="VARCHAR" />
    <result column="cn_name" property="dogtype" jdbcType="VARCHAR" />
    <result column="shows" property="shows" jdbcType="VARCHAR" />
    <result column="logout" property="logout" jdbcType="VARCHAR" />
    <result column="birth_certificate_reg_num" property="birthCertificateRegNum" jdbcType="VARCHAR" />
    <result column="pedigree_num" property="pedigreeNum" jdbcType="VARCHAR" />
    <result column="dog_owner" property="dogOwner" jdbcType="VARCHAR" />
    <result column="member_num" property="memberNum" jdbcType="VARCHAR" />
    <result column="dog_second_owenr" property="dogSecondOwenr" jdbcType="VARCHAR" />
    <result column="second_owenr_member_num" property="secondOwenrMemberNum" jdbcType="VARCHAR" />
    <result column="breeder" property="breeder" jdbcType="VARCHAR" />
    <result column="dog_eg_name" property="dogEgName" jdbcType="VARCHAR" />
    <result column="dog_cn_name" property="dogCnName" jdbcType="VARCHAR" />
    <result column="dog_gender" property="dogGender" jdbcType="VARCHAR" />
    <result column="dog_type" property="dogType" jdbcType="VARCHAR" />
    <result column="dog_birthday" property="dogBirthday" jdbcType="TIMESTAMP" />
    <result column="identifi_sign" property="identifiSign" jdbcType="VARCHAR" />
    <result column="coat_texture" property="coatTexture" jdbcType="VARCHAR" />
    <result column="color_mark" property="colorMark" jdbcType="VARCHAR" />
    <result column="special_mark" property="specialMark" jdbcType="VARCHAR" />
    <result column="hip_joint_identifi_result" property="hipJointIdentifiResult" jdbcType="VARCHAR" />
    <result column="elbow_joint_identifi_result" property="elbowJointIdentifiResult" jdbcType="VARCHAR" />
    <result column="dna" property="dna" jdbcType="VARCHAR" />
    <result column="breeding_qualifi" property="breedingQualifi" jdbcType="VARCHAR" />
    <result column="kin_breeding" property="kinBreeding" jdbcType="VARCHAR" />
    <result column="show_level" property="showLevel" jdbcType="VARCHAR" />
    <result column="show_result" property="showResult" jdbcType="VARCHAR" />
    <result column="test_level" property="testLevel" jdbcType="VARCHAR" />
    <result column="test_score" property="testScore" jdbcType="VARCHAR" />
    <result column="file_num" property="fileNum" jdbcType="VARCHAR" />
    <result column="f_pedigree_num" property="fPedigreeNum" jdbcType="VARCHAR" />
    <result column="m_pedigree_num" property="mPedigreeNum" jdbcType="VARCHAR" />
    <result column="f_m_pedigree_num" property="fMPedigreeNum" jdbcType="VARCHAR" />
    <result column="inbreeding_seal" property="inbreedingSeal" jdbcType="VARCHAR" />
    <result column="old_studbook_num" property="oldStudbookNum" jdbcType="VARCHAR" />
    <result column="overseas_reg_certifi" property="overseasRegCertifi" jdbcType="VARCHAR" />
    <result column="add_data" property="addData" jdbcType="TIMESTAMP" />
    <result column="modifi_data" property="modifiData" jdbcType="TIMESTAMP" />
    <result column="breeders_memb_num" property="breedersMembNum" jdbcType="VARCHAR" />
    <result column="del_tag" property="delTag" jdbcType="VARCHAR" />
    <result column="print_type" property="printType" jdbcType="VARCHAR" />
    <result column="pay_dna" property="payDna" jdbcType="VARCHAR" />
    <result column="pay_fy" property="payFy" jdbcType="VARCHAR" />
    <result column="pay_hd" property="payHd" jdbcType="VARCHAR" />
    <result column="three_no" property="threeNo" jdbcType="INTEGER" />
    <result column="dog_genertions" property="dogGenertions" jdbcType="INTEGER" />
    <result column="fanyu_confirm" property="fanyuConfirm" jdbcType="VARCHAR" />
     <result column="typeGroup" property="typeGroup" jdbcType="VARCHAR" />
    <result column="type_eg_name" property="typeEgName" jdbcType="VARCHAR" />
    <result column="dog_critique" property="dogCritique" jdbcType="VARCHAR" />
  </resultMap>
  <resultMap id="ResultMap" type="com.cku.model.CkuDogMessageForLoginType" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="dogvalid" property="dogvalid" jdbcType="VARCHAR" />
    <result column="cn_name" property="dogtype" jdbcType="VARCHAR" />
    <result column="shows" property="shows" jdbcType="VARCHAR" />
    <result column="logout" property="logout" jdbcType="VARCHAR" />
    <result column="birth_certificate_reg_num" property="birthCertificateRegNum" jdbcType="VARCHAR" />
    <result column="pedigree_num" property="pedigreeNum" jdbcType="VARCHAR" />
    <result column="dog_owner" property="dogOwner" jdbcType="VARCHAR" />
    <result column="member_num" property="memberNum" jdbcType="VARCHAR" />
    <result column="dog_second_owenr" property="dogSecondOwenr" jdbcType="VARCHAR" />
    <result column="second_owenr_member_num" property="secondOwenrMemberNum" jdbcType="VARCHAR" />
    <result column="breeder" property="breeder" jdbcType="VARCHAR" />
    <result column="dog_eg_name" property="dogEgName" jdbcType="VARCHAR" />
    <result column="dog_cn_name" property="dogCnName" jdbcType="VARCHAR" />
    <result column="dog_gender" property="dogGender" jdbcType="VARCHAR" />
    <result column="dog_type" property="dogType" jdbcType="VARCHAR" />
    <result column="dog_birthday" property="dogBirthday" jdbcType="TIMESTAMP" />
    <result column="identifi_sign" property="identifiSign" jdbcType="VARCHAR" />
    <result column="coat_texture" property="coatTexture" jdbcType="VARCHAR" />
    <result column="color_mark" property="colorMark" jdbcType="VARCHAR" />
    <result column="special_mark" property="specialMark" jdbcType="VARCHAR" />
    <result column="hip_joint_identifi_result" property="hipJointIdentifiResult" jdbcType="VARCHAR" />
    <result column="elbow_joint_identifi_result" property="elbowJointIdentifiResult" jdbcType="VARCHAR" />
    <result column="dna" property="dna" jdbcType="VARCHAR" />
    <result column="breeding_qualifi" property="breedingQualifi" jdbcType="VARCHAR" />
    <result column="kin_breeding" property="kinBreeding" jdbcType="VARCHAR" />
    <result column="show_level" property="showLevel" jdbcType="VARCHAR" />
    <result column="show_result" property="showResult" jdbcType="VARCHAR" />
    <result column="test_level" property="testLevel" jdbcType="VARCHAR" />
    <result column="test_score" property="testScore" jdbcType="VARCHAR" />
    <result column="file_num" property="fileNum" jdbcType="VARCHAR" />
    <result column="f_pedigree_num" property="fPedigreeNum" jdbcType="VARCHAR" />
    <result column="m_pedigree_num" property="mPedigreeNum" jdbcType="VARCHAR" />
    <result column="f_m_pedigree_num" property="fMPedigreeNum" jdbcType="VARCHAR" />
    <result column="inbreeding_seal" property="inbreedingSeal" jdbcType="VARCHAR" />
    <result column="old_studbook_num" property="oldStudbookNum" jdbcType="VARCHAR" />
    <result column="overseas_reg_certifi" property="overseasRegCertifi" jdbcType="VARCHAR" />
    <result column="add_data" property="addData" jdbcType="TIMESTAMP" />
    <result column="modifi_data" property="modifiData" jdbcType="TIMESTAMP" />
    <result column="breeders_memb_num" property="breedersMembNum" jdbcType="VARCHAR" />
    <result column="del_tag" property="delTag" jdbcType="VARCHAR" />
    <result column="print_type" property="printType" jdbcType="VARCHAR" />
    <result column="pay_dna" property="payDna" jdbcType="VARCHAR" />
    <result column="pay_fy" property="payFy" jdbcType="VARCHAR" />
    <result column="pay_hd" property="payHd" jdbcType="VARCHAR" />
    <result column="three_no" property="threeNo" jdbcType="INTEGER" />
    <result column="dog_genertions" property="dogGenertions" jdbcType="INTEGER" />
    <result column="fanyu_confirm" property="fanyuConfirm" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, dogvalid, dogtype, shows, logout, birth_certificate_reg_num, pedigree_num, dog_owner, 
    member_num, dog_second_owenr, second_owenr_member_num, breeder, dog_eg_name, dog_cn_name, 
    dog_gender, dog_type, dog_birthday, identifi_sign, coat_texture, color_mark, special_mark, 
    hip_joint_identifi_result, elbow_joint_identifi_result, dna, breeding_qualifi, kin_breeding, 
    show_level, show_result, test_level, test_score, file_num, f_pedigree_num, m_pedigree_num, 
    f_m_pedigree_num, inbreeding_seal, old_studbook_num, overseas_reg_certifi, add_data, 
    modifi_data, breeders_memb_num, del_tag, print_type, pay_dna, pay_fy, pay_hd, three_no, 
    dog_genertions, fanyu_confirm
  </sql>
  <sql id="Blob_Column_List" >
    dog_critique, remark, operator, running_num
  </sql>
  
  <!-- 根据血统证书得到芯片号 -->
  <select id="getDogCord" parameterType="java.lang.String" resultType="java.lang.String">
  select 身份识别标志 identifi_sign FROM dog where 血统证书号=#{ckuZsid}
  </select>
  <!--SQL SERVER 根据cku证书号/犬只芯片号获取犬信息 zhuoHeng -->
  <select id="getMatchCost" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    SELECT dog.id ,
	       dog.dogValid dogvalid,
	       dog.dogType dogtype,
	       dog.show shows,
	       dog.logout logout,
	       dog.出生证明登记编号 birth_certificate_reg_num,
	       dog.血统证书号 pedigree_num,
	       dog.犬主人 dog_owner,
	       dog.会员号 member_num,
	       dog.第二犬主 dog_second_owenr,
	       dog.第二犬主会员号 second_owenr_member_num,
	       dog.繁殖人 breeder,
	       dog.英文姓名 dog_eg_name,
	       dog.中文姓名 dog_cn_name,
	       dog.性别 dog_gender,
	       dog.种类 dog_type,
	       dog.出生日期 dog_birthday,
	       dog.身份识别标志 identifi_sign,
	       dog.毛质 coat_texture,
	       dog.颜色及标志 color_mark,
	       dog.特殊标记 special_mark,
	       dog.髋关节鉴定结果 hip_joint_identifi_result,
	       dog.肘关节鉴定结果 elbow_joint_identifi_result,
	       dog.DNA dna,
	       dog.繁殖资格 breeding_qualifi,
	       dog.近亲繁殖 kin_breeding,
	       dog.比赛级别 show_level,
	       dog.比赛成绩 show_result,
	       dog.考试级别 test_level,
	       dog.考试成绩 test_score,
	       dog.档号 file_num,
	       dog.父犬血统证号 f_pedigree_num,
	       dog.母犬血统证号 m_pedigree_num,
	       dog.父母犬配犬证明号 f_m_pedigree_num,
	       dog.近亲繁殖打印 inbreeding_seal,
	       dog.旧血统证书号 old_studbook_num,
	       dog.国外登记证书号 overseas_reg_certifi,
	       dog.添加日期 add_data,
	       dog.修改日期 modifi_data,
	       dog.繁殖人会员号 breeders_memb_num,
	       dog.del_tag,
	       dog.print_type,
	       dog.pay_DNA pay_dna,
	       dog.pay_fy,
	       dog.pay_hd,
	       dog.three_no,
	       dog.dogGenerations dog_genertions,
	       dog.fanyu_Confirm fanyu_confirm,
	       dog.裁判评价 dog_critique,
		   cod.犬种类中文名称 cn_name,
		   cod.组 typeGroup,
		   cod.犬种类英文名称 type_eg_name
	FROM dog dog
	LEFT JOIN tab_dog_class_code cod ON dog.种类 = cod.犬种类代码
	<if test="(pedigreeNum != null and pedigreeNum != '') or (dogId != null and dogId != '')">
		WHERE
	</if>
	<if test="pedigreeNum != null and pedigreeNum != '' " >
	 	dog.血统证书号 = #{pedigreeNum}
	</if>
	<if test="pedigreeNum != null and pedigreeNum != '' and dogId != null and dogId != ''">
		or	
	</if>
	<if test="dogId != null and dogId != ''">
		dog.身份识别标志 = #{dogId} 
	</if>
  </select>
  <!-- 校验输入的CKU血统证书号的犬只是否在当前会员名下 -->
  <select id="getMatchCostByPedigreeNum" resultMap="ResultMap" parameterType="java.lang.Integer">
	SELECT
	   dog.id ,
       dog.dogValid dogvalid,
       dog.dogType dogtype,
       dog.show shows,
       dog.logout logout,
       dog.出生证明登记编号 birth_certificate_reg_num,
       dog.血统证书号 pedigree_num,
       dog.犬主人 dog_owner,
       dog.会员号 member_num,
       dog.第二犬主 dog_second_owenr,
       dog.第二犬主会员号 second_owenr_member_num,
       dog.繁殖人 breeder,
       dog.英文姓名 dog_eg_name,
       dog.中文姓名 dog_cn_name,
       dog.性别 dog_gender,
       dog.种类 dog_type,
       dog.出生日期 dog_birthday,
       dog.身份识别标志 identifi_sign,
       dog.毛质 coat_texture,
       dog.颜色及标志 color_mark,
       dog.特殊标记 special_mark,
       dog.髋关节鉴定结果 hip_joint_identifi_result,
       dog.肘关节鉴定结果 elbow_joint_identifi_result,
       dog.DNA dna,
       dog.繁殖资格 breeding_qualifi,
       dog.近亲繁殖 kin_breeding,
       dog.比赛级别 show_level,
       dog.比赛成绩 show_result,
       dog.考试级别 test_level,
       dog.考试成绩 test_score,
       dog.档号 file_num,
       dog.父犬血统证号 f_pedigree_num,
       dog.母犬血统证号 m_pedigree_num,
       dog.父母犬配犬证明号 f_m_pedigree_num,
       dog.近亲繁殖打印 inbreeding_seal,
       dog.旧血统证书号 old_studbook_num,
       dog.国外登记证书号 overseas_reg_certifi,
       dog.添加日期 add_data,
       dog.修改日期 modifi_data,
       dog.繁殖人会员号 breeders_memb_num,
       dog.del_tag,
       dog.print_type,
       dog.pay_DNA pay_dna,
       dog.pay_fy,
       dog.pay_hd,
       dog.three_no,
       dog.dogGenerations dog_genertions,
       dog.fanyu_Confirm fanyu_confirm
	FROM
		(
			SELECT
				*
			FROM
				dog
			WHERE
				血统证书号 = #{pedigreeNum}
		) dog
	WHERE
		dog.血统证书号 IN (
			SELECT
				血统证书号
			FROM
				dog
			WHERE
				会员号 = #{userNum}
		)
  </select>
  <select id="getDogListByLoginUser" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  SELECT 
  	   dog.id ,
       dog.dogValid dogvalid,
       dog.dogType dogtype,
       dog.show shows,
       dog.logout logout,
       dog.出生证明登记编号 birth_certificate_reg_num,
       dog.血统证书号 pedigree_num,
       dog.犬主人 dog_owner,
       dog.会员号 member_num,
       dog.第二犬主 dog_second_owenr,
       dog.第二犬主会员号 second_owenr_member_num,
       dog.繁殖人 breeder,
       dog.英文姓名 dog_eg_name,
       dog.中文姓名 dog_cn_name,
       dog.性别 dog_gender,
       dog.种类 dog_type,
       dog.出生日期 dog_birthday,
       dog.身份识别标志 identifi_sign,
       dog.毛质 coat_texture,
       dog.颜色及标志 color_mark,
       dog.特殊标记 special_mark,
       dog.髋关节鉴定结果 hip_joint_identifi_result,
       dog.肘关节鉴定结果 elbow_joint_identifi_result,
       dog.DNA dna,
       dog.繁殖资格 breeding_qualifi,
       dog.近亲繁殖 kin_breeding,
       dog.比赛级别 show_level,
       dog.比赛成绩 show_result,
       dog.考试级别 test_level,
       dog.考试成绩 test_score,
       dog.档号 file_num,
       dog.父犬血统证号 f_pedigree_num,
       dog.母犬血统证号 m_pedigree_num,
       dog.父母犬配犬证明号 f_m_pedigree_num,
       dog.近亲繁殖打印 inbreeding_seal,
       dog.旧血统证书号 old_studbook_num,
       dog.国外登记证书号 overseas_reg_certifi,
       dog.添加日期 add_data,
       dog.修改日期 modifi_data,
       dog.繁殖人会员号 breeders_memb_num,
       dog.del_tag,
       dog.print_type,
       dog.pay_DNA pay_dna,
       dog.pay_fy,
       dog.pay_hd,
       dog.three_no,
       dog.dogGenerations dog_genertions,
       dog.fanyu_Confirm fanyu_confirm,
	   cod.犬种类中文名称 cn_name
	FROM dog dog
	LEFT JOIN tab_dog_class_code cod ON dog.种类 = cod.犬种类代码
	WHERE dog.会员号 = #{userNum}
	order by dog.id desc
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from cku_dog
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.cku.model.CkuDogWithBLOBs" >
    insert into cku_dog (id, dogvalid, dogtype, 
      shows, logout, birth_certificate_reg_num, 
      pedigree_num, dog_owner, member_num, 
      dog_second_owenr, second_owenr_member_num, breeder, 
      dog_eg_name, dog_cn_name, dog_gender, 
      dog_type, dog_birthday, identifi_sign, 
      coat_texture, color_mark, special_mark, 
      hip_joint_identifi_result, elbow_joint_identifi_result, 
      dna, breeding_qualifi, kin_breeding, 
      show_level, show_result, test_level, 
      test_score, file_num, f_pedigree_num, 
      m_pedigree_num, f_m_pedigree_num, inbreeding_seal, 
      old_studbook_num, overseas_reg_certifi, add_data, 
      modifi_data, breeders_memb_num, del_tag, 
      print_type, pay_dna, pay_fy, 
      pay_hd, three_no, dog_genertions, 
      fanyu_confirm, dog_critique, remark, 
      operator, running_num)
    values (#{id,jdbcType=INTEGER}, #{dogvalid,jdbcType=VARCHAR}, #{dogtype,jdbcType=VARCHAR}, 
      #{shows,jdbcType=VARCHAR}, #{logout,jdbcType=VARCHAR}, #{birthCertificateRegNum,jdbcType=VARCHAR}, 
      #{pedigreeNum,jdbcType=VARCHAR}, #{dogOwner,jdbcType=VARCHAR}, #{memberNum,jdbcType=VARCHAR}, 
      #{dogSecondOwenr,jdbcType=VARCHAR}, #{secondOwenrMemberNum,jdbcType=VARCHAR}, #{breeder,jdbcType=VARCHAR}, 
      #{dogEgName,jdbcType=VARCHAR}, #{dogCnName,jdbcType=VARCHAR}, #{dogGender,jdbcType=VARCHAR}, 
      #{dogType,jdbcType=VARCHAR}, #{dogBirthday,jdbcType=TIMESTAMP}, #{identifiSign,jdbcType=VARCHAR}, 
      #{coatTexture,jdbcType=VARCHAR}, #{colorMark,jdbcType=VARCHAR}, #{specialMark,jdbcType=VARCHAR}, 
      #{hipJointIdentifiResult,jdbcType=VARCHAR}, #{elbowJointIdentifiResult,jdbcType=VARCHAR}, 
      #{dna,jdbcType=VARCHAR}, #{breedingQualifi,jdbcType=VARCHAR}, #{kinBreeding,jdbcType=VARCHAR}, 
      #{showLevel,jdbcType=VARCHAR}, #{showResult,jdbcType=VARCHAR}, #{testLevel,jdbcType=VARCHAR}, 
      #{testScore,jdbcType=VARCHAR}, #{fileNum,jdbcType=VARCHAR}, #{fPedigreeNum,jdbcType=VARCHAR}, 
      #{mPedigreeNum,jdbcType=VARCHAR}, #{fMPedigreeNum,jdbcType=VARCHAR}, #{inbreedingSeal,jdbcType=VARCHAR}, 
      #{oldStudbookNum,jdbcType=VARCHAR}, #{overseasRegCertifi,jdbcType=VARCHAR}, #{addData,jdbcType=TIMESTAMP}, 
      #{modifiData,jdbcType=TIMESTAMP}, #{breedersMembNum,jdbcType=VARCHAR}, #{delTag,jdbcType=VARCHAR}, 
      #{printType,jdbcType=VARCHAR}, #{payDna,jdbcType=VARCHAR}, #{payFy,jdbcType=VARCHAR}, 
      #{payHd,jdbcType=VARCHAR}, #{threeNo,jdbcType=INTEGER}, #{dogGenertions,jdbcType=INTEGER}, 
      #{fanyuConfirm,jdbcType=VARCHAR}, #{dogCritique,jdbcType=LONGVARCHAR}, #{remark,jdbcType=LONGVARCHAR}, 
      #{operator,jdbcType=LONGVARCHAR}, #{runningNum,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.cku.model.CkuDogWithBLOBs" >
    insert into cku_dog
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="dogvalid != null" >
        dogvalid,
      </if>
      <if test="dogtype != null" >
        dogtype,
      </if>
      <if test="shows != null" >
        shows,
      </if>
      <if test="logout != null" >
        logout,
      </if>
      <if test="birthCertificateRegNum != null" >
        birth_certificate_reg_num,
      </if>
      <if test="pedigreeNum != null" >
        pedigree_num,
      </if>
      <if test="dogOwner != null" >
        dog_owner,
      </if>
      <if test="memberNum != null" >
        member_num,
      </if>
      <if test="dogSecondOwenr != null" >
        dog_second_owenr,
      </if>
      <if test="secondOwenrMemberNum != null" >
        second_owenr_member_num,
      </if>
      <if test="breeder != null" >
        breeder,
      </if>
      <if test="dogEgName != null" >
        dog_eg_name,
      </if>
      <if test="dogCnName != null" >
        dog_cn_name,
      </if>
      <if test="dogGender != null" >
        dog_gender,
      </if>
      <if test="dogType != null" >
        dog_type,
      </if>
      <if test="dogBirthday != null" >
        dog_birthday,
      </if>
      <if test="identifiSign != null" >
        identifi_sign,
      </if>
      <if test="coatTexture != null" >
        coat_texture,
      </if>
      <if test="colorMark != null" >
        color_mark,
      </if>
      <if test="specialMark != null" >
        special_mark,
      </if>
      <if test="hipJointIdentifiResult != null" >
        hip_joint_identifi_result,
      </if>
      <if test="elbowJointIdentifiResult != null" >
        elbow_joint_identifi_result,
      </if>
      <if test="dna != null" >
        dna,
      </if>
      <if test="breedingQualifi != null" >
        breeding_qualifi,
      </if>
      <if test="kinBreeding != null" >
        kin_breeding,
      </if>
      <if test="showLevel != null" >
        show_level,
      </if>
      <if test="showResult != null" >
        show_result,
      </if>
      <if test="testLevel != null" >
        test_level,
      </if>
      <if test="testScore != null" >
        test_score,
      </if>
      <if test="fileNum != null" >
        file_num,
      </if>
      <if test="fPedigreeNum != null" >
        f_pedigree_num,
      </if>
      <if test="mPedigreeNum != null" >
        m_pedigree_num,
      </if>
      <if test="fMPedigreeNum != null" >
        f_m_pedigree_num,
      </if>
      <if test="inbreedingSeal != null" >
        inbreeding_seal,
      </if>
      <if test="oldStudbookNum != null" >
        old_studbook_num,
      </if>
      <if test="overseasRegCertifi != null" >
        overseas_reg_certifi,
      </if>
      <if test="addData != null" >
        add_data,
      </if>
      <if test="modifiData != null" >
        modifi_data,
      </if>
      <if test="breedersMembNum != null" >
        breeders_memb_num,
      </if>
      <if test="delTag != null" >
        del_tag,
      </if>
      <if test="printType != null" >
        print_type,
      </if>
      <if test="payDna != null" >
        pay_dna,
      </if>
      <if test="payFy != null" >
        pay_fy,
      </if>
      <if test="payHd != null" >
        pay_hd,
      </if>
      <if test="threeNo != null" >
        three_no,
      </if>
      <if test="dogGenertions != null" >
        dog_genertions,
      </if>
      <if test="fanyuConfirm != null" >
        fanyu_confirm,
      </if>
      <if test="dogCritique != null" >
        dog_critique,
      </if>
      <if test="remark != null" >
        remark,
      </if>
      <if test="operator != null" >
        operator,
      </if>
      <if test="runningNum != null" >
        running_num,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="dogvalid != null" >
        #{dogvalid,jdbcType=VARCHAR},
      </if>
      <if test="dogtype != null" >
        #{dogtype,jdbcType=VARCHAR},
      </if>
      <if test="shows != null" >
        #{shows,jdbcType=VARCHAR},
      </if>
      <if test="logout != null" >
        #{logout,jdbcType=VARCHAR},
      </if>
      <if test="birthCertificateRegNum != null" >
        #{birthCertificateRegNum,jdbcType=VARCHAR},
      </if>
      <if test="pedigreeNum != null" >
        #{pedigreeNum,jdbcType=VARCHAR},
      </if>
      <if test="dogOwner != null" >
        #{dogOwner,jdbcType=VARCHAR},
      </if>
      <if test="memberNum != null" >
        #{memberNum,jdbcType=VARCHAR},
      </if>
      <if test="dogSecondOwenr != null" >
        #{dogSecondOwenr,jdbcType=VARCHAR},
      </if>
      <if test="secondOwenrMemberNum != null" >
        #{secondOwenrMemberNum,jdbcType=VARCHAR},
      </if>
      <if test="breeder != null" >
        #{breeder,jdbcType=VARCHAR},
      </if>
      <if test="dogEgName != null" >
        #{dogEgName,jdbcType=VARCHAR},
      </if>
      <if test="dogCnName != null" >
        #{dogCnName,jdbcType=VARCHAR},
      </if>
      <if test="dogGender != null" >
        #{dogGender,jdbcType=VARCHAR},
      </if>
      <if test="dogType != null" >
        #{dogType,jdbcType=VARCHAR},
      </if>
      <if test="dogBirthday != null" >
        #{dogBirthday,jdbcType=TIMESTAMP},
      </if>
      <if test="identifiSign != null" >
        #{identifiSign,jdbcType=VARCHAR},
      </if>
      <if test="coatTexture != null" >
        #{coatTexture,jdbcType=VARCHAR},
      </if>
      <if test="colorMark != null" >
        #{colorMark,jdbcType=VARCHAR},
      </if>
      <if test="specialMark != null" >
        #{specialMark,jdbcType=VARCHAR},
      </if>
      <if test="hipJointIdentifiResult != null" >
        #{hipJointIdentifiResult,jdbcType=VARCHAR},
      </if>
      <if test="elbowJointIdentifiResult != null" >
        #{elbowJointIdentifiResult,jdbcType=VARCHAR},
      </if>
      <if test="dna != null" >
        #{dna,jdbcType=VARCHAR},
      </if>
      <if test="breedingQualifi != null" >
        #{breedingQualifi,jdbcType=VARCHAR},
      </if>
      <if test="kinBreeding != null" >
        #{kinBreeding,jdbcType=VARCHAR},
      </if>
      <if test="showLevel != null" >
        #{showLevel,jdbcType=VARCHAR},
      </if>
      <if test="showResult != null" >
        #{showResult,jdbcType=VARCHAR},
      </if>
      <if test="testLevel != null" >
        #{testLevel,jdbcType=VARCHAR},
      </if>
      <if test="testScore != null" >
        #{testScore,jdbcType=VARCHAR},
      </if>
      <if test="fileNum != null" >
        #{fileNum,jdbcType=VARCHAR},
      </if>
      <if test="fPedigreeNum != null" >
        #{fPedigreeNum,jdbcType=VARCHAR},
      </if>
      <if test="mPedigreeNum != null" >
        #{mPedigreeNum,jdbcType=VARCHAR},
      </if>
      <if test="fMPedigreeNum != null" >
        #{fMPedigreeNum,jdbcType=VARCHAR},
      </if>
      <if test="inbreedingSeal != null" >
        #{inbreedingSeal,jdbcType=VARCHAR},
      </if>
      <if test="oldStudbookNum != null" >
        #{oldStudbookNum,jdbcType=VARCHAR},
      </if>
      <if test="overseasRegCertifi != null" >
        #{overseasRegCertifi,jdbcType=VARCHAR},
      </if>
      <if test="addData != null" >
        #{addData,jdbcType=TIMESTAMP},
      </if>
      <if test="modifiData != null" >
        #{modifiData,jdbcType=TIMESTAMP},
      </if>
      <if test="breedersMembNum != null" >
        #{breedersMembNum,jdbcType=VARCHAR},
      </if>
      <if test="delTag != null" >
        #{delTag,jdbcType=VARCHAR},
      </if>
      <if test="printType != null" >
        #{printType,jdbcType=VARCHAR},
      </if>
      <if test="payDna != null" >
        #{payDna,jdbcType=VARCHAR},
      </if>
      <if test="payFy != null" >
        #{payFy,jdbcType=VARCHAR},
      </if>
      <if test="payHd != null" >
        #{payHd,jdbcType=VARCHAR},
      </if>
      <if test="threeNo != null" >
        #{threeNo,jdbcType=INTEGER},
      </if>
      <if test="dogGenertions != null" >
        #{dogGenertions,jdbcType=INTEGER},
      </if>
      <if test="fanyuConfirm != null" >
        #{fanyuConfirm,jdbcType=VARCHAR},
      </if>
      <if test="dogCritique != null" >
        #{dogCritique,jdbcType=LONGVARCHAR},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=LONGVARCHAR},
      </if>
      <if test="operator != null" >
        #{operator,jdbcType=LONGVARCHAR},
      </if>
      <if test="runningNum != null" >
        #{runningNum,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.cku.model.CkuDogWithBLOBs" >
    update cku_dog
    <set >
      <if test="dogvalid != null" >
        dogvalid = #{dogvalid,jdbcType=VARCHAR},
      </if>
      <if test="dogtype != null" >
        dogtype = #{dogtype,jdbcType=VARCHAR},
      </if>
      <if test="shows != null" >
        shows = #{shows,jdbcType=VARCHAR},
      </if>
      <if test="logout != null" >
        logout = #{logout,jdbcType=VARCHAR},
      </if>
      <if test="birthCertificateRegNum != null" >
        birth_certificate_reg_num = #{birthCertificateRegNum,jdbcType=VARCHAR},
      </if>
      <if test="pedigreeNum != null" >
        pedigree_num = #{pedigreeNum,jdbcType=VARCHAR},
      </if>
      <if test="dogOwner != null" >
        dog_owner = #{dogOwner,jdbcType=VARCHAR},
      </if>
      <if test="memberNum != null" >
        member_num = #{memberNum,jdbcType=VARCHAR},
      </if>
      <if test="dogSecondOwenr != null" >
        dog_second_owenr = #{dogSecondOwenr,jdbcType=VARCHAR},
      </if>
      <if test="secondOwenrMemberNum != null" >
        second_owenr_member_num = #{secondOwenrMemberNum,jdbcType=VARCHAR},
      </if>
      <if test="breeder != null" >
        breeder = #{breeder,jdbcType=VARCHAR},
      </if>
      <if test="dogEgName != null" >
        dog_eg_name = #{dogEgName,jdbcType=VARCHAR},
      </if>
      <if test="dogCnName != null" >
        dog_cn_name = #{dogCnName,jdbcType=VARCHAR},
      </if>
      <if test="dogGender != null" >
        dog_gender = #{dogGender,jdbcType=VARCHAR},
      </if>
      <if test="dogType != null" >
        dog_type = #{dogType,jdbcType=VARCHAR},
      </if>
      <if test="dogBirthday != null" >
        dog_birthday = #{dogBirthday,jdbcType=TIMESTAMP},
      </if>
      <if test="identifiSign != null" >
        identifi_sign = #{identifiSign,jdbcType=VARCHAR},
      </if>
      <if test="coatTexture != null" >
        coat_texture = #{coatTexture,jdbcType=VARCHAR},
      </if>
      <if test="colorMark != null" >
        color_mark = #{colorMark,jdbcType=VARCHAR},
      </if>
      <if test="specialMark != null" >
        special_mark = #{specialMark,jdbcType=VARCHAR},
      </if>
      <if test="hipJointIdentifiResult != null" >
        hip_joint_identifi_result = #{hipJointIdentifiResult,jdbcType=VARCHAR},
      </if>
      <if test="elbowJointIdentifiResult != null" >
        elbow_joint_identifi_result = #{elbowJointIdentifiResult,jdbcType=VARCHAR},
      </if>
      <if test="dna != null" >
        dna = #{dna,jdbcType=VARCHAR},
      </if>
      <if test="breedingQualifi != null" >
        breeding_qualifi = #{breedingQualifi,jdbcType=VARCHAR},
      </if>
      <if test="kinBreeding != null" >
        kin_breeding = #{kinBreeding,jdbcType=VARCHAR},
      </if>
      <if test="showLevel != null" >
        show_level = #{showLevel,jdbcType=VARCHAR},
      </if>
      <if test="showResult != null" >
        show_result = #{showResult,jdbcType=VARCHAR},
      </if>
      <if test="testLevel != null" >
        test_level = #{testLevel,jdbcType=VARCHAR},
      </if>
      <if test="testScore != null" >
        test_score = #{testScore,jdbcType=VARCHAR},
      </if>
      <if test="fileNum != null" >
        file_num = #{fileNum,jdbcType=VARCHAR},
      </if>
      <if test="fPedigreeNum != null" >
        f_pedigree_num = #{fPedigreeNum,jdbcType=VARCHAR},
      </if>
      <if test="mPedigreeNum != null" >
        m_pedigree_num = #{mPedigreeNum,jdbcType=VARCHAR},
      </if>
      <if test="fMPedigreeNum != null" >
        f_m_pedigree_num = #{fMPedigreeNum,jdbcType=VARCHAR},
      </if>
      <if test="inbreedingSeal != null" >
        inbreeding_seal = #{inbreedingSeal,jdbcType=VARCHAR},
      </if>
      <if test="oldStudbookNum != null" >
        old_studbook_num = #{oldStudbookNum,jdbcType=VARCHAR},
      </if>
      <if test="overseasRegCertifi != null" >
        overseas_reg_certifi = #{overseasRegCertifi,jdbcType=VARCHAR},
      </if>
      <if test="addData != null" >
        add_data = #{addData,jdbcType=TIMESTAMP},
      </if>
      <if test="modifiData != null" >
        modifi_data = #{modifiData,jdbcType=TIMESTAMP},
      </if>
      <if test="breedersMembNum != null" >
        breeders_memb_num = #{breedersMembNum,jdbcType=VARCHAR},
      </if>
      <if test="delTag != null" >
        del_tag = #{delTag,jdbcType=VARCHAR},
      </if>
      <if test="printType != null" >
        print_type = #{printType,jdbcType=VARCHAR},
      </if>
      <if test="payDna != null" >
        pay_dna = #{payDna,jdbcType=VARCHAR},
      </if>
      <if test="payFy != null" >
        pay_fy = #{payFy,jdbcType=VARCHAR},
      </if>
      <if test="payHd != null" >
        pay_hd = #{payHd,jdbcType=VARCHAR},
      </if>
      <if test="threeNo != null" >
        three_no = #{threeNo,jdbcType=INTEGER},
      </if>
      <if test="dogGenertions != null" >
        dog_genertions = #{dogGenertions,jdbcType=INTEGER},
      </if>
      <if test="fanyuConfirm != null" >
        fanyu_confirm = #{fanyuConfirm,jdbcType=VARCHAR},
      </if>
      <if test="dogCritique != null" >
        dog_critique = #{dogCritique,jdbcType=LONGVARCHAR},
      </if>
      <if test="remark != null" >
        remark = #{remark,jdbcType=LONGVARCHAR},
      </if>
      <if test="operator != null" >
        operator = #{operator,jdbcType=LONGVARCHAR},
      </if>
      <if test="runningNum != null" >
        running_num = #{runningNum,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.cku.model.CkuDogWithBLOBs" >
    update cku_dog
    set dogvalid = #{dogvalid,jdbcType=VARCHAR},
      dogtype = #{dogtype,jdbcType=VARCHAR},
      shows = #{shows,jdbcType=VARCHAR},
      logout = #{logout,jdbcType=VARCHAR},
      birth_certificate_reg_num = #{birthCertificateRegNum,jdbcType=VARCHAR},
      pedigree_num = #{pedigreeNum,jdbcType=VARCHAR},
      dog_owner = #{dogOwner,jdbcType=VARCHAR},
      member_num = #{memberNum,jdbcType=VARCHAR},
      dog_second_owenr = #{dogSecondOwenr,jdbcType=VARCHAR},
      second_owenr_member_num = #{secondOwenrMemberNum,jdbcType=VARCHAR},
      breeder = #{breeder,jdbcType=VARCHAR},
      dog_eg_name = #{dogEgName,jdbcType=VARCHAR},
      dog_cn_name = #{dogCnName,jdbcType=VARCHAR},
      dog_gender = #{dogGender,jdbcType=VARCHAR},
      dog_type = #{dogType,jdbcType=VARCHAR},
      dog_birthday = #{dogBirthday,jdbcType=TIMESTAMP},
      identifi_sign = #{identifiSign,jdbcType=VARCHAR},
      coat_texture = #{coatTexture,jdbcType=VARCHAR},
      color_mark = #{colorMark,jdbcType=VARCHAR},
      special_mark = #{specialMark,jdbcType=VARCHAR},
      hip_joint_identifi_result = #{hipJointIdentifiResult,jdbcType=VARCHAR},
      elbow_joint_identifi_result = #{elbowJointIdentifiResult,jdbcType=VARCHAR},
      dna = #{dna,jdbcType=VARCHAR},
      breeding_qualifi = #{breedingQualifi,jdbcType=VARCHAR},
      kin_breeding = #{kinBreeding,jdbcType=VARCHAR},
      show_level = #{showLevel,jdbcType=VARCHAR},
      show_result = #{showResult,jdbcType=VARCHAR},
      test_level = #{testLevel,jdbcType=VARCHAR},
      test_score = #{testScore,jdbcType=VARCHAR},
      file_num = #{fileNum,jdbcType=VARCHAR},
      f_pedigree_num = #{fPedigreeNum,jdbcType=VARCHAR},
      m_pedigree_num = #{mPedigreeNum,jdbcType=VARCHAR},
      f_m_pedigree_num = #{fMPedigreeNum,jdbcType=VARCHAR},
      inbreeding_seal = #{inbreedingSeal,jdbcType=VARCHAR},
      old_studbook_num = #{oldStudbookNum,jdbcType=VARCHAR},
      overseas_reg_certifi = #{overseasRegCertifi,jdbcType=VARCHAR},
      add_data = #{addData,jdbcType=TIMESTAMP},
      modifi_data = #{modifiData,jdbcType=TIMESTAMP},
      breeders_memb_num = #{breedersMembNum,jdbcType=VARCHAR},
      del_tag = #{delTag,jdbcType=VARCHAR},
      print_type = #{printType,jdbcType=VARCHAR},
      pay_dna = #{payDna,jdbcType=VARCHAR},
      pay_fy = #{payFy,jdbcType=VARCHAR},
      pay_hd = #{payHd,jdbcType=VARCHAR},
      three_no = #{threeNo,jdbcType=INTEGER},
      dog_genertions = #{dogGenertions,jdbcType=INTEGER},
      fanyu_confirm = #{fanyuConfirm,jdbcType=VARCHAR},
      dog_critique = #{dogCritique,jdbcType=LONGVARCHAR},
      remark = #{remark,jdbcType=LONGVARCHAR},
      operator = #{operator,jdbcType=LONGVARCHAR},
      running_num = #{runningNum,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.cku.model.CkuDog" >
    update cku_dog
    set dogvalid = #{dogvalid,jdbcType=VARCHAR},
      dogtype = #{dogtype,jdbcType=VARCHAR},
      shows = #{shows,jdbcType=VARCHAR},
      logout = #{logout,jdbcType=VARCHAR},
      birth_certificate_reg_num = #{birthCertificateRegNum,jdbcType=VARCHAR},
      pedigree_num = #{pedigreeNum,jdbcType=VARCHAR},
      dog_owner = #{dogOwner,jdbcType=VARCHAR},
      member_num = #{memberNum,jdbcType=VARCHAR},
      dog_second_owenr = #{dogSecondOwenr,jdbcType=VARCHAR},
      second_owenr_member_num = #{secondOwenrMemberNum,jdbcType=VARCHAR},
      breeder = #{breeder,jdbcType=VARCHAR},
      dog_eg_name = #{dogEgName,jdbcType=VARCHAR},
      dog_cn_name = #{dogCnName,jdbcType=VARCHAR},
      dog_gender = #{dogGender,jdbcType=VARCHAR},
      dog_type = #{dogType,jdbcType=VARCHAR},
      dog_birthday = #{dogBirthday,jdbcType=TIMESTAMP},
      identifi_sign = #{identifiSign,jdbcType=VARCHAR},
      coat_texture = #{coatTexture,jdbcType=VARCHAR},
      color_mark = #{colorMark,jdbcType=VARCHAR},
      special_mark = #{specialMark,jdbcType=VARCHAR},
      hip_joint_identifi_result = #{hipJointIdentifiResult,jdbcType=VARCHAR},
      elbow_joint_identifi_result = #{elbowJointIdentifiResult,jdbcType=VARCHAR},
      dna = #{dna,jdbcType=VARCHAR},
      breeding_qualifi = #{breedingQualifi,jdbcType=VARCHAR},
      kin_breeding = #{kinBreeding,jdbcType=VARCHAR},
      show_level = #{showLevel,jdbcType=VARCHAR},
      show_result = #{showResult,jdbcType=VARCHAR},
      test_level = #{testLevel,jdbcType=VARCHAR},
      test_score = #{testScore,jdbcType=VARCHAR},
      file_num = #{fileNum,jdbcType=VARCHAR},
      f_pedigree_num = #{fPedigreeNum,jdbcType=VARCHAR},
      m_pedigree_num = #{mPedigreeNum,jdbcType=VARCHAR},
      f_m_pedigree_num = #{fMPedigreeNum,jdbcType=VARCHAR},
      inbreeding_seal = #{inbreedingSeal,jdbcType=VARCHAR},
      old_studbook_num = #{oldStudbookNum,jdbcType=VARCHAR},
      overseas_reg_certifi = #{overseasRegCertifi,jdbcType=VARCHAR},
      add_data = #{addData,jdbcType=TIMESTAMP},
      modifi_data = #{modifiData,jdbcType=TIMESTAMP},
      breeders_memb_num = #{breedersMembNum,jdbcType=VARCHAR},
      del_tag = #{delTag,jdbcType=VARCHAR},
      print_type = #{printType,jdbcType=VARCHAR},
      pay_dna = #{payDna,jdbcType=VARCHAR},
      pay_fy = #{payFy,jdbcType=VARCHAR},
      pay_hd = #{payHd,jdbcType=VARCHAR},
      three_no = #{threeNo,jdbcType=INTEGER},
      dog_genertions = #{dogGenertions,jdbcType=INTEGER},
      fanyu_confirm = #{fanyuConfirm,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>