| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?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.cyksj.mapper.AccountMapper">
- <select id="getNumOfUser" resultType="java.lang.Integer">
- select distinct u.id from `groups_trips` gt inner join `groups_relation` gr on gr.groups_id = gt.id
- inner join `user` u on u.id = gr.user_id
- where gt.account_id in
- <foreach collection="list" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- and gt.status = 'validity'
- and u.created_time between #{yesZeroDate} and #{thisZeroDate}
- </select>
- <select id="getExpiredAccountView" resultType="com.cyksj.model.views.ExpiredAccountDataView">
- select gr.id as relationId,
- a.title as platform,
- a.account,
- a.us_account,
- a.cn_account,
- concat(gdk.spec_val,'¥',cast(gdk.price/100 as decimal(10,2))) as 'type',
- gr.user_id,
- gr.account as userAccount,
- u.headimgurl as img,
- u.nickname,
- gr.start_time as payTime,
- gr.expiry_time,
- gr.renew_status,
- gr.is_handle
- from `account` a left join `groups_trips` gt on gt.account_id = a.id
- left join `groups_relation` gr on gr.groups_id = gt.id
- left join `goods_don_sku` gdk on gdk.id = gt.sku_id
- left join `user` u on gr.user_id = u.id
- <where>
- <if test="goodsId != null">
- a.goods_id = #{goodsId}
- </if>
- <if test="account != null and account != ''">
- and a.account like '%${account}%'
- </if>
- <if test="renewStatus != null">
- and gr.renew_status is ${renewStatus}
- </if>
- <if test="handleStatus != null">
- and gr.is_handle is ${handleStatus}
- </if>
- <if test="cnAccount != null and cnAccount != ''">
- and a.cn_account = #{cnAccount}
- </if>
- <if test="usAccount != null and usAccount != ''">
- and a.us_account = #{usAccount}
- </if>
- <if test="userId != null">
- and gr.user_id = #{userId}
- </if>
- <if test="startTime != null">
- and gr.expiry_time >= #{startTime}
- </if>
- <if test="endTime != null">
- and gr.expiry_time < #{endTime}
- </if>
- and gr.expiry_time < #{now}
- order by expiry_time
- </where>
- </select>
- <select id="getNoAppleOneAccount" resultType="com.cyksj.model.entity.Account">
- select a.id,
- g.title,
- g.id as goodsId
- from `account` a inner join `goods_don` g on g.id = a.goods_id
- where g.type = 1 and g.title != #{appleOne}
- </select>
- </mapper>
|