<?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="cn.com.victorysoft.business.technology.dao.TechJobFeeDao">
    <resultMap id="BaseResultMap" type="cn.com.victorysoft.business.technology.entity.TechJobFee">
        <id column="JH" jdbcType="VARCHAR" property="jh"/>
        <id column="WGRQ" jdbcType="TIMESTAMP" property="wgrq"/>
        <result column="DW" jdbcType="VARCHAR" property="dw"/>
        <result column="JB" jdbcType="VARCHAR" property="jb"/>
        <result column="YQT" jdbcType="VARCHAR" property="yqt"/>
        <result column="DY" jdbcType="VARCHAR" property="dy"/>
        <result column="SGDW" jdbcType="VARCHAR" property="sgdw"/>
        <result column="SGLB" jdbcType="VARCHAR" property="sglb"/>
        <result column="SGMD" jdbcType="VARCHAR" property="sgmd"/>
        <result column="XJLJ" jdbcType="VARCHAR" property="xjlj"/>
        <result column="KGRQ" jdbcType="TIMESTAMP" property="kgrq"/>
        <result column="YSYF" jdbcType="VARCHAR" property="ysyf"/>
        <result column="FYHJ" jdbcType="DECIMAL" property="fyhj"/>
        <result column="LWXJ" jdbcType="DECIMAL" property="lwxj"/>
        <result column="CLXJ" jdbcType="DECIMAL" property="clxj"/>
        <result column="TGXSJ" jdbcType="DECIMAL" property="tgxsj"/>
        <result column="TGXJE" jdbcType="DECIMAL" property="tgxje"/>
        <result column="TGJSL" jdbcType="DECIMAL" property="tgjsl"/>
        <result column="TGJJE" jdbcType="DECIMAL" property="tgjje"/>
        <result column="SJGXSL" jdbcType="DECIMAL" property="sjgxsl"/>
        <result column="SJGXJE" jdbcType="DECIMAL" property="sjgxje"/>
        <result column="SJGJSL" jdbcType="DECIMAL" property="sjgjsl"/>
        <result column="SJGJJE" jdbcType="DECIMAL" property="sjgjje"/>
        <result column="FSLSL" jdbcType="DECIMAL" property="fslsl"/>
        <result column="FSLJE" jdbcType="DECIMAL" property="fslje"/>
        <result column="HGLHJJE" jdbcType="DECIMAL" property="hglhjje"/>
        <result column="SJFSL" jdbcType="DECIMAL" property="sjfsl"/>
        <result column="SJFJE" jdbcType="DECIMAL" property="sjfje"/>
        <result column="SJGJQTSL" jdbcType="DECIMAL" property="sjgjqtsl"/>
        <result column="SJGJQTJE" jdbcType="DECIMAL" property="sjgjqtje"/>
        <result column="JKZZXSJ" jdbcType="DECIMAL" property="jkzzxsj"/>
        <result column="JKZZXJE" jdbcType="DECIMAL" property="jkzzxje"/>
    </resultMap>
    <sql id="Base_Column_List">
    JH, WGRQ, DW, JB, YQT, DY, SGDW, SGLB, SGMD, XJLJ, KGRQ, YSYF, FYHJ, LWXJ, CLXJ, 
    TGXSJ, TGXJE, TGJSL, TGJJE, SJGXSL, SJGXJE, SJGJSL, SJGJJE, FSLSL, FSLJE, HGLHJJE, 
    SJFSL, SJFJE, SJGJQTSL, SJGJQTJE, JKZZXSJ, JKZZXJE
  </sql>
    <select id="selectList" parameterType="cn.com.victorysoft.business.technology.param.TechJobFeeParam"
            resultType="cn.com.victorysoft.business.technology.entity.TechJobFee">
        select
        <include refid="Base_Column_List"/>
        from TECH_JOB_FEE a
        left join sys_unitinfo b on a.dwdm = b.unitcode
        where ysyf >= #{ysyf1,jdbcType=VARCHAR}
        and ysyf &lt;= #{ysyf2,jdbcType=VARCHAR}
        and dwdm in (select unitcode
        from SYS_UNITINFO
        start with UNITCODE = #{dwdm}
        connect by prior UNITCODE = P_UNITCODE)
        <if test="jh != null and jh != ''">
            and jh = #{jh,jdbcType=VARCHAR}
        </if>
        <if test="dw != null and dw != ''">
            and dw = #{dw,jdbcType=VARCHAR}
        </if>
        <if test="dy != null and dy != ''">
            and dy = #{dy,jdbcType=VARCHAR}
        </if>
        <if test="lwxj1 != null and lwxj1 != ''">
            and lwxj >= #{lwxj1,jdbcType=DECIMAL}
        </if>
        <if test="lwxj2 != null and lwxj2 != ''">
            and lwxj &lt;= #{lwxj2,jdbcType=DECIMAL}
        </if>
        <if test="sglb != null and sglb != ''">
            and sglb = #{sglb,jdbcType=VARCHAR}
        </if>
        <if test="sgmd != null and sgmd != ''">
            and sgmd = #{sgmd,jdbcType=VARCHAR}
        </if>
        order by jh
    </select>
    <select id="sumList" parameterType="cn.com.victorysoft.business.technology.param.TechJobFeeParam"
            resultType="cn.com.victorysoft.business.technology.entity.TechJobFee">
        SELECT
        SUM(fyhj) fyhj,
        SUM(lwxj) lwxj,
        SUM(clxj) clxj,
        SUM(tgxsj) tgxsj,
        SUM(tgxje) tgxje,
        SUM(tgjsl) tgjsl,
        SUM(tgjje) tgjje,
        SUM(sjgxsl) sjgxsl,
        SUM(sjgxje) sjgxje,
        SUM(sjgjsl) sjgjsl,
        SUM(sjgjje) sjgjje,
        SUM(fslsl) fslsl,
        SUM(fslje) fslje,
        SUM(hglhjje) hglhjje,
        SUM(sjfsl) sjfsl,
        SUM(sjfje) sjfje,
        SUM(sjgjqtsl) sjgjqtsl,
        SUM(sjgjqtje) sjgjqtje,
        SUM(jkzzxsj) jkzzxsj,
        SUM(jkzzxje) jkzzxje

        FROM TECH_JOB_FEE
        where ysyf >= #{ysyf1,jdbcType=VARCHAR}
        and ysyf &lt;= #{ysyf2,jdbcType=VARCHAR}
        <if test="jh != null and jh != ''">
            and jh = #{jh,jdbcType=VARCHAR}
        </if>
        <if test="dw != null and dw != ''">
            and dw = #{dw,jdbcType=VARCHAR}
        </if>
        <if test="dy != null and dy != ''">
            and dy = #{dy,jdbcType=VARCHAR}
        </if>
        <if test="lwxj1 != null and lwxj1 != ''">
            and lwxj >= #{lwxj1,jdbcType=DECIMAL}
        </if>
        <if test="lwxj2 != null and lwxj2 != ''">
            and lwxj &lt;= #{lwxj2,jdbcType=DECIMAL}
        </if>
        <if test="sglb != null and sglb != ''">
            and sglb = #{sglb,jdbcType=VARCHAR}
        </if>
        <if test="sgmd != null and sgmd != ''">
            and sgmd = #{sgmd,jdbcType=VARCHAR}
        </if>
    </select>
    <select id="selectdwList"
            resultType="cn.com.victorysoft.business.technology.entity.TechJobFee">
        select distinct dw from TECH_JOB_FEE
    </select>
    <select id="selectdyList"
            resultType="cn.com.victorysoft.business.technology.entity.TechJobFee">
        select distinct dy from TECH_JOB_FEE
    </select>
    <select id="selectjhList"
            resultType="cn.com.victorysoft.business.technology.entity.TechJobFee">
        select distinct jh from TECH_JOB_FEE
    </select>
    <select id="selectsglbList"
            resultType="cn.com.victorysoft.business.technology.entity.TechJobFee">
        select distinct sglb from TECH_JOB_FEE
    </select>
    <select id="selectsgmdList"
            resultType="cn.com.victorysoft.business.technology.entity.TechJobFee">
        select distinct sgmd from TECH_JOB_FEE
    </select>
    <select id="selectByPrimaryKey" parameterType="cn.com.victorysoft.business.technology.entity.TechJobFeeKey"
            resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from TECH_JOB_FEE
        where JH = #{jh,jdbcType=VARCHAR}
        and WGRQ = #{wgrq,jdbcType=TIMESTAMP}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="cn.com.victorysoft.business.technology.entity.TechJobFeeKey">
    delete from TECH_JOB_FEE
    where JH = #{jh,jdbcType=VARCHAR}
      and WGRQ = #{wgrq,jdbcType=TIMESTAMP}
  </delete>
    <insert id="insert" parameterType="cn.com.victorysoft.business.technology.entity.TechJobFee">
    insert into TECH_JOB_FEE (DWDM, JH, WGRQ, DW,
      JB, YQT, DY, SGDW, 
      SGLB, SGMD, XJLJ, KGRQ, 
      YSYF, FYHJ, LWXJ, CLXJ, 
      TGXSJ, TGXJE, TGJSL, 
      TGJJE, SJGXSL, SJGXJE, 
      SJGJSL, SJGJJE, FSLSL, 
      FSLJE, HGLHJJE, SJFSL, 
      SJFJE, SJGJQTSL, SJGJQTJE, 
      JKZZXSJ, JKZZXJE)
    values (#{dwdm,jdbcType=VARCHAR}, #{jh,jdbcType=VARCHAR}, #{wgrq,jdbcType=TIMESTAMP}, #{dw,jdbcType=VARCHAR},
      #{jb,jdbcType=VARCHAR}, #{yqt,jdbcType=VARCHAR}, #{dy,jdbcType=VARCHAR}, #{sgdw,jdbcType=VARCHAR}, 
      #{sglb,jdbcType=VARCHAR}, #{sgmd,jdbcType=VARCHAR}, #{xjlj,jdbcType=VARCHAR}, #{kgrq,jdbcType=TIMESTAMP}, 
      #{ysyf,jdbcType=VARCHAR}, #{fyhj,jdbcType=DECIMAL}, #{lwxj,jdbcType=DECIMAL}, #{clxj,jdbcType=DECIMAL}, 
      #{tgxsj,jdbcType=DECIMAL}, #{tgxje,jdbcType=DECIMAL}, #{tgjsl,jdbcType=DECIMAL}, 
      #{tgjje,jdbcType=DECIMAL}, #{sjgxsl,jdbcType=DECIMAL}, #{sjgxje,jdbcType=DECIMAL}, 
      #{sjgjsl,jdbcType=DECIMAL}, #{sjgjje,jdbcType=DECIMAL}, #{fslsl,jdbcType=DECIMAL}, 
      #{fslje,jdbcType=DECIMAL}, #{hglhjje,jdbcType=DECIMAL}, #{sjfsl,jdbcType=DECIMAL}, 
      #{sjfje,jdbcType=DECIMAL}, #{sjgjqtsl,jdbcType=DECIMAL}, #{sjgjqtje,jdbcType=DECIMAL}, 
      #{jkzzxsj,jdbcType=DECIMAL}, #{jkzzxje,jdbcType=DECIMAL})
  </insert>
    <insert id="insertSelective" parameterType="cn.com.victorysoft.business.technology.entity.TechJobFee">
        insert into TECH_JOB_FEE
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="jh != null">
                JH,
            </if>
            <if test="wgrq != null">
                WGRQ,
            </if>
            <if test="dw != null">
                DW,
            </if>
            <if test="jb != null">
                JB,
            </if>
            <if test="yqt != null">
                YQT,
            </if>
            <if test="dy != null">
                DY,
            </if>
            <if test="sgdw != null">
                SGDW,
            </if>
            <if test="sglb != null">
                SGLB,
            </if>
            <if test="sgmd != null">
                SGMD,
            </if>
            <if test="xjlj != null">
                XJLJ,
            </if>
            <if test="kgrq != null">
                KGRQ,
            </if>
            <if test="ysyf != null">
                YSYF,
            </if>
            <if test="fyhj != null">
                FYHJ,
            </if>
            <if test="lwxj != null">
                LWXJ,
            </if>
            <if test="clxj != null">
                CLXJ,
            </if>
            <if test="tgxsj != null">
                TGXSJ,
            </if>
            <if test="tgxje != null">
                TGXJE,
            </if>
            <if test="tgjsl != null">
                TGJSL,
            </if>
            <if test="tgjje != null">
                TGJJE,
            </if>
            <if test="sjgxsl != null">
                SJGXSL,
            </if>
            <if test="sjgxje != null">
                SJGXJE,
            </if>
            <if test="sjgjsl != null">
                SJGJSL,
            </if>
            <if test="sjgjje != null">
                SJGJJE,
            </if>
            <if test="fslsl != null">
                FSLSL,
            </if>
            <if test="fslje != null">
                FSLJE,
            </if>
            <if test="hglhjje != null">
                HGLHJJE,
            </if>
            <if test="sjfsl != null">
                SJFSL,
            </if>
            <if test="sjfje != null">
                SJFJE,
            </if>
            <if test="sjgjqtsl != null">
                SJGJQTSL,
            </if>
            <if test="sjgjqtje != null">
                SJGJQTJE,
            </if>
            <if test="jkzzxsj != null">
                JKZZXSJ,
            </if>
            <if test="jkzzxje != null">
                JKZZXJE,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="jh != null">
                #{jh,jdbcType=VARCHAR},
            </if>
            <if test="wgrq != null">
                #{wgrq,jdbcType=TIMESTAMP},
            </if>
            <if test="dw != null">
                #{dw,jdbcType=VARCHAR},
            </if>
            <if test="jb != null">
                #{jb,jdbcType=VARCHAR},
            </if>
            <if test="yqt != null">
                #{yqt,jdbcType=VARCHAR},
            </if>
            <if test="dy != null">
                #{dy,jdbcType=VARCHAR},
            </if>
            <if test="sgdw != null">
                #{sgdw,jdbcType=VARCHAR},
            </if>
            <if test="sglb != null">
                #{sglb,jdbcType=VARCHAR},
            </if>
            <if test="sgmd != null">
                #{sgmd,jdbcType=VARCHAR},
            </if>
            <if test="xjlj != null">
                #{xjlj,jdbcType=VARCHAR},
            </if>
            <if test="kgrq != null">
                #{kgrq,jdbcType=TIMESTAMP},
            </if>
            <if test="ysyf != null">
                #{ysyf,jdbcType=VARCHAR},
            </if>
            <if test="fyhj != null">
                #{fyhj,jdbcType=DECIMAL},
            </if>
            <if test="lwxj != null">
                #{lwxj,jdbcType=DECIMAL},
            </if>
            <if test="clxj != null">
                #{clxj,jdbcType=DECIMAL},
            </if>
            <if test="tgxsj != null">
                #{tgxsj,jdbcType=DECIMAL},
            </if>
            <if test="tgxje != null">
                #{tgxje,jdbcType=DECIMAL},
            </if>
            <if test="tgjsl != null">
                #{tgjsl,jdbcType=DECIMAL},
            </if>
            <if test="tgjje != null">
                #{tgjje,jdbcType=DECIMAL},
            </if>
            <if test="sjgxsl != null">
                #{sjgxsl,jdbcType=DECIMAL},
            </if>
            <if test="sjgxje != null">
                #{sjgxje,jdbcType=DECIMAL},
            </if>
            <if test="sjgjsl != null">
                #{sjgjsl,jdbcType=DECIMAL},
            </if>
            <if test="sjgjje != null">
                #{sjgjje,jdbcType=DECIMAL},
            </if>
            <if test="fslsl != null">
                #{fslsl,jdbcType=DECIMAL},
            </if>
            <if test="fslje != null">
                #{fslje,jdbcType=DECIMAL},
            </if>
            <if test="hglhjje != null">
                #{hglhjje,jdbcType=DECIMAL},
            </if>
            <if test="sjfsl != null">
                #{sjfsl,jdbcType=DECIMAL},
            </if>
            <if test="sjfje != null">
                #{sjfje,jdbcType=DECIMAL},
            </if>
            <if test="sjgjqtsl != null">
                #{sjgjqtsl,jdbcType=DECIMAL},
            </if>
            <if test="sjgjqtje != null">
                #{sjgjqtje,jdbcType=DECIMAL},
            </if>
            <if test="jkzzxsj != null">
                #{jkzzxsj,jdbcType=DECIMAL},
            </if>
            <if test="jkzzxje != null">
                #{jkzzxje,jdbcType=DECIMAL},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="cn.com.victorysoft.business.technology.entity.TechJobFee">
        update TECH_JOB_FEE
        <set>
            <if test="dw != null">
                DW = #{dw,jdbcType=VARCHAR},
            </if>
            <if test="jb != null">
                JB = #{jb,jdbcType=VARCHAR},
            </if>
            <if test="yqt != null">
                YQT = #{yqt,jdbcType=VARCHAR},
            </if>
            <if test="dy != null">
                DY = #{dy,jdbcType=VARCHAR},
            </if>
            <if test="sgdw != null">
                SGDW = #{sgdw,jdbcType=VARCHAR},
            </if>
            <if test="sglb != null">
                SGLB = #{sglb,jdbcType=VARCHAR},
            </if>
            <if test="sgmd != null">
                SGMD = #{sgmd,jdbcType=VARCHAR},
            </if>
            <if test="xjlj != null">
                XJLJ = #{xjlj,jdbcType=VARCHAR},
            </if>
            <if test="kgrq != null">
                KGRQ = #{kgrq,jdbcType=TIMESTAMP},
            </if>
            <if test="ysyf != null">
                YSYF = #{ysyf,jdbcType=VARCHAR},
            </if>
            <if test="fyhj != null">
                FYHJ = #{fyhj,jdbcType=DECIMAL},
            </if>
            <if test="lwxj != null">
                LWXJ = #{lwxj,jdbcType=DECIMAL},
            </if>
            <if test="clxj != null">
                CLXJ = #{clxj,jdbcType=DECIMAL},
            </if>
            <if test="tgxsj != null">
                TGXSJ = #{tgxsj,jdbcType=DECIMAL},
            </if>
            <if test="tgxje != null">
                TGXJE = #{tgxje,jdbcType=DECIMAL},
            </if>
            <if test="tgjsl != null">
                TGJSL = #{tgjsl,jdbcType=DECIMAL},
            </if>
            <if test="tgjje != null">
                TGJJE = #{tgjje,jdbcType=DECIMAL},
            </if>
            <if test="sjgxsl != null">
                SJGXSL = #{sjgxsl,jdbcType=DECIMAL},
            </if>
            <if test="sjgxje != null">
                SJGXJE = #{sjgxje,jdbcType=DECIMAL},
            </if>
            <if test="sjgjsl != null">
                SJGJSL = #{sjgjsl,jdbcType=DECIMAL},
            </if>
            <if test="sjgjje != null">
                SJGJJE = #{sjgjje,jdbcType=DECIMAL},
            </if>
            <if test="fslsl != null">
                FSLSL = #{fslsl,jdbcType=DECIMAL},
            </if>
            <if test="fslje != null">
                FSLJE = #{fslje,jdbcType=DECIMAL},
            </if>
            <if test="hglhjje != null">
                HGLHJJE = #{hglhjje,jdbcType=DECIMAL},
            </if>
            <if test="sjfsl != null">
                SJFSL = #{sjfsl,jdbcType=DECIMAL},
            </if>
            <if test="sjfje != null">
                SJFJE = #{sjfje,jdbcType=DECIMAL},
            </if>
            <if test="sjgjqtsl != null">
                SJGJQTSL = #{sjgjqtsl,jdbcType=DECIMAL},
            </if>
            <if test="sjgjqtje != null">
                SJGJQTJE = #{sjgjqtje,jdbcType=DECIMAL},
            </if>
            <if test="jkzzxsj != null">
                JKZZXSJ = #{jkzzxsj,jdbcType=DECIMAL},
            </if>
            <if test="jkzzxje != null">
                JKZZXJE = #{jkzzxje,jdbcType=DECIMAL},
            </if>
        </set>
        where JH = #{jh,jdbcType=VARCHAR}
        and WGRQ = #{wgrq,jdbcType=TIMESTAMP}
    </update>
    <update id="updateByPrimaryKey" parameterType="cn.com.victorysoft.business.technology.entity.TechJobFee">
    update TECH_JOB_FEE
    set DW = #{dw,jdbcType=VARCHAR},
      JB = #{jb,jdbcType=VARCHAR},
      YQT = #{yqt,jdbcType=VARCHAR},
      DY = #{dy,jdbcType=VARCHAR},
      SGDW = #{sgdw,jdbcType=VARCHAR},
      SGLB = #{sglb,jdbcType=VARCHAR},
      SGMD = #{sgmd,jdbcType=VARCHAR},
      XJLJ = #{xjlj,jdbcType=VARCHAR},
      KGRQ = #{kgrq,jdbcType=TIMESTAMP},
      YSYF = #{ysyf,jdbcType=VARCHAR},
      FYHJ = #{fyhj,jdbcType=DECIMAL},
      LWXJ = #{lwxj,jdbcType=DECIMAL},
      CLXJ = #{clxj,jdbcType=DECIMAL},
      TGXSJ = #{tgxsj,jdbcType=DECIMAL},
      TGXJE = #{tgxje,jdbcType=DECIMAL},
      TGJSL = #{tgjsl,jdbcType=DECIMAL},
      TGJJE = #{tgjje,jdbcType=DECIMAL},
      SJGXSL = #{sjgxsl,jdbcType=DECIMAL},
      SJGXJE = #{sjgxje,jdbcType=DECIMAL},
      SJGJSL = #{sjgjsl,jdbcType=DECIMAL},
      SJGJJE = #{sjgjje,jdbcType=DECIMAL},
      FSLSL = #{fslsl,jdbcType=DECIMAL},
      FSLJE = #{fslje,jdbcType=DECIMAL},
      HGLHJJE = #{hglhjje,jdbcType=DECIMAL},
      SJFSL = #{sjfsl,jdbcType=DECIMAL},
      SJFJE = #{sjfje,jdbcType=DECIMAL},
      SJGJQTSL = #{sjgjqtsl,jdbcType=DECIMAL},
      SJGJQTJE = #{sjgjqtje,jdbcType=DECIMAL},
      JKZZXSJ = #{jkzzxsj,jdbcType=DECIMAL},
      JKZZXJE = #{jkzzxje,jdbcType=DECIMAL}
    where JH = #{jh,jdbcType=VARCHAR}
      and WGRQ = #{wgrq,jdbcType=TIMESTAMP}
  </update>
</mapper>