|
- <?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.iformall.mapper.WxEnergyReadingCalcuteResultMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxEnergyReadingCalcuteResult">
- <id column="id" jdbcType="BIGINT" property="id"/>
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
- <result column="calcute_id" jdbcType="BIGINT" property="calcuteId"/>
- <result column="shop_id" jdbcType="BIGINT" property="shopId"/>
- <result column="fees_id" jdbcType="BIGINT" property="feesId"/>
- <result column="fees_shop_id" jdbcType="BIGINT" property="feesShopId"/>
- <result column="money" jdbcType="VARCHAR" property="money" />
- <result column="period" jdbcType="VARCHAR" property="period" />
- <result column="money_deail" jdbcType="VARCHAR" property="moneyDeail" />
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`calcute_id`,`shop_id`,`fees_id`,`fees_shop_id`,`money`,`period`,`money_deail`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1=1
- <if test=" null != id ">and `id` = #{id}</if>
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
- <if test=" null != period and '' != period">
- and `period` = #{period}
- </if>
- <if test=" null != calcuteId ">and `calcute_id` = #{calcuteId}</if>
- <if test=" null != shopId ">and `shop_id` = #{shopId}</if>
- <if test=" null != feesId ">and `fees_id` = #{feesId}</if>
- <if test=" null != feesShopId ">and `fees_shop_id` = #{feesShopId}</if>
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns">order by ${sortColumns}</if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxEnergyReadingCalcuteResult" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_energy_reading_calcute_result
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_energy_reading_calcute_result where id = #{id} and `tenant_id` = #{tenantId}
- </select>
-
- <select id="findShopIdList" parameterType="com.iformall.domain.po.WxEnergyReadingCalcuteResult" resultType="Long">
- select distinct shop_id
- from wx_energy_reading_calcute_result
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <insert id="insertResults" parameterType="HashMap">
- INSERT INTO wx_energy_reading_calcute_result (
- <include refid="allColumns"/>
- )
- VALUES
- <foreach collection="list" item="item" index="index" separator=",">
- (
- #{item.id},#{item.tenantId},#{item.parentTenantId},#{item.createTime},#{item.updateTime},#{item.calcuteId},
- #{item.shopId},#{item.feesId},#{item.feesShopId},#{item.money},#{item.period},#{item.moneyDeail}
- )
- </foreach>
- </insert>
-
- </mapper>
|