<?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.DYpxxHisDao" >
  <resultMap id="BaseResultMap" type="com.unis.base.server.entity.DYpxxHisDO" >
    <id column="ID" property="id" jdbcType="VARCHAR" />
    <result column="YPID" property="ypid" jdbcType="VARCHAR" />
    <result column="YPDM" property="ypdm" jdbcType="VARCHAR" />
    <result column="YPMC" property="ypmc" jdbcType="VARCHAR" />
    <result column="YPGGXH" property="ypggxh" jdbcType="VARCHAR" />
    <result column="BZZ" property="bzz" jdbcType="VARCHAR" />
    <result column="KCSL" property="kcsl" jdbcType="DECIMAL" />
    <result column="YPDJ" property="ypdj" jdbcType="VARCHAR" />
    <result column="ZHYSSJ" property="zhyssj" jdbcType="DATE" />
    <result column="STATUS" property="status" jdbcType="DECIMAL" />
    <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="RQ" property="rq" jdbcType="DATE" />
    <result column="YJZL" property="yjzl" jdbcType="VARCHAR" />
    <result column="YJXT" property="yjxt" jdbcType="VARCHAR" />
    <result column="YJBZ" property="yjbz" jdbcType="VARCHAR" />
    <result column="ZCSL" property="zcsl" jdbcType="DECIMAL" />
    <result column="JYSL" property="jysl" jdbcType="DECIMAL" />
    <result column="PDGQSL" property="pdgqsl" jdbcType="DECIMAL" />
    <result column="PDSYSL" property="pdsysl" jdbcType="DECIMAL" />
    <result column="SSKM" property="sskm" jdbcType="VARCHAR" />
    <result column="SSKMBH" property="sskmbh" jdbcType="VARCHAR" />
    <result column="SFBA" property="sfba" jdbcType="DECIMAL" />
    <result column="SPYJ" property="spyj" 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" />
    <result column="SCCJ" property="sccj"  jdbcType="VARCHAR"/>
    <result column="DJR_CODE" property="djrCode" jdbcType="VARCHAR"/>
     <result column="HDR_CODE" property="hdrCode" jdbcType="VARCHAR"/>
   <result column="DJR_NAME" property="djrName" jdbcType="VARCHAR"/>
   <result column="HDR_NAME" property="hdrName" jdbcType="VARCHAR"/>
   <result column="QYMC" property="qymc" jdbcType="VARCHAR"/>
  </resultMap>
  
  <sql id="Base_Column_List" >
    ID, YPID, YPDM, YPMC, YPGGXH, BZZ, KCSL, YPDJ, ZHYSSJ, STATUS, CREATOR, CREATOR_CODE, 
    CREATE_DATE, REFRESHER, REFRESHER_CODE, REFRESH_TIME, REMARK, RQ, YJZL, YJXT, YJBZ, 
    ZCSL, JYSL, PDGQSL, PDSYSL, SSKM, SSKMBH, SFBA, SPYJ, SHRYBH, SHRYMC, SHBMBH, SHBMMC,
     SCCJ,DJR_CODE,HDR_CODE,DJR_NAME,HDR_NAME,QYMC
  </sql>
 
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from D_YPXX_HIS
    where ID = #{id,jdbcType=VARCHAR}
  </select>
  
   <select id="findPageList" resultMap="BaseResultMap" parameterType="com.unis.base.common.vo.DYpxxQueryVO" >
    select
    <include refid="Base_Column_List" />
    from D_YPXX_HIS
    <where>
		   STATUS=1  
		<if test="ypmc!= null and ypmc != ''">
		   AND YPMC = #{ypmc,jdbcType=VARCHAR}
		</if>
	</where>
		  ORDER BY CREATE_DATE DESC
  </select>
  	<!-- 任务编号生成策略 -->
	 <select id="getMaxCodeById"  resultType="java.lang.String" parameterType="java.lang.String">
	        SELECT  MAX(ID) FROM  D_YPXX_HIS where ID  LIKE CONCAT(#{pstr,jdbcType=VARCHAR}, '%')
	  </select>
	  
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from D_YPXX_HIS
    where ID = #{id,jdbcType=VARCHAR}
  </delete>

  <insert id="insert" parameterType="com.unis.base.server.entity.DYpxxHisDO" >
    insert into D_YPXX_HIS (ID, YPID, YPDM, 
      YPMC, YPGGXH, BZZ, 
      KCSL, YPDJ, ZHYSSJ, STATUS, 
      CREATOR, CREATOR_CODE, CREATE_DATE, 
      REFRESHER, REFRESHER_CODE, REFRESH_TIME, 
      REMARK, RQ, YJZL, YJXT, 
      YJBZ, ZCSL, JYSL, PDGQSL, 
      PDSYSL, SSKM, SSKMBH, 
      SFBA, SPYJ, SHRYBH, 
      SHRYMC, SHBMBH, SHBMMC, SCCJ,DJR_CODE,HDR_CODE,DJR_NAME,HDR_NAME,QYMC
      )
    values (#{id,jdbcType=VARCHAR}, #{ypid,jdbcType=VARCHAR}, #{ypdm,jdbcType=VARCHAR}, 
      #{ypmc,jdbcType=VARCHAR}, #{ypggxh,jdbcType=VARCHAR}, #{bzz,jdbcType=VARCHAR}, 
      #{kcsl,jdbcType=DECIMAL}, #{ypdj,jdbcType=VARCHAR}, #{zhyssj,jdbcType=DATE}, #{status,jdbcType=DECIMAL}, 
      #{creator,jdbcType=VARCHAR}, #{creatorCode,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, 
      #{refresher,jdbcType=VARCHAR}, #{refresherCode,jdbcType=VARCHAR}, #{refreshTime,jdbcType=TIMESTAMP}, 
      #{remark,jdbcType=VARCHAR}, #{rq,jdbcType=DATE}, #{yjzl,jdbcType=VARCHAR}, #{yjxt,jdbcType=VARCHAR}, 
      #{yjbz,jdbcType=VARCHAR}, #{zcsl,jdbcType=DECIMAL}, #{jysl,jdbcType=DECIMAL}, #{pdgqsl,jdbcType=DECIMAL}, 
      #{pdsysl,jdbcType=DECIMAL}, #{sskm,jdbcType=VARCHAR}, #{sskmbh,jdbcType=VARCHAR}, 
      #{sfba,jdbcType=DECIMAL}, #{spyj,jdbcType=VARCHAR}, #{shrybh,jdbcType=VARCHAR}, 
      #{shrymc,jdbcType=VARCHAR}, #{shbmbh,jdbcType=VARCHAR}, #{shbmmc,jdbcType=VARCHAR},
      #{sccj,jdbcType=VARCHAR}, #{djrCode,jdbcType=VARCHAR}, #{hdrCode,jdbcType=VARCHAR},#{djrName,jdbcType=VARCHAR},#{hdrName,jdbcType=VARCHAR}, #{qymc,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.unis.base.server.entity.DYpxxHisDO" >
    insert into D_YPXX_HIS
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        ID,
      </if>
      <if test="ypid != null" >
        YPID,
      </if>
      <if test="ypdm != null" >
        YPDM,
      </if>
      <if test="ypmc != null" >
        YPMC,
      </if>
      <if test="ypggxh != null" >
        YPGGXH,
      </if>
      <if test="bzz != null" >
        BZZ,
      </if>
      <if test="kcsl != null" >
        KCSL,
      </if>
      <if test="ypdj != null" >
        YPDJ,
      </if>
      <if test="zhyssj != null" >
        ZHYSSJ,
      </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="rq != null" >
        RQ,
      </if>
      <if test="yjzl != null" >
        YJZL,
      </if>
      <if test="yjxt != null" >
        YJXT,
      </if>
      <if test="yjbz != null" >
        YJBZ,
      </if>
      <if test="zcsl != null" >
        ZCSL,
      </if>
      <if test="jysl != null" >
        JYSL,
      </if>
      <if test="pdgqsl != null" >
        PDGQSL,
      </if>
      <if test="pdsysl != null" >
        PDSYSL,
      </if>
      <if test="sskm != null" >
        SSKM,
      </if>
      <if test="sskmbh != null" >
        SSKMBH,
      </if>
      <if test="sfba != null" >
        SFBA,
      </if>
      <if test="spyj != null" >
        SPYJ,
      </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>
      <if test="sccj != null" >
        SCCJ,
      </if>
      <if test="djrCode != null" >
        DJR_CODE,
      </if>
      <if test="hdrCode != null" >
        HDR_CODE,
      </if>
      <if test="djrName != null" >
        DJR_NAME,
      </if>
      <if test="hdrName != null" >
        HDR_NAME,
      </if>
      <if test="qymc != null" >
        QYMC,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="ypid != null" >
        #{ypid,jdbcType=VARCHAR},
      </if>
      <if test="ypdm != null" >
        #{ypdm,jdbcType=VARCHAR},
      </if>
      <if test="ypmc != null" >
        #{ypmc,jdbcType=VARCHAR},
      </if>
      <if test="ypggxh != null" >
        #{ypggxh,jdbcType=VARCHAR},
      </if>
      <if test="bzz != null" >
        #{bzz,jdbcType=VARCHAR},
      </if>
      <if test="kcsl != null" >
        #{kcsl,jdbcType=DECIMAL},
      </if>
      <if test="ypdj != null" >
        #{ypdj,jdbcType=VARCHAR},
      </if>
      <if test="zhyssj != null" >
        #{zhyssj,jdbcType=DATE},
      </if>
      <if test="status != null" >
        #{status,jdbcType=DECIMAL},
      </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="rq != null" >
        #{rq,jdbcType=DATE},
      </if>
      <if test="yjzl != null" >
        #{yjzl,jdbcType=VARCHAR},
      </if>
      <if test="yjxt != null" >
        #{yjxt,jdbcType=VARCHAR},
      </if>
      <if test="yjbz != null" >
        #{yjbz,jdbcType=VARCHAR},
      </if>
      <if test="zcsl != null" >
        #{zcsl,jdbcType=DECIMAL},
      </if>
      <if test="jysl != null" >
        #{jysl,jdbcType=DECIMAL},
      </if>
      <if test="pdgqsl != null" >
        #{pdgqsl,jdbcType=DECIMAL},
      </if>
      <if test="pdsysl != null" >
        #{pdsysl,jdbcType=DECIMAL},
      </if>
      <if test="sskm != null" >
        #{sskm,jdbcType=VARCHAR},
      </if>
      <if test="sskmbh != null" >
        #{sskmbh,jdbcType=VARCHAR},
      </if>
      <if test="sfba != null" >
        #{sfba,jdbcType=DECIMAL},
      </if>
      <if test="spyj != null" >
        #{spyj,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>
      <if test="sccj != null" >
       #{sccj,jdbcType=VARCHAR},
      </if>
      <if test="djrCode != null" >
        #{djrCode,jdbcType=VARCHAR},
      </if>
      <if test="hdrCode != null" >
        #{hdrCode,jdbcType=VARCHAR},
      </if>
      <if test="djrName != null" >
         #{djrName,jdbcType=VARCHAR},
      </if>
      <if test="hdrName != null" >
         #{hdrName,jdbcType=VARCHAR},
      </if>
      <if test="qymc != null" >
         #{qymc,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
 
  <update id="updateByPrimaryKeySelective" parameterType="com.unis.base.server.entity.DYpxxHisDO" >
    update D_YPXX_HIS
    <set >
      <if test="ypid != null" >
        YPID = #{ypid,jdbcType=VARCHAR},
      </if>
      <if test="ypdm != null" >
        YPDM = #{ypdm,jdbcType=VARCHAR},
      </if>
      <if test="ypmc != null" >
        YPMC = #{ypmc,jdbcType=VARCHAR},
      </if>
      <if test="ypggxh != null" >
        YPGGXH = #{ypggxh,jdbcType=VARCHAR},
      </if>
      <if test="bzz != null" >
        BZZ = #{bzz,jdbcType=VARCHAR},
      </if>
      <if test="kcsl != null" >
        KCSL = #{kcsl,jdbcType=DECIMAL},
      </if>
      <if test="ypdj != null" >
        YPDJ = #{ypdj,jdbcType=VARCHAR},
      </if>
      <if test="zhyssj != null" >
        ZHYSSJ = #{zhyssj,jdbcType=DATE},
      </if>
      <if test="status != null" >
        STATUS = #{status,jdbcType=DECIMAL},
      </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="rq != null" >
        RQ = #{rq,jdbcType=DATE},
      </if>
      <if test="yjzl != null" >
        YJZL = #{yjzl,jdbcType=VARCHAR},
      </if>
      <if test="yjxt != null" >
        YJXT = #{yjxt,jdbcType=VARCHAR},
      </if>
      <if test="yjbz != null" >
        YJBZ = #{yjbz,jdbcType=VARCHAR},
      </if>
      <if test="zcsl != null" >
        ZCSL = #{zcsl,jdbcType=DECIMAL},
      </if>
      <if test="jysl != null" >
        JYSL = #{jysl,jdbcType=DECIMAL},
      </if>
      <if test="pdgqsl != null" >
        PDGQSL = #{pdgqsl,jdbcType=DECIMAL},
      </if>
      <if test="pdsysl != null" >
        PDSYSL = #{pdsysl,jdbcType=DECIMAL},
      </if>
      <if test="sskm != null" >
        SSKM = #{sskm,jdbcType=VARCHAR},
      </if>
      <if test="sskmbh != null" >
        SSKMBH = #{sskmbh,jdbcType=VARCHAR},
      </if>
      <if test="sfba != null" >
        SFBA = #{sfba,jdbcType=DECIMAL},
      </if>
      <if test="spyj != null" >
        SPYJ = #{spyj,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>
      <if test="sccj != null" >
        SCCJ = #{sccj,jdbcType=VARCHAR},
      </if>
      <if test="djrCode != null" >
        DJR_CODE = #{djrCode,jdbcType=VARCHAR},
      </if>
      <if test="hdrCode != null" >
        HDR_CODE = #{hdrCode,jdbcType=VARCHAR},
      </if>
      <if test="djrName != null" >
        DJR_NAME = #{djrName,jdbcType=VARCHAR},
      </if>
      <if test="hdrName != null" >
        HDR_NAME = #{hdrName,jdbcType=VARCHAR},
      </if>
      <if test="qymc != null" >
        QYMC = #{qymc,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.unis.base.server.entity.DYpxxHisDO" >
    update D_YPXX_HIS
    set YPID = #{ypid,jdbcType=VARCHAR},
      YPDM = #{ypdm,jdbcType=VARCHAR},
      YPMC = #{ypmc,jdbcType=VARCHAR},
      YPGGXH = #{ypggxh,jdbcType=VARCHAR},
      BZZ = #{bzz,jdbcType=VARCHAR},
      KCSL = #{kcsl,jdbcType=DECIMAL},
      YPDJ = #{ypdj,jdbcType=VARCHAR},
      ZHYSSJ = #{zhyssj,jdbcType=DATE},
      STATUS = #{status,jdbcType=DECIMAL},
      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},
      RQ = #{rq,jdbcType=DATE},
      YJZL = #{yjzl,jdbcType=VARCHAR},
      YJXT = #{yjxt,jdbcType=VARCHAR},
      YJBZ = #{yjbz,jdbcType=VARCHAR},
      ZCSL = #{zcsl,jdbcType=DECIMAL},
      JYSL = #{jysl,jdbcType=DECIMAL},
      PDGQSL = #{pdgqsl,jdbcType=DECIMAL},
      PDSYSL = #{pdsysl,jdbcType=DECIMAL},
      SSKM = #{sskm,jdbcType=VARCHAR},
      SSKMBH = #{sskmbh,jdbcType=VARCHAR},
      SFBA = #{sfba,jdbcType=DECIMAL},
      SPYJ = #{spyj,jdbcType=VARCHAR},
      SHRYBH = #{shrybh,jdbcType=VARCHAR},
      SHRYMC = #{shrymc,jdbcType=VARCHAR},
      SHBMBH = #{shbmbh,jdbcType=VARCHAR},
      SHBMMC = #{shbmmc,jdbcType=VARCHAR},
      SCCJ = #{sccj,jdbcType=VARCHAR},
      DJR_CODE = #{djrCode,jdbcType=VARCHAR},
      HDR_CODE = #{hdrCode,jdbcType=VARCHAR},
      DJR_NAME = #{djrName,jdbcType=VARCHAR},
      QYMC = #{qymc,jdbcType=VARCHAR},
      HDR_NAME = #{hdrName,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=VARCHAR}
  </update>
</mapper>