KqglAssoDkmxMapper.xml 4.79 KB
Newer Older
ilal committed
1 2 3 4 5 6 7 8 9 10 11
<?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.timer.api.dao.kqmk.KqglAssoDkmxMapper">

    <resultMap id="BaseResultMap" type="cn.timer.api.bean.kqmk.KqglAssoDkmx" >
                <id column="id" property="id" />
                <result column="userid" property="userid" />
                <result column="data" property="data" />
                <result column="sbdk1" property="sbdk1" />
                <result column="sbdk1jg" property="sbdk1jg" />
ilal committed
12
                <result column="dkst1" property="dkst1" />
lal committed
13
                <result column="dktj1" property="dktj1" />
ilal committed
14
                
ilal committed
15 16
                <result column="xbdk1" property="xbdk1" />
                <result column="xbdk1jg" property="xbdk1jg" />
lal committed
17 18
                <result column="dktj2" property="dktj2" />
                
ilal committed
19 20
                <result column="sbdk2" property="sbdk2" />
                <result column="sbdk2jg" property="sbdk2jg" />
ilal committed
21
                <result column="dkst2" property="dkst2" />
lal committed
22 23
                <result column="dktj3" property="dktj3" />
                
ilal committed
24 25
                <result column="xbdk2" property="xbdk2" />
                <result column="xbdk2jg" property="xbdk2jg" />
lal committed
26 27
                <result column="dktj4" property="dktj4" />
                
ilal committed
28 29
                <result column="sbdk3" property="sbdk3" />
                <result column="sbdk3jg" property="sbdk3jg" />
ilal committed
30
                <result column="dkst3" property="dkst3" />
lal committed
31 32
                <result column="dktj5" property="dktj5" />
                
ilal committed
33 34
                <result column="xbdk3" property="xbdk3" />
                <result column="xbdk3jg" property="xbdk3jg" />
lal committed
35 36
                <result column="dktj6" property="dktj6" />
                
ilal committed
37 38 39 40
                <result column="ydkcs" property="ydkcs" />
                <result column="gzsc" property="gzsc" />
                <result column="qyid" property="qyid" />
                <result column="dksj" property="dksj" />
lal committed
41 42 43
                <result column="yzcdcs" property="yzcdcs" />
                <result column="yzcdsc" property="yzcdsc" />
                <result column="kgcdfzs" property="kgcdfzs" />
ilal committed
44
    </resultMap>
lal committed
45 46 47 48 49 50 51
    
    <resultMap id="AttSubsidiary" type="cn.timer.api.dto.kqmk.AttSubsidiaryDto" >
                <result column="gzsctotalgzsc" property="gzsctotalgzsc" />
                <result column="yzcdcstotal" property="yzcdcstotal" />
                <result column="yzcdsctotal" property="yzcdsctotal" />
                <result column="kgcdfzstotal" property="kgcdfzstotal" />
    </resultMap>
ilal committed
52 53


lal committed
54 55 56 57 58 59 60 61
	<select id="subsidiary" resultMap="AttSubsidiary">
		select  SUM(dk.gzsc) as gzsctotalgzsc,
			SUM(dk.yzcdcs) as yzcdcstotal,
			SUM(dk.yzcdsc) as yzcdsctotal,
			SUM(dk.kgcdfzs) as kgcdfzstotal
				from kqgl_asso_dkmx dk 
		where dk.userid = #{userid}
		and SUBSTR(dk.`data`,1,7) = #{data} 
leialin committed
62
		and dk.qyid = #{qyid}
lal committed
63 64
		GROUP BY dk.userid
	</select>
lal committed
65 66 67 68 69 70 71 72
	
	<update id="updateByPrimaryKeySelective" parameterType="cn.timer.api.bean.kqmk.KqglAssoDkmx">
        UPDATE kqgl_asso_dkmx
        <set>
                    <if test ='null != userid'>userid = #{userid},</if>
                    <if test ='null != data'>data = #{data},</if>
                    <if test ='null != sbdk1'>sbdk1 = #{sbdk1},</if>
                    <if test ='null != sbdk1jg'>sbdk1jg = #{sbdk1jg},</if>
ilal committed
73
                    <if test ='null != dkst1'>dkst1 = #{dkst1},</if>
lal committed
74 75 76 77
                    <if test ='null != xbdk1'>xbdk1 = #{xbdk1},</if>
                    <if test ='null != xbdk1jg'>xbdk1jg = #{xbdk1jg},</if>
                    <if test ='null != sbdk2'>sbdk2 = #{sbdk2},</if>
                    <if test ='null != sbdk2jg'>sbdk2jg = #{sbdk2jg},</if>
ilal committed
78
                    <if test ='null != dkst2'>dkst2 = #{dkst2},</if>
lal committed
79 80 81 82
                    <if test ='null != xbdk2'>xbdk2 = #{xbdk2},</if>
                    <if test ='null != xbdk2jg'>xbdk2jg = #{xbdk2jg},</if>
                    <if test ='null != sbdk3'>sbdk3 = #{sbdk3},</if>
                    <if test ='null != sbdk3jg'>sbdk3jg = #{sbdk3jg},</if>
ilal committed
83
                    <if test ='null != dkst3'>dkst3 = #{dkst3},</if>
lal committed
84 85 86 87 88 89 90 91 92 93 94 95
                    <if test ='null != xbdk3'>xbdk3 = #{xbdk3},</if>
                    <if test ='null != xbdk3jg'>xbdk3jg = #{xbdk3jg},</if>
                    <if test ='null != ydkcs'>ydkcs = #{ydkcs},</if>
                    <if test ='null != gzsc'>gzsc = #{gzsc},</if>
                    <if test ='null != qyid'>qyid = #{qyid},</if>
                    <if test ='null != dksj'>dksj = #{dksj},</if>
                    <if test ='null != yzcdcs'>yzcdcs = #{yzcdcs},</if>
                    <if test ='null != yzcdsc'>yzcdsc = #{yzcdsc},</if>
                    <if test ='null != kgcdfzs'>kgcdfzs = #{kgcdfzs}</if>
        </set>
        WHERE id = #{id}
    </update>
lal committed
96

ilal committed
97 98

</mapper>