<?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.unis.base.server.dao.DRyxxsjyHisDao" >
  <resultMap id="BaseResultMap" type="com.unis.base.server.entity.DRyxxsjyHisDO" >
    <id column="RYBAJL_ID" property="rybajlId" jdbcType="VARCHAR" />
    <result column="RYBH" property="rybh" jdbcType="VARCHAR" />
    <result column="RYXM" property="ryxm" jdbcType="VARCHAR" />
    <result column="KDDM" property="kddm" jdbcType="VARCHAR" />
    <result column="SFZH" property="sfzh" jdbcType="VARCHAR" />
    <result column="XB" property="xb" jdbcType="VARCHAR" />
    <result column="JG" property="jg" jdbcType="VARCHAR" />
    <result column="MZ" property="mz" jdbcType="VARCHAR" />
    <result column="CSSJ" property="cssj" jdbcType="DATE" />
    <result column="CJGZSJ" property="cjgzsj" jdbcType="DATE" />
    <result column="WHCD" property="whcd" jdbcType="VARCHAR" />
    <result column="XXZY" property="xxzy" jdbcType="VARCHAR" />
    <result column="ZZMM" property="zzmm" jdbcType="VARCHAR" />
    <result column="ZWDM" property="zwdm" jdbcType="VARCHAR" />
    <result column="ZWMC" property="zwmc" jdbcType="VARCHAR" />
    <result column="BMDM" property="bmdm" jdbcType="VARCHAR" />
    <result column="BMBDM" property="bmbdm" jdbcType="VARCHAR" />
    <result column="BMZDM" property="bmzdm" jdbcType="VARCHAR" />
    <result column="ZGQKDM" property="zgqkdm" jdbcType="VARCHAR" />
    <result column="GWDM" property="gwdm" jdbcType="VARCHAR" />
    <result column="JSZCDM" property="jszcdm" jdbcType="VARCHAR" />
    <result column="JSZCMC" property="jszcmc" jdbcType="VARCHAR" />
    <result column="LXDH" property="lxdh" jdbcType="VARCHAR" />
    <result column="JBZS" property="jbzs" jdbcType="VARCHAR" />
    <result column="FZDW" property="fzdw" jdbcType="VARCHAR" />
    <result column="SFBA" property="sfba" jdbcType="INTEGER" />
    <result column="SPYJ" property="spyj" jdbcType="VARCHAR" />
    <result column="STATUS" property="status" jdbcType="INTEGER" />
    <result column="CREATOR" property="creator" jdbcType="VARCHAR" />
    <result column="CREATOR_CODE" property="creatorCode" jdbcType="VARCHAR" />
    <result column="CREATE_DATE" property="createDate" jdbcType="TIMESTAMP" />
    <result column="REFRESHER" property="refresher" jdbcType="VARCHAR" />
    <result column="REFRESHER_CODE" property="refresherCode" jdbcType="VARCHAR" />
    <result column="REFRESH_TIME" property="refreshTime" jdbcType="TIMESTAMP" />
    <result column="REMARK" property="remark" jdbcType="VARCHAR" />
    
    
    <result column="SHRYBH" property="shrybh" jdbcType="VARCHAR" />
    <result column="SHRYMC" property="shrymc" jdbcType="VARCHAR" />
    <result column="SHBMBH" property="shbmbh" jdbcType="VARCHAR" />
    <result column="SHBMMC" property="shbmmc" jdbcType="VARCHAR" />
  </resultMap>
  
  
  <sql id="Base_Column_List" >
    RYBAJL_ID, RYBH, RYXM, KDDM, SFZH, XB, JG, MZ, CSSJ, CJGZSJ, WHCD, XXZY, ZZMM, ZWDM, 
    ZWMC, BMDM, BMBDM, BMZDM, ZGQKDM, GWDM, JSZCDM, JSZCMC, LXDH, JBZS, FZDW, SFBA, SPYJ, 
    STATUS, CREATOR, CREATOR_CODE, CREATE_DATE, REFRESHER, REFRESHER_CODE, REFRESH_TIME, 
    REMARK, SHRYBH, SHRYMC, SHBMBH, SHBMMC
  </sql>
  
  
  <select id="selectUsePrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
  select 
    <include refid="Base_Column_List" />
    from D_RYXXSJY_HIS
    where RYBAJL_ID = #{rybajlId,jdbcType=VARCHAR}
  </select>
  
 
  <insert id="insert" parameterType="com.unis.base.server.entity.DRyxxsjyHisDO" >
    insert into D_RYXXSJY_HIS (RYBAJL_ID, RYBH, RYXM, 
      KDDM, SFZH, XB, JG, 
      MZ, CSSJ, CJGZSJ, WHCD, 
      XXZY, ZZMM, ZWDM, ZWMC, 
      BMDM, BMBDM, BMZDM, 
      ZGQKDM, GWDM, JSZCDM, 
      JSZCMC, LXDH, JBZS, 
      FZDW, SFBA, SPYJ, STATUS, 
      CREATOR, CREATOR_CODE, CREATE_DATE, 
      REFRESHER, REFRESHER_CODE, REFRESH_TIME, 
      REMARK,SHRYBH, SHRYMC, SHBMBH, SHBMMC)
    values (#{rybajlId,jdbcType=VARCHAR}, #{rybh,jdbcType=VARCHAR}, #{ryxm,jdbcType=VARCHAR}, 
      #{kddm,jdbcType=VARCHAR}, #{sfzh,jdbcType=VARCHAR}, #{xb,jdbcType=VARCHAR}, #{jg,jdbcType=VARCHAR}, 
      #{mz,jdbcType=VARCHAR}, #{cssj,jdbcType=DATE}, #{cjgzsj,jdbcType=DATE}, #{whcd,jdbcType=VARCHAR},
      #{xxzy,jdbcType=VARCHAR}, #{zzmm,jdbcType=VARCHAR}, #{zwdm,jdbcType=VARCHAR}, #{zwmc,jdbcType=VARCHAR}, 
      #{bmdm,jdbcType=VARCHAR}, #{bmbdm,jdbcType=VARCHAR}, #{bmzdm,jdbcType=VARCHAR}, 
      #{zgqkdm,jdbcType=VARCHAR}, #{gwdm,jdbcType=VARCHAR}, #{jszcdm,jdbcType=VARCHAR}, 
      #{jszcmc,jdbcType=VARCHAR}, #{lxdh,jdbcType=VARCHAR}, #{jbzs,jdbcType=VARCHAR}, 
      #{fzdw,jdbcType=VARCHAR}, #{sfba,jdbcType=INTEGER}, #{spyj,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
      #{creator,jdbcType=VARCHAR}, #{creatorCode,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 
      #{refresher,jdbcType=VARCHAR}, #{refresherCode,jdbcType=VARCHAR}, #{refreshTime,jdbcType=TIMESTAMP}, 
      #{remark,jdbcType=VARCHAR}, #{shrybh,jdbcType=VARCHAR}, #{shrymc,jdbcType=VARCHAR}, #{shbmbh,jdbcType=VARCHAR}, 
      #{shbmmc,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.unis.base.server.entity.DRyxxsjyHisDO" >
    insert into D_RYXXSJY_HIS
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="rybajlId != null" >
        RYBAJL_ID,
      </if>
      <if test="rybh != null" >
        RYBH,
      </if>
      <if test="ryxm != null" >
        RYXM,
      </if>
      <if test="kddm != null" >
        KDDM,
      </if>
      <if test="sfzh != null" >
        SFZH,
      </if>
      <if test="xb != null" >
        XB,
      </if>
      <if test="jg != null" >
        JG,
      </if>
      <if test="mz != null" >
        MZ,
      </if>
      <if test="cssj != null" >
        CSSJ,
      </if>
      <if test="cjgzsj != null" >
        CJGZSJ,
      </if>
      <if test="whcd != null" >
        WHCD,
      </if>
      <if test="xxzy != null" >
        XXZY,
      </if>
      <if test="zzmm != null" >
        ZZMM,
      </if>
      <if test="zwdm != null" >
        ZWDM,
      </if>
      <if test="zwmc != null" >
        ZWMC,
      </if>
      <if test="bmdm != null" >
        BMDM,
      </if>
      <if test="bmbdm != null" >
        BMBDM,
      </if>
      <if test="bmzdm != null" >
        BMZDM,
      </if>
      <if test="zgqkdm != null" >
        ZGQKDM,
      </if>
      <if test="gwdm != null" >
        GWDM,
      </if>
      <if test="jszcdm != null" >
        JSZCDM,
      </if>
      <if test="jszcmc != null" >
        JSZCMC,
      </if>
      <if test="lxdh != null" >
        LXDH,
      </if>
      <if test="jbzs != null" >
        JBZS,
      </if>
      <if test="fzdw != null" >
        FZDW,
      </if>
      <if test="sfba != null" >
        SFBA,
      </if>
      <if test="spyj != null" >
        SPYJ,
      </if>
      <if test="status != null" >
        STATUS,
      </if>
      <if test="creator != null" >
        CREATOR,
      </if>
      <if test="creatorCode != null" >
        CREATOR_CODE,
      </if>
      <if test="createDate != null" >
        CREATE_DATE,
      </if>
      <if test="refresher != null" >
        REFRESHER,
      </if>
      <if test="refresherCode != null" >
        REFRESHER_CODE,
      </if>
      <if test="refreshTime != null" >
        REFRESH_TIME,
      </if>
      <if test="remark != null" >
        REMARK,
      </if>
      
      <if test="shrybh != null" >
        SHRYBH,
      </if>
      <if test="shrymc != null" >
        SHRYMC,
      </if>
      <if test="shbmbh != null" >
        SHBMBH,
      </if>
      <if test="shbmmc != null" >
        SHBMMC,
      </if>
      
      
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="rybajlId != null" >
        #{rybajlId,jdbcType=VARCHAR},
      </if>
      <if test="rybh != null" >
        #{rybh,jdbcType=VARCHAR},
      </if>
      <if test="ryxm != null" >
        #{ryxm,jdbcType=VARCHAR},
      </if>
      <if test="kddm != null" >
        #{kddm,jdbcType=VARCHAR},
      </if>
      <if test="sfzh != null" >
        #{sfzh,jdbcType=VARCHAR},
      </if>
      <if test="xb != null" >
        #{xb,jdbcType=VARCHAR},
      </if>
      <if test="jg != null" >
        #{jg,jdbcType=VARCHAR},
      </if>
      <if test="mz != null" >
        #{mz,jdbcType=VARCHAR},
      </if>
      <if test="cssj != null" >
        #{cssj,jdbcType=DATE},
      </if>
      <if test="cjgzsj != null" >
        #{cjgzsj,jdbcType=DATE},
      </if>
      <if test="whcd != null" >
        #{whcd,jdbcType=VARCHAR},
      </if>
      <if test="xxzy != null" >
        #{xxzy,jdbcType=VARCHAR},
      </if>
      <if test="zzmm != null" >
        #{zzmm,jdbcType=VARCHAR},
      </if>
      <if test="zwdm != null" >
        #{zwdm,jdbcType=VARCHAR},
      </if>
      <if test="zwmc != null" >
        #{zwmc,jdbcType=VARCHAR},
      </if>
      <if test="bmdm != null" >
        #{bmdm,jdbcType=VARCHAR},
      </if>
      <if test="bmbdm != null" >
        #{bmbdm,jdbcType=VARCHAR},
      </if>
      <if test="bmzdm != null" >
        #{bmzdm,jdbcType=VARCHAR},
      </if>
      <if test="zgqkdm != null" >
        #{zgqkdm,jdbcType=VARCHAR},
      </if>
      <if test="gwdm != null" >
        #{gwdm,jdbcType=VARCHAR},
      </if>
      <if test="jszcdm != null" >
        #{jszcdm,jdbcType=VARCHAR},
      </if>
      <if test="jszcmc != null" >
        #{jszcmc,jdbcType=VARCHAR},
      </if>
      <if test="lxdh != null" >
        #{lxdh,jdbcType=VARCHAR},
      </if>
      <if test="jbzs != null" >
        #{jbzs,jdbcType=VARCHAR},
      </if>
      <if test="fzdw != null" >
        #{fzdw,jdbcType=VARCHAR},
      </if>
      <if test="sfba != null" >
        #{sfba,jdbcType=INTEGER},
      </if>
      <if test="spyj != null" >
        #{spyj,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=INTEGER},
      </if>
      <if test="creator != null" >
        #{creator,jdbcType=VARCHAR},
      </if>
      <if test="creatorCode != null" >
        #{creatorCode,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null" >
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="refresher != null" >
        #{refresher,jdbcType=VARCHAR},
      </if>
      <if test="refresherCode != null" >
        #{refresherCode,jdbcType=VARCHAR},
      </if>
      <if test="refreshTime != null" >
        #{refreshTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=VARCHAR},
      </if>
      
      
      
      <if test="shrybh != null" >
        #{shrybh,jdbcType=VARCHAR},
      </if>
      <if test="shrymc != null" >
        #{shrymc,jdbcType=VARCHAR},
      </if>
      <if test="shbmbh != null" >
        #{shbmbh,jdbcType=VARCHAR},
      </if>
      <if test="shbmmc != null" >
        #{shbmmc,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  
  
  
  <update id="updateByPrimaryKeySelective" parameterType="com.unis.base.server.entity.DRyxxsjyHisDO" >
    update D_RYXXSJY_HIS
    <set >
      <if test="rybh != null" >
        RYBH = #{rybh,jdbcType=VARCHAR},
      </if>
      <if test="ryxm != null" >
        RYXM = #{ryxm,jdbcType=VARCHAR},
      </if>
      <if test="kddm != null" >
        KDDM = #{kddm,jdbcType=VARCHAR},
      </if>
      <if test="sfzh != null" >
        SFZH = #{sfzh,jdbcType=VARCHAR},
      </if>
      <if test="xb != null" >
        XB = #{xb,jdbcType=VARCHAR},
      </if>
      <if test="jg != null" >
        JG = #{jg,jdbcType=VARCHAR},
      </if>
      <if test="mz != null" >
        MZ = #{mz,jdbcType=VARCHAR},
      </if>
      <if test="cssj != null" >
        CSSJ = #{cssj,jdbcType=DATE},
      </if>
      <if test="cjgzsj != null" >
        CJGZSJ = #{cjgzsj,jdbcType=DATE},
      </if>
      <if test="whcd != null" >
        WHCD = #{whcd,jdbcType=VARCHAR},
      </if>
      <if test="xxzy != null" >
        XXZY = #{xxzy,jdbcType=VARCHAR},
      </if>
      <if test="zzmm != null" >
        ZZMM = #{zzmm,jdbcType=VARCHAR},
      </if>
      <if test="zwdm != null" >
        ZWDM = #{zwdm,jdbcType=VARCHAR},
      </if>
      <if test="zwmc != null" >
        ZWMC = #{zwmc,jdbcType=VARCHAR},
      </if>
      <if test="bmdm != null" >
        BMDM = #{bmdm,jdbcType=VARCHAR},
      </if>
      <if test="bmbdm != null" >
        BMBDM = #{bmbdm,jdbcType=VARCHAR},
      </if>
      <if test="bmzdm != null" >
        BMZDM = #{bmzdm,jdbcType=VARCHAR},
      </if>
      <if test="zgqkdm != null" >
        ZGQKDM = #{zgqkdm,jdbcType=VARCHAR},
      </if>
      <if test="gwdm != null" >
        GWDM = #{gwdm,jdbcType=VARCHAR},
      </if>
      <if test="jszcdm != null" >
        JSZCDM = #{jszcdm,jdbcType=VARCHAR},
      </if>
      <if test="jszcmc != null" >
        JSZCMC = #{jszcmc,jdbcType=VARCHAR},
      </if>
      <if test="lxdh != null" >
        LXDH = #{lxdh,jdbcType=VARCHAR},
      </if>
      <if test="jbzs != null" >
        JBZS = #{jbzs,jdbcType=VARCHAR},
      </if>
      <if test="fzdw != null" >
        FZDW = #{fzdw,jdbcType=VARCHAR},
      </if>
      <if test="sfba != null" >
        SFBA = #{sfba,jdbcType=INTEGER},
      </if>
      <if test="spyj != null" >
        SPYJ = #{spyj,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        STATUS = #{status,jdbcType=INTEGER},
      </if>
      <if test="creator != null" >
        CREATOR = #{creator,jdbcType=VARCHAR},
      </if>
      <if test="creatorCode != null" >
        CREATOR_CODE = #{creatorCode,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null" >
        CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="refresher != null" >
        REFRESHER = #{refresher,jdbcType=VARCHAR},
      </if>
      <if test="refresherCode != null" >
        REFRESHER_CODE = #{refresherCode,jdbcType=VARCHAR},
      </if>
      <if test="refreshTime != null" >
        REFRESH_TIME = #{refreshTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null" >
        REMARK = #{remark,jdbcType=VARCHAR},
      </if>
      
      
      <if test="shrybh != null" >
        SHRYBH = #{shrybh,jdbcType=VARCHAR},
      </if>
      <if test="shrymc != null" >
        SHRYMC = #{shrymc,jdbcType=VARCHAR},
      </if>
      <if test="shbmbh != null" >
        SHBMBH = #{shbmbh,jdbcType=VARCHAR},
      </if>
      <if test="shbmmc != null" >
        SHBMMC = #{shbmmc,jdbcType=VARCHAR},
      </if>
      
    </set>
    where RYBAJL_ID = #{rybajlId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.unis.base.server.entity.DRyxxsjyHisDO" >
    update D_RYXXSJY_HIS
    set RYBH = #{rybh,jdbcType=VARCHAR},
      RYXM = #{ryxm,jdbcType=VARCHAR},
      KDDM = #{kddm,jdbcType=VARCHAR},
      SFZH = #{sfzh,jdbcType=VARCHAR},
      XB = #{xb,jdbcType=VARCHAR},
      JG = #{jg,jdbcType=VARCHAR},
      MZ = #{mz,jdbcType=VARCHAR},
      CSSJ = #{cssj,jdbcType=DATE},
      CJGZSJ = #{cjgzsj,jdbcType=DATE},
      WHCD = #{whcd,jdbcType=VARCHAR},
      XXZY = #{xxzy,jdbcType=VARCHAR},
      ZZMM = #{zzmm,jdbcType=VARCHAR},
      ZWDM = #{zwdm,jdbcType=VARCHAR},
      ZWMC = #{zwmc,jdbcType=VARCHAR},
      BMDM = #{bmdm,jdbcType=VARCHAR},
      BMBDM = #{bmbdm,jdbcType=VARCHAR},
      BMZDM = #{bmzdm,jdbcType=VARCHAR},
      ZGQKDM = #{zgqkdm,jdbcType=VARCHAR},
      GWDM = #{gwdm,jdbcType=VARCHAR},
      JSZCDM = #{jszcdm,jdbcType=VARCHAR},
      JSZCMC = #{jszcmc,jdbcType=VARCHAR},
      LXDH = #{lxdh,jdbcType=VARCHAR},
      JBZS = #{jbzs,jdbcType=VARCHAR},
      FZDW = #{fzdw,jdbcType=VARCHAR},
      SFBA = #{sfba,jdbcType=INTEGER},
      SPYJ = #{spyj,jdbcType=VARCHAR},
      STATUS = #{status,jdbcType=INTEGER},
      CREATOR = #{creator,jdbcType=VARCHAR},
      CREATOR_CODE = #{creatorCode,jdbcType=VARCHAR},
      CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
      REFRESHER = #{refresher,jdbcType=VARCHAR},
      REFRESHER_CODE = #{refresherCode,jdbcType=VARCHAR},
      REFRESH_TIME = #{refreshTime,jdbcType=TIMESTAMP},
      REMARK = #{remark,jdbcType=VARCHAR},
      
      
      SHRYBH = #{shrybh,jdbcType=VARCHAR},
      SHRYMC = #{shrymc,jdbcType=VARCHAR},
      SHBMBH = #{shbmbh,jdbcType=VARCHAR},
      SHBMMC = #{shbmmc,jdbcType=VARCHAR}
    where RYBAJL_ID = #{rybajlId,jdbcType=VARCHAR}
  </update>
  
  
  
  <select id="getonList" resultMap="BaseResultMap" parameterType="com.unis.base.common.vo.PersonnelRecordsHisqueryVO">
    select 
    <include refid="Base_Column_List" />
    from D_RYXXSJY_HIS
    where STATUS=1
  </select>
  
  
  
  <!-- 主键 -->
  <select id="getMaxCodeById" parameterType="java.lang.String" resultType="java.lang.String">
        SELECT 
        	max(RYBAJL_ID)
        from 
			D_RYXXSJY_HIS
			where RYBAJL_ID  LIKE CONCAT(#{pstr,jdbcType=VARCHAR}, '%') and status=1
  </select>
    
  
</mapper>