123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?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.szwl.mapper.TCoinOrderMapper">
- <!-- 通用查询映射结果 -->
- <resultMap id="BaseResultMap" type="com.szwl.model.entity.TCoinOrder">
- <id column="id" property="id" />
- <result column="create_date" property="createDate" />
- <result column="modify_date" property="modifyDate" />
- <result column="admin_id" property="adminId" />
- <result column="client_id" property="clientId" />
- <result column="pay_type" property="payType" />
- <result column="price" property="price" />
- <result column="sn" property="sn" />
- <result column="type" property="type" />
- <result column="product_name" property="productName" />
- <result column="es" property="es" />
- <result column="pay_date" property="payDate" />
- </resultMap>
- <resultMap id="orderDaoChuDTO" type="com.szwl.model.bean.OrderDaoChuDTO">
- <result column="username" jdbcType="VARCHAR" property="username" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="phone" jdbcType="VARCHAR" property="phone" />
- <result column="clientId" jdbcType="VARCHAR" property="clientId" />
- <result column="adminId" jdbcType="BIGINT" property="adminId" />
- <result column="priceTotal" jdbcType="DECIMAL" property="priceTotal" />
- <result column="address" jdbcType="VARCHAR" property="address" />
- <result column="equipmentType" jdbcType="VARCHAR" property="equipmentType" />
- <result column="createDate" jdbcType="VARCHAR" property="createDate" />
- <result column="equipmentTotal" jdbcType="VARCHAR" property="equipmentTotal" />
- <result column="lastUsername" jdbcType="VARCHAR" property="lastUsername" />
- </resultMap>
- <!-- 通用查询结果列 -->
- <sql id="Base_Column_List">
- id, create_date, modify_date, admin_id, client_id, pay_type, price, sn, type, product_name, es, pay_date
- </sql>
- <select id="getOrderDaoCu" resultMap="orderDaoChuDTO" parameterType="com.szwl.model.query.OrderDaoChuParam">
- select sum(price) AS priceTotal,admin_id AS adminId,client_id AS clientId
- from t_coin_order where 1=1
- <if test="adminId != null and adminId !=''">
- and admin_id= #{adminId} -- 订单所属商家id
- </if>
- <if test="clientId != null and clientId !=''">
- and client_id = #{clientId}
- </if>
- and create_date >= STR_TO_DATE(CONCAT(#{begin},' 00:00:00'),'%Y/%m/%d %H:%i:%s')
- <![CDATA[ and create_date <= STR_TO_DATE(CONCAT(#{end},' 23:59:59'),'%Y/%m/%d %H:%i:%s') ]]>
- <if test="type != null and type !='' and type==2">
- group by adminId
- </if>
- <if test="type != null and type !='' and type==1">
- group by clientId
- </if>
- order by priceTotal desc
- limit #{current} , #{size}
- </select>
- </mapper>
|