| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.nq.dao.UserRechargeMapper" > |
| | | <resultMap id="BaseResultMap" type="com.nq.pojo.UserRecharge" > |
| | | <constructor > |
| | | <idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" /> |
| | | <arg column="user_id" jdbcType="INTEGER" javaType="java.lang.Integer" /> |
| | | <arg column="nick_name" jdbcType="VARCHAR" javaType="java.lang.String" /> |
| | | <arg column="agent_id" jdbcType="INTEGER" javaType="java.lang.Integer" /> |
| | | <arg column="order_sn" jdbcType="VARCHAR" javaType="java.lang.String" /> |
| | | <arg column="pay_sn" jdbcType="VARCHAR" javaType="java.lang.String" /> |
| | | <arg column="pay_channel" jdbcType="VARCHAR" javaType="java.lang.String" /> |
| | | <arg column="pay_amt" jdbcType="DECIMAL" javaType="java.math.BigDecimal" /> |
| | | <arg column="order_status" jdbcType="INTEGER" javaType="java.lang.Integer" /> |
| | | <arg column="order_desc" jdbcType="VARCHAR" javaType="java.lang.String" /> |
| | | <arg column="add_time" jdbcType="TIMESTAMP" javaType="java.util.Date" /> |
| | | <arg column="pay_time" jdbcType="TIMESTAMP" javaType="java.util.Date" /> |
| | | <arg column="pay_id" jdbcType="INTEGER" javaType="java.lang.Integer" /> |
| | | </constructor> |
| | | <id column="id" property="id" /> |
| | | <result column="user_id" property="userId"/> |
| | | <result column="nick_name" property="nickName"/> |
| | | <result column="agent_id" property="agentId"/> |
| | | <result column="order_sn" property="orderSn"/> |
| | | <result column="pay_sn" property="paySn"/> |
| | | <result column="pay_channel" property="payChannel"/> |
| | | <result column="pay_amt" property="payAmt"/> |
| | | <result column="order_status" property="orderStatus"/> |
| | | <result column="order_desc" property="orderDesc"/> |
| | | <result column="add_time" property="addTime"/> |
| | | <result column="pay_time" property="payTime"/> |
| | | <result column="pay_id" property="payId"/> |
| | | <result column="img" property="img"/> |
| | | <result column="assets_type" property="assetsType"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List" > |
| | | id, user_id, nick_name, agent_id, order_sn, pay_sn, pay_channel, pay_amt, order_status, |
| | | order_desc, add_time, pay_time, pay_id |
| | | order_desc, add_time, pay_time, pay_id,img,assets_type |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from user_recharge |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > |
| | | delete from user_recharge |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.nq.pojo.UserRecharge" > |
| | | insert into user_recharge (id, user_id, nick_name, |
| | | agent_id, order_sn, pay_sn, |
| | | pay_channel, pay_amt, order_status, |
| | | order_desc, add_time, pay_time,pay_id |
| | | order_desc, add_time, pay_time,pay_id,img,assets_type |
| | | ) |
| | | values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{nickName,jdbcType=VARCHAR}, |
| | | #{agentId,jdbcType=INTEGER}, #{orderSn,jdbcType=VARCHAR}, #{paySn,jdbcType=VARCHAR}, |
| | | #{payChannel,jdbcType=VARCHAR}, #{payAmt,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER}, |
| | | #{orderDesc,jdbcType=VARCHAR}, #{addTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, #{payId,jdbcType=INTEGER} |
| | | #{orderDesc,jdbcType=VARCHAR}, #{addTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, #{payId,jdbcType=INTEGER}, #{img,jdbcType=VARCHAR},#{assetsType,jdbcType=VARCHAR} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.nq.pojo.UserRecharge" > |
| | |
| | | |
| | | <select id="listByAdmin" parameterType="map" resultType="com.nq.pojo.UserRecharge"> |
| | | SELECT |
| | | <include refid="Base_Column_List"/> |
| | | FROM user_recharge |
| | | where agent_id != 1 |
| | | <if test="agentId != null"> |
| | | s.id, s.user_id, s.nick_name, s.agent_id, s.order_sn, s.pay_sn, s.pay_channel, |
| | | s.pay_amt, s.order_status,s.order_desc,s.add_time,s.pay_time,s.pay_id,s.img ,p.channel_name,p.assets_type |
| | | FROM user_recharge s |
| | | join site_pay p |
| | | on s.pay_id = p.id |
| | | where 1=1 |
| | | <if test="agentId != null and agentId != ''"> |
| | | and ( agent_id = #{agentId} |
| | | or agent_id in ( |
| | | select agent_user.id |
| | |
| | | ) |
| | | ) |
| | | </if> |
| | | <if test="userId != null"> |
| | | <if test="userId != null and agentId != ''"> |
| | | and user_id = #{userId} |
| | | </if> |
| | | <if test="realName != null and realName != '' "> |
| | | and nick_name like CONCAT('%','${realName}','%') |
| | | </if> |
| | | <if test="state != null"> |
| | | <if test="state != null and agentId != ''"> |
| | | and order_status = #{state} |
| | | </if> |
| | | |
| | | <if test="begin_time != null "> |
| | | <if test="begin_time != null and agentId != ''"> |
| | | and pay_time <![CDATA[>=]]> #{begin_time} |
| | | </if> |
| | | <if test="end_time != null "> |
| | | <if test="end_time != null and agentId != ''"> |
| | | and pay_time <![CDATA[<=]]> #{end_time} |
| | | </if> |
| | | ORDER BY id DESC |
| | | ORDER BY s.id DESC |
| | | </select> |
| | | |
| | | |