<?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" /> <result column="dkst1" property="dkst1" /> <result column="dktj1" property="dktj1" /> <result column="xbdk1" property="xbdk1" /> <result column="xbdk1jg" property="xbdk1jg" /> <result column="dktj2" property="dktj2" /> <result column="sbdk2" property="sbdk2" /> <result column="sbdk2jg" property="sbdk2jg" /> <result column="dkst2" property="dkst2" /> <result column="dktj3" property="dktj3" /> <result column="xbdk2" property="xbdk2" /> <result column="xbdk2jg" property="xbdk2jg" /> <result column="dktj4" property="dktj4" /> <result column="sbdk3" property="sbdk3" /> <result column="sbdk3jg" property="sbdk3jg" /> <result column="dkst3" property="dkst3" /> <result column="dktj5" property="dktj5" /> <result column="xbdk3" property="xbdk3" /> <result column="xbdk3jg" property="xbdk3jg" /> <result column="dktj6" property="dktj6" /> <result column="ydkcs" property="ydkcs" /> <result column="gzsc" property="gzsc" /> <result column="qyid" property="qyid" /> <result column="dksj" property="dksj" /> <result column="yzcdcs" property="yzcdcs" /> <result column="yzcdsc" property="yzcdsc" /> <result column="kgcdfzs" property="kgcdfzs" /> </resultMap> <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> <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} and dk.qyid = #{qyid} GROUP BY dk.userid </select> <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> <if test ='null != dkst1'>dkst1 = #{dkst1},</if> <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> <if test ='null != dkst2'>dkst2 = #{dkst2},</if> <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> <if test ='null != dkst3'>dkst3 = #{dkst3},</if> <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> </mapper>