|
@@ -1,115 +1,119 @@
|
|
|
<?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.hcloud.microserver.h5.dao.CustomerCarbonValMapper" >
|
|
|
- <resultMap id="BaseResultMap" type="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonVal" >
|
|
|
- <id column="guid" property="guid" jdbcType="CHAR" />
|
|
|
- <result column="t_customer_id" property="tCustomerId" jdbcType="CHAR" />
|
|
|
- <result column="t_customer_name" property="tCustomerName" jdbcType="VARCHAR" />
|
|
|
- <result column="carbon_val" property="carbonVal" jdbcType="DECIMAL" />
|
|
|
- <result column="status" property="status" jdbcType="INTEGER" />
|
|
|
- <result column="type" property="type" jdbcType="INTEGER" />
|
|
|
- <result column="tb_guid" property="tbGuid" jdbcType="CHAR" />
|
|
|
- <result column="tb_name" property="tbName" jdbcType="CHAR" />
|
|
|
- <result column="remarks" property="remarks" jdbcType="CHAR" />
|
|
|
- <result column="year_time" property="yearTime" jdbcType="INTEGER" />
|
|
|
- <result column="create_user" property="createUser" jdbcType="CHAR" />
|
|
|
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
- <result column="update_user" property="updateUser" jdbcType="CHAR" />
|
|
|
- <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Example_Where_Clause" >
|
|
|
- <where >
|
|
|
- <foreach collection="oredCriteria" item="criteria" separator="or" >
|
|
|
- <if test="criteria.valid" >
|
|
|
- <trim prefix="(" suffix=")" prefixOverrides="and" >
|
|
|
- <foreach collection="criteria.criteria" item="criterion" >
|
|
|
- <choose >
|
|
|
- <when test="criterion.noValue" >
|
|
|
- and ${criterion.condition}
|
|
|
- </when>
|
|
|
- <when test="criterion.singleValue" >
|
|
|
- and ${criterion.condition} #{criterion.value}
|
|
|
- </when>
|
|
|
- <when test="criterion.betweenValue" >
|
|
|
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
- </when>
|
|
|
- <when test="criterion.listValue" >
|
|
|
- and ${criterion.condition}
|
|
|
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
|
|
- #{listItem}
|
|
|
- </foreach>
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
+<mapper namespace="com.hcloud.microserver.h5.dao.CustomerCarbonValMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonVal">
|
|
|
+ <id column="guid" property="guid" jdbcType="CHAR"/>
|
|
|
+ <result column="t_customer_id" property="tCustomerId" jdbcType="CHAR"/>
|
|
|
+ <result column="t_customer_name" property="tCustomerName" jdbcType="VARCHAR"/>
|
|
|
+ <result column="carbon_val" property="carbonVal" jdbcType="DECIMAL"/>
|
|
|
+ <result column="status" property="status" jdbcType="INTEGER"/>
|
|
|
+ <result column="type" property="type" jdbcType="INTEGER"/>
|
|
|
+ <result column="tb_guid" property="tbGuid" jdbcType="CHAR"/>
|
|
|
+ <result column="tb_name" property="tbName" jdbcType="CHAR"/>
|
|
|
+ <result column="remarks" property="remarks" jdbcType="CHAR"/>
|
|
|
+ <result column="year_time" property="yearTime" jdbcType="INTEGER"/>
|
|
|
+ <result column="create_user" property="createUser" jdbcType="CHAR"/>
|
|
|
+ <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
|
|
+ <result column="update_user" property="updateUser" jdbcType="CHAR"/>
|
|
|
+ <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Example_Where_Clause">
|
|
|
+ <where>
|
|
|
+ <foreach collection="oredCriteria" item="criteria" separator="or">
|
|
|
+ <if test="criteria.valid">
|
|
|
+ <trim prefix="(" suffix=")" prefixOverrides="and">
|
|
|
+ <foreach collection="criteria.criteria" item="criterion">
|
|
|
+ <choose>
|
|
|
+ <when test="criterion.noValue">
|
|
|
+ and ${criterion.condition}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.singleValue">
|
|
|
+ and ${criterion.condition} #{criterion.value}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.betweenValue">
|
|
|
+ and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.listValue">
|
|
|
+ and ${criterion.condition}
|
|
|
+ <foreach collection="criterion.value" item="listItem" open="(" close=")"
|
|
|
+ separator=",">
|
|
|
+ #{listItem}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </foreach>
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
</foreach>
|
|
|
- </trim>
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
- <sql id="Update_By_Example_Where_Clause" >
|
|
|
- <where >
|
|
|
- <foreach collection="example.oredCriteria" item="criteria" separator="or" >
|
|
|
- <if test="criteria.valid" >
|
|
|
- <trim prefix="(" suffix=")" prefixOverrides="and" >
|
|
|
- <foreach collection="criteria.criteria" item="criterion" >
|
|
|
- <choose >
|
|
|
- <when test="criterion.noValue" >
|
|
|
- and ${criterion.condition}
|
|
|
- </when>
|
|
|
- <when test="criterion.singleValue" >
|
|
|
- and ${criterion.condition} #{criterion.value}
|
|
|
- </when>
|
|
|
- <when test="criterion.betweenValue" >
|
|
|
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
- </when>
|
|
|
- <when test="criterion.listValue" >
|
|
|
- and ${criterion.condition}
|
|
|
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
|
|
|
- #{listItem}
|
|
|
- </foreach>
|
|
|
- </when>
|
|
|
- </choose>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="Update_By_Example_Where_Clause">
|
|
|
+ <where>
|
|
|
+ <foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
|
+ <if test="criteria.valid">
|
|
|
+ <trim prefix="(" suffix=")" prefixOverrides="and">
|
|
|
+ <foreach collection="criteria.criteria" item="criterion">
|
|
|
+ <choose>
|
|
|
+ <when test="criterion.noValue">
|
|
|
+ and ${criterion.condition}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.singleValue">
|
|
|
+ and ${criterion.condition} #{criterion.value}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.betweenValue">
|
|
|
+ and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
|
+ </when>
|
|
|
+ <when test="criterion.listValue">
|
|
|
+ and ${criterion.condition}
|
|
|
+ <foreach collection="criterion.value" item="listItem" open="(" close=")"
|
|
|
+ separator=",">
|
|
|
+ #{listItem}
|
|
|
+ </foreach>
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </foreach>
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
</foreach>
|
|
|
- </trim>
|
|
|
- </if>
|
|
|
- </foreach>
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
- <sql id="Base_Column_List" >
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
guid, t_customer_id, t_customer_name, carbon_val, status, type, tb_guid, tb_name,
|
|
|
remarks, year_time, create_user, create_time, update_user, update_time
|
|
|
</sql>
|
|
|
- <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonValExample" >
|
|
|
- select
|
|
|
- <if test="distinct" >
|
|
|
- distinct
|
|
|
- </if>
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from t_customer_carbon_val
|
|
|
- <if test="_parameter != null" >
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- <if test="orderByClause != null" >
|
|
|
- order by ${orderByClause}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from t_customer_carbon_val
|
|
|
- where guid = #{guid,jdbcType=CHAR}
|
|
|
- </select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
|
|
+ <select id="selectByExample" resultMap="BaseResultMap"
|
|
|
+ parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonValExample">
|
|
|
+ select
|
|
|
+ <if test="distinct">
|
|
|
+ distinct
|
|
|
+ </if>
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from t_customer_carbon_val
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ <if test="orderByClause != null">
|
|
|
+ order by ${orderByClause}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from t_customer_carbon_val
|
|
|
+ where guid = #{guid,jdbcType=CHAR}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
delete from t_customer_carbon_val
|
|
|
where guid = #{guid,jdbcType=CHAR}
|
|
|
</delete>
|
|
|
- <delete id="deleteByExample" parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonValExample" >
|
|
|
- delete from t_customer_carbon_val
|
|
|
- <if test="_parameter != null" >
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </delete>
|
|
|
- <insert id="insert" parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonVal" >
|
|
|
+ <delete id="deleteByExample"
|
|
|
+ parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonValExample">
|
|
|
+ delete from t_customer_carbon_val
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonVal">
|
|
|
insert into t_customer_carbon_val (guid, t_customer_id, t_customer_name,
|
|
|
carbon_val, status, type,
|
|
|
tb_guid, tb_name, remarks, year_time,
|
|
@@ -121,219 +125,221 @@
|
|
|
#{createUser,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=CHAR},
|
|
|
#{updateTime,jdbcType=TIMESTAMP})
|
|
|
</insert>
|
|
|
- <insert id="insertSelective" parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonVal" >
|
|
|
- insert into t_customer_carbon_val
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
- <if test="guid != null" >
|
|
|
- guid,
|
|
|
- </if>
|
|
|
- <if test="tCustomerId != null" >
|
|
|
- t_customer_id,
|
|
|
- </if>
|
|
|
- <if test="tCustomerName != null" >
|
|
|
- t_customer_name,
|
|
|
- </if>
|
|
|
- <if test="carbonVal != null" >
|
|
|
- carbon_val,
|
|
|
- </if>
|
|
|
- <if test="status != null" >
|
|
|
- status,
|
|
|
- </if>
|
|
|
- <if test="type != null" >
|
|
|
- type,
|
|
|
- </if>
|
|
|
- <if test="tbGuid != null" >
|
|
|
- tb_guid,
|
|
|
- </if>
|
|
|
- <if test="tbName != null" >
|
|
|
- tb_name,
|
|
|
- </if>
|
|
|
- <if test="remarks != null" >
|
|
|
- remarks,
|
|
|
- </if>
|
|
|
- <if test="yearTime != null" >
|
|
|
- year_time,
|
|
|
- </if>
|
|
|
- <if test="createUser != null" >
|
|
|
- create_user,
|
|
|
- </if>
|
|
|
- <if test="createTime != null" >
|
|
|
- create_time,
|
|
|
- </if>
|
|
|
- <if test="updateUser != null" >
|
|
|
- update_user,
|
|
|
- </if>
|
|
|
- <if test="updateTime != null" >
|
|
|
- update_time,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
- <if test="guid != null" >
|
|
|
- #{guid,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="tCustomerId != null" >
|
|
|
- #{tCustomerId,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="tCustomerName != null" >
|
|
|
- #{tCustomerName,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="carbonVal != null" >
|
|
|
- #{carbonVal,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="status != null" >
|
|
|
- #{status,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="type != null" >
|
|
|
- #{type,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="tbGuid != null" >
|
|
|
- #{tbGuid,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="tbName != null" >
|
|
|
- #{tbName,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="remarks != null" >
|
|
|
- #{remarks,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="yearTime != null" >
|
|
|
- #{yearTime,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="createUser != null" >
|
|
|
- #{createUser,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="createTime != null" >
|
|
|
- #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="updateUser != null" >
|
|
|
- #{updateUser,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null" >
|
|
|
- #{updateTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
- <select id="countByExample" parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonValExample" resultType="java.lang.Integer" >
|
|
|
- select count(*) from t_customer_carbon_val
|
|
|
- <if test="_parameter != null" >
|
|
|
- <include refid="Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <update id="updateByExampleSelective" parameterType="map" >
|
|
|
- update t_customer_carbon_val
|
|
|
- <set >
|
|
|
- <if test="record.guid != null" >
|
|
|
- guid = #{record.guid,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="record.tCustomerId != null" >
|
|
|
+ <insert id="insertSelective" parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonVal">
|
|
|
+ insert into t_customer_carbon_val
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="guid != null">
|
|
|
+ guid,
|
|
|
+ </if>
|
|
|
+ <if test="tCustomerId != null">
|
|
|
+ t_customer_id,
|
|
|
+ </if>
|
|
|
+ <if test="tCustomerName != null">
|
|
|
+ t_customer_name,
|
|
|
+ </if>
|
|
|
+ <if test="carbonVal != null">
|
|
|
+ carbon_val,
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ status,
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type,
|
|
|
+ </if>
|
|
|
+ <if test="tbGuid != null">
|
|
|
+ tb_guid,
|
|
|
+ </if>
|
|
|
+ <if test="tbName != null">
|
|
|
+ tb_name,
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null">
|
|
|
+ remarks,
|
|
|
+ </if>
|
|
|
+ <if test="yearTime != null">
|
|
|
+ year_time,
|
|
|
+ </if>
|
|
|
+ <if test="createUser != null">
|
|
|
+ create_user,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="updateUser != null">
|
|
|
+ update_user,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="guid != null">
|
|
|
+ #{guid,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="tCustomerId != null">
|
|
|
+ #{tCustomerId,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="tCustomerName != null">
|
|
|
+ #{tCustomerName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="carbonVal != null">
|
|
|
+ #{carbonVal,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="tbGuid != null">
|
|
|
+ #{tbGuid,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="tbName != null">
|
|
|
+ #{tbName,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null">
|
|
|
+ #{remarks,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="yearTime != null">
|
|
|
+ #{yearTime,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createUser != null">
|
|
|
+ #{createUser,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updateUser != null">
|
|
|
+ #{updateUser,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <select id="countByExample" parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonValExample"
|
|
|
+ resultType="java.lang.Integer">
|
|
|
+ select count(*) from t_customer_carbon_val
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <update id="updateByExampleSelective" parameterType="map">
|
|
|
+ update t_customer_carbon_val
|
|
|
+ <set>
|
|
|
+ <if test="record.guid != null">
|
|
|
+ guid = #{record.guid,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.tCustomerId != null">
|
|
|
+ t_customer_id = #{record.tCustomerId,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.tCustomerName != null">
|
|
|
+ t_customer_name = #{record.tCustomerName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.carbonVal != null">
|
|
|
+ carbon_val = #{record.carbonVal,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="record.status != null">
|
|
|
+ status = #{record.status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.type != null">
|
|
|
+ type = #{record.type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.tbGuid != null">
|
|
|
+ tb_guid = #{record.tbGuid,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.tbName != null">
|
|
|
+ tb_name = #{record.tbName,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.remarks != null">
|
|
|
+ remarks = #{record.remarks,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.yearTime != null">
|
|
|
+ year_time = #{record.yearTime,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.createUser != null">
|
|
|
+ create_user = #{record.createUser,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.createTime != null">
|
|
|
+ create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="record.updateUser != null">
|
|
|
+ update_user = #{record.updateUser,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.updateTime != null">
|
|
|
+ update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByExample" parameterType="map">
|
|
|
+ update t_customer_carbon_val
|
|
|
+ set guid = #{record.guid,jdbcType=CHAR},
|
|
|
t_customer_id = #{record.tCustomerId,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="record.tCustomerName != null" >
|
|
|
t_customer_name = #{record.tCustomerName,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="record.carbonVal != null" >
|
|
|
carbon_val = #{record.carbonVal,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="record.status != null" >
|
|
|
status = #{record.status,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.type != null" >
|
|
|
type = #{record.type,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.tbGuid != null" >
|
|
|
tb_guid = #{record.tbGuid,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="record.tbName != null" >
|
|
|
tb_name = #{record.tbName,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="record.remarks != null" >
|
|
|
remarks = #{record.remarks,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="record.yearTime != null" >
|
|
|
year_time = #{record.yearTime,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="record.createUser != null" >
|
|
|
create_user = #{record.createUser,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="record.createTime != null" >
|
|
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="record.updateUser != null" >
|
|
|
update_user = #{record.updateUser,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="record.updateTime != null" >
|
|
|
- update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- <if test="_parameter != null" >
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </update>
|
|
|
- <update id="updateByExample" parameterType="map" >
|
|
|
- update t_customer_carbon_val
|
|
|
- set guid = #{record.guid,jdbcType=CHAR},
|
|
|
- t_customer_id = #{record.tCustomerId,jdbcType=CHAR},
|
|
|
- t_customer_name = #{record.tCustomerName,jdbcType=VARCHAR},
|
|
|
- carbon_val = #{record.carbonVal,jdbcType=DECIMAL},
|
|
|
- status = #{record.status,jdbcType=INTEGER},
|
|
|
- type = #{record.type,jdbcType=INTEGER},
|
|
|
- tb_guid = #{record.tbGuid,jdbcType=CHAR},
|
|
|
- tb_name = #{record.tbName,jdbcType=CHAR},
|
|
|
- remarks = #{record.remarks,jdbcType=CHAR},
|
|
|
- year_time = #{record.yearTime,jdbcType=INTEGER},
|
|
|
- create_user = #{record.createUser,jdbcType=CHAR},
|
|
|
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
|
- update_user = #{record.updateUser,jdbcType=CHAR},
|
|
|
- update_time = #{record.updateTime,jdbcType=TIMESTAMP}
|
|
|
- <if test="_parameter != null" >
|
|
|
- <include refid="Update_By_Example_Where_Clause" />
|
|
|
- </if>
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonVal" >
|
|
|
- update t_customer_carbon_val
|
|
|
- <set >
|
|
|
- <if test="tCustomerId != null" >
|
|
|
- t_customer_id = #{tCustomerId,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="tCustomerName != null" >
|
|
|
- t_customer_name = #{tCustomerName,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="carbonVal != null" >
|
|
|
- carbon_val = #{carbonVal,jdbcType=DECIMAL},
|
|
|
- </if>
|
|
|
- <if test="status != null" >
|
|
|
- status = #{status,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="type != null" >
|
|
|
- type = #{type,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="tbGuid != null" >
|
|
|
- tb_guid = #{tbGuid,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="tbName != null" >
|
|
|
- tb_name = #{tbName,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="remarks != null" >
|
|
|
- remarks = #{remarks,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="yearTime != null" >
|
|
|
- year_time = #{yearTime,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="createUser != null" >
|
|
|
- create_user = #{createUser,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="createTime != null" >
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="updateUser != null" >
|
|
|
- update_user = #{updateUser,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null" >
|
|
|
- update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where guid = #{guid,jdbcType=CHAR}
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonVal" >
|
|
|
+ update_time = #{record.updateTime,jdbcType=TIMESTAMP}
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause"/>
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective"
|
|
|
+ parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonVal">
|
|
|
+ update t_customer_carbon_val
|
|
|
+ <set>
|
|
|
+ <if test="tCustomerId != null">
|
|
|
+ t_customer_id = #{tCustomerId,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="tCustomerName != null">
|
|
|
+ t_customer_name = #{tCustomerName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="carbonVal != null">
|
|
|
+ carbon_val = #{carbonVal,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ status = #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type = #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="tbGuid != null">
|
|
|
+ tb_guid = #{tbGuid,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="tbName != null">
|
|
|
+ tb_name = #{tbName,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null">
|
|
|
+ remarks = #{remarks,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="yearTime != null">
|
|
|
+ year_time = #{yearTime,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createUser != null">
|
|
|
+ create_user = #{createUser,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updateUser != null">
|
|
|
+ update_user = #{updateUser,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where guid = #{guid,jdbcType=CHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.hcloud.microserver.h5.facade.carbon.entity.CustomerCarbonVal">
|
|
|
update t_customer_carbon_val
|
|
|
set t_customer_id = #{tCustomerId,jdbcType=CHAR},
|
|
|
t_customer_name = #{tCustomerName,jdbcType=VARCHAR},
|
|
@@ -351,10 +357,11 @@
|
|
|
where guid = #{guid,jdbcType=CHAR}
|
|
|
</update>
|
|
|
|
|
|
- <!-- 查询客户购碳量排行榜 lym -->
|
|
|
- <select id="getCustomerCarbonValRankList" parameterType="com.hcloud.microserver.h5.facade.carbon.forms.CustomerCarbonValRankForm"
|
|
|
- resultType="com.hcloud.microserver.h5.facade.carbon.forms.CustomerCarbonValRankForm">
|
|
|
- SELECT obj.* from (SELECT @rownum := @rownum + 1 AS rank,tmp.t_customer_id AS customerId,tmp.carbonVal
|
|
|
+ <!-- 查询客户购碳量排行榜 lym -->
|
|
|
+ <select id="getCustomerCarbonValRankList"
|
|
|
+ parameterType="com.hcloud.microserver.h5.facade.carbon.forms.CustomerCarbonValRankForm"
|
|
|
+ resultType="com.hcloud.microserver.h5.facade.carbon.forms.CustomerCarbonValRankForm">
|
|
|
+ SELECT obj.* from (SELECT @rownum := @rownum + 1 AS rank,tmp.t_customer_id AS customerId,tmp.carbonVal
|
|
|
,IFNULL(c.customer_name,c.nick_name) AS customerName,c.head_image AS headImage
|
|
|
FROM (SELECT @rownum := 0) r,(SELECT a.t_customer_id,SUM(a.carbon_val) AS carbonVal
|
|
|
FROM t_customer_carbon_val a
|
|
@@ -362,20 +369,20 @@
|
|
|
WHERE a.year_time BETWEEN YEAR(DATE_SUB(NOW(),INTERVAL 3 YEAR)) AND YEAR(NOW())
|
|
|
AND a.type = 1
|
|
|
<if test="type != null and type == 1">
|
|
|
- AND b.customer_type = 1
|
|
|
+ AND b.customer_type = 1
|
|
|
</if>
|
|
|
<if test="type != null and type == 2">
|
|
|
- AND b.customer_type != 1
|
|
|
+ AND b.customer_type != 1
|
|
|
</if>
|
|
|
GROUP BY t_customer_id
|
|
|
) tmp
|
|
|
LEFT JOIN t_customer_info c ON tmp.t_customer_id = c.guid
|
|
|
ORDER BY tmp.carbonVal DESC
|
|
|
- ) obj WHERE 1 = 1
|
|
|
+ ) obj WHERE 1 = 1
|
|
|
<if test="customerId != null and isCurrCustomerRank != null and isCurrCustomerRank == true">
|
|
|
- AND obj.CustomerId = #{customerId}
|
|
|
+ AND obj.CustomerId = #{customerId}
|
|
|
</if>
|
|
|
- </select>
|
|
|
+ </select>
|
|
|
<select id="selectCarbonAmountByCustomerId" resultType="java.math.BigDecimal">
|
|
|
SELECT
|
|
|
SUM(a.carbon_val)
|
|
@@ -413,22 +420,23 @@
|
|
|
a.t_customer_id
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
<insert id="insertSelectiveList">
|
|
|
INSERT INTO `t_customer_carbon_val` (
|
|
|
- `guid`,
|
|
|
- `t_customer_id`,
|
|
|
- `t_customer_name`,
|
|
|
- `carbon_val`,
|
|
|
- `status`,
|
|
|
- `type`,
|
|
|
- `tb_guid`,
|
|
|
- `tb_name`,
|
|
|
- `remarks`,
|
|
|
- `year_time`,
|
|
|
- `create_user`,
|
|
|
- `create_time`,
|
|
|
- `update_user`,
|
|
|
- `update_time`
|
|
|
+ `guid`,
|
|
|
+ `t_customer_id`,
|
|
|
+ `t_customer_name`,
|
|
|
+ `carbon_val`,
|
|
|
+ `status`,
|
|
|
+ `type`,
|
|
|
+ `tb_guid`,
|
|
|
+ `tb_name`,
|
|
|
+ `remarks`,
|
|
|
+ `year_time`,
|
|
|
+ `create_user`,
|
|
|
+ `create_time`,
|
|
|
+ `update_user`,
|
|
|
+ `update_time`
|
|
|
)
|
|
|
VALUES
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
@@ -450,6 +458,41 @@
|
|
|
)
|
|
|
</foreach>
|
|
|
|
|
|
-
|
|
|
</insert>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="myCarbonVal" resultType="com.hcloud.microserver.h5.bo.MyCarbonValBO">
|
|
|
+ SELECT
|
|
|
+ a.type,
|
|
|
+ CASE a.type
|
|
|
+ WHEN 1 THEN
|
|
|
+ '购买碳汇'
|
|
|
+ WHEN 2 THEN
|
|
|
+ '企业碳中和'
|
|
|
+ WHEN 3 THEN
|
|
|
+ '大型活动碳中和'
|
|
|
+ WHEN 4 THEN
|
|
|
+ '碳履约'
|
|
|
+ WHEN 5 THEN
|
|
|
+ '为重庆市碳排放量做贡献'
|
|
|
+ ELSE
|
|
|
+ '购买碳汇'
|
|
|
+ END 'status',
|
|
|
+ SUM(a.carbon_val) AS totalCarbonVal
|
|
|
+ FROM
|
|
|
+ t_customer_carbon_val a
|
|
|
+ WHERE
|
|
|
+ 1=1
|
|
|
+ <choose>
|
|
|
+ <when test="year != null">
|
|
|
+ AND a.year_time = #{year}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ AND a.year_time = NOW()
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ AND a.t_customer_id = #{guid}
|
|
|
+ GROUP BY
|
|
|
+ a.type
|
|
|
+ </select>
|
|
|
</mapper>
|