|
- <?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.WxEnergyFeesSetoffMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxEnergyFeesSetoff">
- <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="advance_fees_id" jdbcType="BIGINT" property="advanceFeesId"/>
- <result column="fees_id" jdbcType="BIGINT" property="feesId"/>
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`advance_fees_id`,`fees_id`
- </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 != advanceFeesId ">and `advance_fees_id` = #{advanceFeesId}</if>
- <if test=" null != feesId ">and `fees_id` = #{feesId}</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.WxEnergyFeesSetoff" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_energy_fees_setoff
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findFeesIdList" parameterType="com.iformall.domain.po.WxEnergyFeesSetoff" resultType="Long">
- select distinct fees_id
- from wx_energy_fees_setoff
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findadvanceFeesIdList" parameterType="com.iformall.domain.po.WxEnergyFeesSetoff" resultType="Long">
- select distinct advance_fees_id
- from wx_energy_fees_setoff
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_energy_fees_setoff where id = #{id} and `tenant_id` = #{tenantId}
- </select>
-
- <delete id="deleteByAdvanceId" parameterType="com.iformall.domain.po.WxEnergyFeesSetoff" >
- delete from wx_energy_fees_setoff where `tenant_id` = #{tenantId} and advance_fees_id = #{advanceFeesId}
- </delete>
-
- </mapper>
|