|
- <?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.WxEnergyFeesTimeShopMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxEnergyFeesTimeShop">
- <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="period" jdbcType="VARCHAR" property="period"/>
- <result column="time_id" jdbcType="BIGINT" property="timeId"/>
- <result column="shop_id" jdbcType="BIGINT" property="shopId"/>
- <result column="type" jdbcType="INTEGER" property="type"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`period`,`time_id`,`shop_id`,`type`
- </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 != type ">and `type` = #{type}</if>
- <if test=" null != timeId ">and `time_id` = #{timeId}</if>
- <if test=" null != shopId ">and `shop_id` = #{shopId}</if>
- <if test=" null != shopIds ">
- and shop_id in
- <foreach collection="shopIds" index="index" item="sidItem" open="(" separator="," close=")">
- #{sidItem}
- </foreach>
- </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.WxEnergyFeesTimeShop" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_energy_fees_time_shop
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findCount" parameterType="com.iformall.domain.po.WxEnergyFeesTimeShop" resultType="Integer">
- select count(1)
- from wx_energy_fees_time_shop
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_energy_fees_time_shop where id = #{id} and `tenant_id` = #{tenantId}
- </select>
-
- <delete id="deleteByTimeId" parameterType="HashMap">
- delete from wx_energy_fees_time_shop where `tenant_id` = #{tenantId} and `time_id` = #{timeId}
- </delete>
-
- <select id="findShopIdList" parameterType="com.iformall.domain.po.WxEnergyFeesTimeShop" resultType="Long">
- select distinct shop_id
- from wx_energy_fees_time_shop
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findTimeIdList" parameterType="com.iformall.domain.po.WxEnergyFeesTimeShop" resultType="Long">
- select distinct time_id
- from wx_energy_fees_time_shop
- <include refid="dynamicWhereConditions"/>
- </select>
-
- </mapper>
|