<?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.dy.pipIrrGlobal.daoSt.StRechargeClientMonthMapper">
|
<resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSt.StRechargeClientMonth">
|
<!--@mbg.generated-->
|
<!--@Table st_recharge_client_month-->
|
<id column="id" jdbcType="BIGINT" property="id" />
|
<result column="client_id" jdbcType="BIGINT" property="clientId" />
|
<result column="year" jdbcType="INTEGER" property="year" />
|
<result column="amount1" jdbcType="FLOAT" property="amount1" />
|
<result column="gift1" jdbcType="FLOAT" property="gift1" />
|
<result column="times1" jdbcType="INTEGER" property="times1" />
|
<result column="amount2" jdbcType="FLOAT" property="amount2" />
|
<result column="gift2" jdbcType="FLOAT" property="gift2" />
|
<result column="times2" jdbcType="INTEGER" property="times2" />
|
<result column="amount3" jdbcType="FLOAT" property="amount3" />
|
<result column="gift3" jdbcType="FLOAT" property="gift3" />
|
<result column="times3" jdbcType="INTEGER" property="times3" />
|
<result column="amount4" jdbcType="FLOAT" property="amount4" />
|
<result column="gift4" jdbcType="FLOAT" property="gift4" />
|
<result column="times4" jdbcType="INTEGER" property="times4" />
|
<result column="amount5" jdbcType="FLOAT" property="amount5" />
|
<result column="gift5" jdbcType="FLOAT" property="gift5" />
|
<result column="times5" jdbcType="INTEGER" property="times5" />
|
<result column="amount6" jdbcType="FLOAT" property="amount6" />
|
<result column="gift6" jdbcType="FLOAT" property="gift6" />
|
<result column="times6" jdbcType="INTEGER" property="times6" />
|
<result column="amount7" jdbcType="FLOAT" property="amount7" />
|
<result column="gift7" jdbcType="FLOAT" property="gift7" />
|
<result column="times7" jdbcType="INTEGER" property="times7" />
|
<result column="amount8" jdbcType="FLOAT" property="amount8" />
|
<result column="gift8" jdbcType="FLOAT" property="gift8" />
|
<result column="times8" jdbcType="INTEGER" property="times8" />
|
<result column="amount9" jdbcType="FLOAT" property="amount9" />
|
<result column="gift9" jdbcType="FLOAT" property="gift9" />
|
<result column="times9" jdbcType="INTEGER" property="times9" />
|
<result column="amount10" jdbcType="FLOAT" property="amount10" />
|
<result column="gift10" jdbcType="FLOAT" property="gift10" />
|
<result column="times10" jdbcType="INTEGER" property="times10" />
|
<result column="amount11" jdbcType="FLOAT" property="amount11" />
|
<result column="gift11" jdbcType="FLOAT" property="gift11" />
|
<result column="times11" jdbcType="INTEGER" property="times11" />
|
<result column="amount12" jdbcType="FLOAT" property="amount12" />
|
<result column="gift12" jdbcType="FLOAT" property="gift12" />
|
<result column="times12" jdbcType="INTEGER" property="times12" />
|
</resultMap>
|
<sql id="Base_Column_List">
|
<!--@mbg.generated-->
|
id, client_id, `year`, amount1, gift1, times1, amount2, gift2, times2, amount3, gift3,
|
times3, amount4, gift4, times4, amount5, gift5, times5, amount6, gift6, times6, amount7,
|
gift7, times7, amount8, gift8, times8, amount9, gift9, times9, amount10, gift10,
|
times10, amount11, gift11, times11, amount12, gift12, times12
|
</sql>
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
<!--@mbg.generated-->
|
select
|
<include refid="Base_Column_List" />
|
from st_recharge_client_month
|
where id = #{id,jdbcType=BIGINT}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
<!--@mbg.generated-->
|
delete from st_recharge_client_month
|
where id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSt.StRechargeClientMonth">
|
<!--@mbg.generated-->
|
insert into st_recharge_client_month (id, client_id, `year`,
|
amount1, gift1, times1,
|
amount2, gift2, times2,
|
amount3, gift3, times3,
|
amount4, gift4, times4,
|
amount5, gift5, times5,
|
amount6, gift6, times6,
|
amount7, gift7, times7,
|
amount8, gift8, times8,
|
amount9, gift9, times9,
|
amount10, gift10, times10,
|
amount11, gift11, times11,
|
amount12, gift12, times12
|
)
|
values (#{id,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, #{year,jdbcType=INTEGER},
|
#{amount1,jdbcType=FLOAT}, #{gift1,jdbcType=FLOAT}, #{times1,jdbcType=INTEGER},
|
#{amount2,jdbcType=FLOAT}, #{gift2,jdbcType=FLOAT}, #{times2,jdbcType=INTEGER},
|
#{amount3,jdbcType=FLOAT}, #{gift3,jdbcType=FLOAT}, #{times3,jdbcType=INTEGER},
|
#{amount4,jdbcType=FLOAT}, #{gift4,jdbcType=FLOAT}, #{times4,jdbcType=INTEGER},
|
#{amount5,jdbcType=FLOAT}, #{gift5,jdbcType=FLOAT}, #{times5,jdbcType=INTEGER},
|
#{amount6,jdbcType=FLOAT}, #{gift6,jdbcType=FLOAT}, #{times6,jdbcType=INTEGER},
|
#{amount7,jdbcType=FLOAT}, #{gift7,jdbcType=FLOAT}, #{times7,jdbcType=INTEGER},
|
#{amount8,jdbcType=FLOAT}, #{gift8,jdbcType=FLOAT}, #{times8,jdbcType=INTEGER},
|
#{amount9,jdbcType=FLOAT}, #{gift9,jdbcType=FLOAT}, #{times9,jdbcType=INTEGER},
|
#{amount10,jdbcType=FLOAT}, #{gift10,jdbcType=FLOAT}, #{times10,jdbcType=INTEGER},
|
#{amount11,jdbcType=FLOAT}, #{gift11,jdbcType=FLOAT}, #{times11,jdbcType=INTEGER},
|
#{amount12,jdbcType=FLOAT}, #{gift12,jdbcType=FLOAT}, #{times12,jdbcType=INTEGER}
|
)
|
</insert>
|
<insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StRechargeClientMonth">
|
<!--@mbg.generated-->
|
insert into st_recharge_client_month
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
id,
|
</if>
|
<if test="clientId != null">
|
client_id,
|
</if>
|
<if test="year != null">
|
`year`,
|
</if>
|
<if test="amount1 != null">
|
amount1,
|
</if>
|
<if test="gift1 != null">
|
gift1,
|
</if>
|
<if test="times1 != null">
|
times1,
|
</if>
|
<if test="amount2 != null">
|
amount2,
|
</if>
|
<if test="gift2 != null">
|
gift2,
|
</if>
|
<if test="times2 != null">
|
times2,
|
</if>
|
<if test="amount3 != null">
|
amount3,
|
</if>
|
<if test="gift3 != null">
|
gift3,
|
</if>
|
<if test="times3 != null">
|
times3,
|
</if>
|
<if test="amount4 != null">
|
amount4,
|
</if>
|
<if test="gift4 != null">
|
gift4,
|
</if>
|
<if test="times4 != null">
|
times4,
|
</if>
|
<if test="amount5 != null">
|
amount5,
|
</if>
|
<if test="gift5 != null">
|
gift5,
|
</if>
|
<if test="times5 != null">
|
times5,
|
</if>
|
<if test="amount6 != null">
|
amount6,
|
</if>
|
<if test="gift6 != null">
|
gift6,
|
</if>
|
<if test="times6 != null">
|
times6,
|
</if>
|
<if test="amount7 != null">
|
amount7,
|
</if>
|
<if test="gift7 != null">
|
gift7,
|
</if>
|
<if test="times7 != null">
|
times7,
|
</if>
|
<if test="amount8 != null">
|
amount8,
|
</if>
|
<if test="gift8 != null">
|
gift8,
|
</if>
|
<if test="times8 != null">
|
times8,
|
</if>
|
<if test="amount9 != null">
|
amount9,
|
</if>
|
<if test="gift9 != null">
|
gift9,
|
</if>
|
<if test="times9 != null">
|
times9,
|
</if>
|
<if test="amount10 != null">
|
amount10,
|
</if>
|
<if test="gift10 != null">
|
gift10,
|
</if>
|
<if test="times10 != null">
|
times10,
|
</if>
|
<if test="amount11 != null">
|
amount11,
|
</if>
|
<if test="gift11 != null">
|
gift11,
|
</if>
|
<if test="times11 != null">
|
times11,
|
</if>
|
<if test="amount12 != null">
|
amount12,
|
</if>
|
<if test="gift12 != null">
|
gift12,
|
</if>
|
<if test="times12 != null">
|
times12,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">
|
#{id,jdbcType=BIGINT},
|
</if>
|
<if test="clientId != null">
|
#{clientId,jdbcType=BIGINT},
|
</if>
|
<if test="year != null">
|
#{year,jdbcType=INTEGER},
|
</if>
|
<if test="amount1 != null">
|
#{amount1,jdbcType=FLOAT},
|
</if>
|
<if test="gift1 != null">
|
#{gift1,jdbcType=FLOAT},
|
</if>
|
<if test="times1 != null">
|
#{times1,jdbcType=INTEGER},
|
</if>
|
<if test="amount2 != null">
|
#{amount2,jdbcType=FLOAT},
|
</if>
|
<if test="gift2 != null">
|
#{gift2,jdbcType=FLOAT},
|
</if>
|
<if test="times2 != null">
|
#{times2,jdbcType=INTEGER},
|
</if>
|
<if test="amount3 != null">
|
#{amount3,jdbcType=FLOAT},
|
</if>
|
<if test="gift3 != null">
|
#{gift3,jdbcType=FLOAT},
|
</if>
|
<if test="times3 != null">
|
#{times3,jdbcType=INTEGER},
|
</if>
|
<if test="amount4 != null">
|
#{amount4,jdbcType=FLOAT},
|
</if>
|
<if test="gift4 != null">
|
#{gift4,jdbcType=FLOAT},
|
</if>
|
<if test="times4 != null">
|
#{times4,jdbcType=INTEGER},
|
</if>
|
<if test="amount5 != null">
|
#{amount5,jdbcType=FLOAT},
|
</if>
|
<if test="gift5 != null">
|
#{gift5,jdbcType=FLOAT},
|
</if>
|
<if test="times5 != null">
|
#{times5,jdbcType=INTEGER},
|
</if>
|
<if test="amount6 != null">
|
#{amount6,jdbcType=FLOAT},
|
</if>
|
<if test="gift6 != null">
|
#{gift6,jdbcType=FLOAT},
|
</if>
|
<if test="times6 != null">
|
#{times6,jdbcType=INTEGER},
|
</if>
|
<if test="amount7 != null">
|
#{amount7,jdbcType=FLOAT},
|
</if>
|
<if test="gift7 != null">
|
#{gift7,jdbcType=FLOAT},
|
</if>
|
<if test="times7 != null">
|
#{times7,jdbcType=INTEGER},
|
</if>
|
<if test="amount8 != null">
|
#{amount8,jdbcType=FLOAT},
|
</if>
|
<if test="gift8 != null">
|
#{gift8,jdbcType=FLOAT},
|
</if>
|
<if test="times8 != null">
|
#{times8,jdbcType=INTEGER},
|
</if>
|
<if test="amount9 != null">
|
#{amount9,jdbcType=FLOAT},
|
</if>
|
<if test="gift9 != null">
|
#{gift9,jdbcType=FLOAT},
|
</if>
|
<if test="times9 != null">
|
#{times9,jdbcType=INTEGER},
|
</if>
|
<if test="amount10 != null">
|
#{amount10,jdbcType=FLOAT},
|
</if>
|
<if test="gift10 != null">
|
#{gift10,jdbcType=FLOAT},
|
</if>
|
<if test="times10 != null">
|
#{times10,jdbcType=INTEGER},
|
</if>
|
<if test="amount11 != null">
|
#{amount11,jdbcType=FLOAT},
|
</if>
|
<if test="gift11 != null">
|
#{gift11,jdbcType=FLOAT},
|
</if>
|
<if test="times11 != null">
|
#{times11,jdbcType=INTEGER},
|
</if>
|
<if test="amount12 != null">
|
#{amount12,jdbcType=FLOAT},
|
</if>
|
<if test="gift12 != null">
|
#{gift12,jdbcType=FLOAT},
|
</if>
|
<if test="times12 != null">
|
#{times12,jdbcType=INTEGER},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSt.StRechargeClientMonth">
|
<!--@mbg.generated-->
|
update st_recharge_client_month
|
<set>
|
<if test="clientId != null">
|
client_id = #{clientId,jdbcType=BIGINT},
|
</if>
|
<if test="year != null">
|
`year` = #{year,jdbcType=INTEGER},
|
</if>
|
<if test="amount1 != null">
|
amount1 = #{amount1,jdbcType=FLOAT},
|
</if>
|
<if test="gift1 != null">
|
gift1 = #{gift1,jdbcType=FLOAT},
|
</if>
|
<if test="times1 != null">
|
times1 = #{times1,jdbcType=INTEGER},
|
</if>
|
<if test="amount2 != null">
|
amount2 = #{amount2,jdbcType=FLOAT},
|
</if>
|
<if test="gift2 != null">
|
gift2 = #{gift2,jdbcType=FLOAT},
|
</if>
|
<if test="times2 != null">
|
times2 = #{times2,jdbcType=INTEGER},
|
</if>
|
<if test="amount3 != null">
|
amount3 = #{amount3,jdbcType=FLOAT},
|
</if>
|
<if test="gift3 != null">
|
gift3 = #{gift3,jdbcType=FLOAT},
|
</if>
|
<if test="times3 != null">
|
times3 = #{times3,jdbcType=INTEGER},
|
</if>
|
<if test="amount4 != null">
|
amount4 = #{amount4,jdbcType=FLOAT},
|
</if>
|
<if test="gift4 != null">
|
gift4 = #{gift4,jdbcType=FLOAT},
|
</if>
|
<if test="times4 != null">
|
times4 = #{times4,jdbcType=INTEGER},
|
</if>
|
<if test="amount5 != null">
|
amount5 = #{amount5,jdbcType=FLOAT},
|
</if>
|
<if test="gift5 != null">
|
gift5 = #{gift5,jdbcType=FLOAT},
|
</if>
|
<if test="times5 != null">
|
times5 = #{times5,jdbcType=INTEGER},
|
</if>
|
<if test="amount6 != null">
|
amount6 = #{amount6,jdbcType=FLOAT},
|
</if>
|
<if test="gift6 != null">
|
gift6 = #{gift6,jdbcType=FLOAT},
|
</if>
|
<if test="times6 != null">
|
times6 = #{times6,jdbcType=INTEGER},
|
</if>
|
<if test="amount7 != null">
|
amount7 = #{amount7,jdbcType=FLOAT},
|
</if>
|
<if test="gift7 != null">
|
gift7 = #{gift7,jdbcType=FLOAT},
|
</if>
|
<if test="times7 != null">
|
times7 = #{times7,jdbcType=INTEGER},
|
</if>
|
<if test="amount8 != null">
|
amount8 = #{amount8,jdbcType=FLOAT},
|
</if>
|
<if test="gift8 != null">
|
gift8 = #{gift8,jdbcType=FLOAT},
|
</if>
|
<if test="times8 != null">
|
times8 = #{times8,jdbcType=INTEGER},
|
</if>
|
<if test="amount9 != null">
|
amount9 = #{amount9,jdbcType=FLOAT},
|
</if>
|
<if test="gift9 != null">
|
gift9 = #{gift9,jdbcType=FLOAT},
|
</if>
|
<if test="times9 != null">
|
times9 = #{times9,jdbcType=INTEGER},
|
</if>
|
<if test="amount10 != null">
|
amount10 = #{amount10,jdbcType=FLOAT},
|
</if>
|
<if test="gift10 != null">
|
gift10 = #{gift10,jdbcType=FLOAT},
|
</if>
|
<if test="times10 != null">
|
times10 = #{times10,jdbcType=INTEGER},
|
</if>
|
<if test="amount11 != null">
|
amount11 = #{amount11,jdbcType=FLOAT},
|
</if>
|
<if test="gift11 != null">
|
gift11 = #{gift11,jdbcType=FLOAT},
|
</if>
|
<if test="times11 != null">
|
times11 = #{times11,jdbcType=INTEGER},
|
</if>
|
<if test="amount12 != null">
|
amount12 = #{amount12,jdbcType=FLOAT},
|
</if>
|
<if test="gift12 != null">
|
gift12 = #{gift12,jdbcType=FLOAT},
|
</if>
|
<if test="times12 != null">
|
times12 = #{times12,jdbcType=INTEGER},
|
</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSt.StRechargeClientMonth">
|
<!--@mbg.generated-->
|
update st_recharge_client_month
|
set client_id = #{clientId,jdbcType=BIGINT},
|
`year` = #{year,jdbcType=INTEGER},
|
amount1 = #{amount1,jdbcType=FLOAT},
|
gift1 = #{gift1,jdbcType=FLOAT},
|
times1 = #{times1,jdbcType=INTEGER},
|
amount2 = #{amount2,jdbcType=FLOAT},
|
gift2 = #{gift2,jdbcType=FLOAT},
|
times2 = #{times2,jdbcType=INTEGER},
|
amount3 = #{amount3,jdbcType=FLOAT},
|
gift3 = #{gift3,jdbcType=FLOAT},
|
times3 = #{times3,jdbcType=INTEGER},
|
amount4 = #{amount4,jdbcType=FLOAT},
|
gift4 = #{gift4,jdbcType=FLOAT},
|
times4 = #{times4,jdbcType=INTEGER},
|
amount5 = #{amount5,jdbcType=FLOAT},
|
gift5 = #{gift5,jdbcType=FLOAT},
|
times5 = #{times5,jdbcType=INTEGER},
|
amount6 = #{amount6,jdbcType=FLOAT},
|
gift6 = #{gift6,jdbcType=FLOAT},
|
times6 = #{times6,jdbcType=INTEGER},
|
amount7 = #{amount7,jdbcType=FLOAT},
|
gift7 = #{gift7,jdbcType=FLOAT},
|
times7 = #{times7,jdbcType=INTEGER},
|
amount8 = #{amount8,jdbcType=FLOAT},
|
gift8 = #{gift8,jdbcType=FLOAT},
|
times8 = #{times8,jdbcType=INTEGER},
|
amount9 = #{amount9,jdbcType=FLOAT},
|
gift9 = #{gift9,jdbcType=FLOAT},
|
times9 = #{times9,jdbcType=INTEGER},
|
amount10 = #{amount10,jdbcType=FLOAT},
|
gift10 = #{gift10,jdbcType=FLOAT},
|
times10 = #{times10,jdbcType=INTEGER},
|
amount11 = #{amount11,jdbcType=FLOAT},
|
gift11 = #{gift11,jdbcType=FLOAT},
|
times11 = #{times11,jdbcType=INTEGER},
|
amount12 = #{amount12,jdbcType=FLOAT},
|
gift12 = #{gift12,jdbcType=FLOAT},
|
times12 = #{times12,jdbcType=INTEGER}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
|
|
|
<!-- //////////////////////////////////// -->
|
<!-- //统计相关 // -->
|
<!-- //////////////////////////////////// -->
|
<select id="statisticsByClient" resultType="com.dy.pipIrrGlobal.voSt.VoClientRechargeStatistics">
|
select client_id as clientId,
|
sum(
|
IFNULL(amount1,0) + IFNULL(amount2,0) + IFNULL(amount3,0) + IFNULL(amount4,0) + IFNULL(amount5,0) + IFNULL(amount6,0) + IFNULL(amount7,0) + IFNULL(amount8,0) + IFNULL(amount9,0) +
|
IFNULL(amount10,0) + IFNULL(amount11,0) + IFNULL(amount12,0)
|
) as amount,
|
sum(
|
IFNULL(gift1,0) + IFNULL(gift2,0) + IFNULL(gift3,0) + IFNULL(gift4,0) + IFNULL(gift5,0) + IFNULL(gift6,0) + IFNULL(gift7,0) + IFNULL(gift8,0) + IFNULL(gift9,0) +
|
IFNULL(gift10,0) + IFNULL(gift11,0) + IFNULL(gift12,0)
|
) as gift,
|
sum(
|
IFNULL(times1,0) + IFNULL(times2,0) + IFNULL(times3,0) + IFNULL(times4,0) + IFNULL(times5,0) + IFNULL(times6,0) + IFNULL(times7,0) + IFNULL(times8,0) + IFNULL(times9,0) +
|
IFNULL(times10,0) + IFNULL(times11,0) + IFNULL(times12,0)
|
) as times
|
from st_recharge_client_month
|
where year = #{year, jdbcType=INTEGER}
|
group by client_id
|
</select>
|
|
<select id="selectByClientAndYear" resultType="com.dy.pipIrrGlobal.pojoSt.StRechargeClientMonth">
|
select
|
<include refid="Base_Column_List" />
|
from st_recharge_client_month
|
where client_id = #{clientId,jdbcType=BIGINT}
|
and year = #{year,jdbcType=INTEGER}
|
</select>
|
|
</mapper>
|