<?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.stylefeng.guns.modular.system.dao.SysRedPacketRecordMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.SysRedPacketRecord">
|
<id column="id" property="id" />
|
<result column="money" property="money" />
|
<result column="insertTime" property="insertTime" />
|
<result column="companyId" property="companyId" />
|
<result column="name" property="name" />
|
<result column="type" property="type" />
|
<result column="totalMoney" property="totalMoney" />
|
<result column="laveMoney" property="laveMoney" />
|
<result column="startMoney" property="startMoney" />
|
<result column="endMoney" property="endMoney" />
|
<result column="effective" property="effective" />
|
<result column="companyType" property="companyType" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, money, insertTime, companyId, name, type, totalMoney, laveMoney, startMoney, endMoney, effective, companyType
|
</sql>
|
<select id="getList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page">
|
SELECT
|
c.id,
|
c.money,
|
c.insertTime,
|
c.companyId,
|
c.state,
|
c.userId,
|
u.nickName,
|
u.phone
|
FROM
|
t_user_red_packet_record c
|
LEFT JOIN t_user u ON c.userId = u.id
|
|
WHERE 1=1
|
<if test="beginTime != null and beginTime !='' and endTime != null and endTime != ''">
|
and (c.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59'))
|
</if>
|
<if test="userName != null and userName !=''">
|
and u.nickName like CONCAT('%',#{userName},'%')
|
</if>
|
<if test="userPhone != null and userPhone !=''">
|
and u.phone like CONCAT('%',#{userPhone},'%')
|
</if>
|
<if test="couponActivityId != null">
|
and c.redPacketActivityId=#{couponActivityId}
|
</if>
|
<if test="state != null and state !=''">
|
and c.state=#{state}
|
</if>
|
</select>
|
|
</mapper>
|