|
- <?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.WxPrepaymentMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPrepayment">
- <id column="id" property="id"/>
- <result column="tenant_id" property="tenantId"/>
- <result column="parent_tenant_id" property="parentTenantId"/>
- <result column="merchant_id" property="merchantId"/>
- <result column="last_pay_type" property="lastPayType"/>
- <result column="last_pay_way" property="lastPayWay"/>
- <result column="last_pay_amount" property="lastPayAmount"/>
- <result column="remain_amount" property="remainAmount"/>
- <result column="total_amount" property="totalAmount"/>
- <result column="remarks" property="remarks"/>
- <result column="operation_type" property="operationType"/>
- <result column="operator" property="operator"/>
- <result column="create_time" property="createTime"/>
- <result column="update_time" property="updateTime"/>
- <result column="merchant_name" property="merchantName"/>
- </resultMap>
-
- <sql id="allColumns">
- p.`id`,p.`tenant_id`,p.`parent_tenant_id`,p.`merchant_id`,p.`last_pay_way`,p.`last_pay_type`,p.`last_pay_amount`,p.`remain_amount`,p.`total_amount` ,p.`remarks`,p.`operation_type`,p.`operator`,
- p.`create_time`,p.`update_time`,m.`name` merchant_name
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
- <if test=" null != tenantId and '' != tenantId">
- and p.`tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and p.`parent_tenant_id` = #{parentTenantId}
- </if>
- <if test=" null != id ">
- and p.`id` = #{id}
- </if>
- <if test=" null != merchantId ">
- and p.`merchant_id` = #{merchantId}
- </if>
- <if test=" null != lastPayType ">
- and p.`last_pay_type` = #{lastPayType}
- </if>
- <if test=" null != lastPayWay ">
- and p.`last_pay_way` = #{lastPayWay}
- </if>
- <if test=" null != operationType ">
- and p.`operation_type` = #{operationType}
- </if>
- <if test=" null != merchantName and '' != merchantName">
- and m.`name` like concat('%',#{merchantName},'%')
- </if>
- <if test=" null != ids ">
- and p.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.WxPrepayment" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_prepayment p inner join wx_merchant m on p.merchant_id=m.id
- <include refid="dynamicWhereConditions"/>
- </select>
-
-
- </mapper>
|