审计记录

WebContent/WEB-INF/classes/mapper/LotteryDao.xml 1.6 KB
zxt@theyeasy.com committed
1 2 3
<?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.w1hd.zzhnc.dao.LotteryLogDao">
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
	<select id="getLotteryLogList" resultType="com.w1hd.zzhnc.vo.Lotterylog_Vo">
		select a.*,b.nickname,b.logo from lotterylog a
		left join fans b on a.fansid=b.id
		<where>
			<if test="status != null">
				and a.status=#{status}
			</if>

			<if test="keyword !=null and keyword!='' ">
				and (b.nickname like CONCAT(CONCAT('%',#{keyword}),'%') or a.prize_name
				like CONCAT(CONCAT('%',#{keyword}),'%') )
			</if>

			<if test="turn != null and turn>0">
				and a.turn=#{turn}
			</if>

			<if test="type !=null and type >0">
				and a.mny > 0
			</if>
		</where>
zxt@theyeasy.com committed
25 26
		ORDER BY a.createdtime desc
		limit #{0},#{1}
27 28 29
	</select>

	<select id="getLotteryLogCount" resultType="java.lang.Integer">
30 31
		select  count(*) from lotterylog a
		left join fans b on a.fansid=b.id
32 33 34 35 36
		<where>
			<if test="status != null">
				and status=#{status}
			</if>

37 38 39 40 41
			<if test="keyword !=null and keyword!='' ">
				and (b.nickname like CONCAT(CONCAT('%',#{keyword}),'%') or a.prize_name
				like CONCAT(CONCAT('%',#{keyword}),'%') )
			</if>

42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
			<if test="turn != null and turn>0">
				and turn=#{turn}
			</if>

			<if test="type !=null and type >0">
				and mny > 0
			</if>
		</where>
	</select>

	<select id="getSumMny" resultType="java.math.BigDecimal">
		select sum(mny) from lotterylog
		<where>
			<if test="status != null">
				and status=#{status}
			</if>

			<if test="turn != null and turn>0">
				and turn=#{turn}
			</if>
		</where>
	</select>
zxt@theyeasy.com committed
64
</mapper>