1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?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.yonge.cooleshow.biz.dal.mapper.TenantAlbumPurchaseMapper">
-
-
- <!-- 表字段 -->
- <sql id="baseColumns">
- t.id_ AS id
- , t.tenant_id_ AS tenantId
- , t.tenant_album_id_ AS tenantAlbumId
- , t.purchase_time_ AS purchaseTime
- , t.order_no_ AS orderNo
- , t.purchase_quantity_ AS purchaseQuantity
- , t.purchase_cycle_ AS purchaseCycle
- , t.active_quantity_ AS activeQuantity
- , t.purchase_price_ AS purchasePrice
- , t.purchase_status_ AS purchaseStatus
- , t.update_time_ AS updateTime
- , t.create_time_ AS createTime
- </sql>
- <select id="selectPage"
- resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumPurchaseWrapper$TenantAlbumPurchase">
- SELECT
- <include refid="baseColumns"/>,ta.name_ as tenantAlbumName,ta.cover_img_ as tenantAlbumImg
- FROM tenant_album_purchase t
- LEFT JOIN tenant_album ta on t.tenant_album_id_ = ta.id_
- left join user_order t2 on t2.order_no_ = t.order_no_
- <where>
- <if test="param.tenantId != null">
- AND t.tenant_id_ = #{param.tenantId}
- </if>
- <if test="param.purchaseStatus != null and param.purchaseStatus.trim() != ''">
- <if test="param.purchaseStatus == 'WAIT_PAY'">
- AND t2.status_ in ( 'WAIT_PAY','PAYING')
- </if>
- <if test="param.purchaseStatus == 'PAID'">
- AND t2.status_ in ( 'PAID')
- </if>
- <if test="param.purchaseStatus == 'CLOSE'">
- AND t2.status_ in ( 'CLOSE','FAIL')
- </if>
- </if>
- </where>
- <choose>
- <when test="param.orderBy != null and param.orderBy.trim() != ''">
- order by #{param.orderBy}
- </when>
- <otherwise>
- order by t.id_ desc
- </otherwise>
- </choose>
- </select>
-
- </mapper>
|