TCoinOrderMapper.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.szwl.mapper.TCoinOrderMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.szwl.model.entity.TCoinOrder">
  6. <id column="id" property="id" />
  7. <result column="create_date" property="createDate" />
  8. <result column="modify_date" property="modifyDate" />
  9. <result column="admin_id" property="adminId" />
  10. <result column="client_id" property="clientId" />
  11. <result column="pay_type" property="payType" />
  12. <result column="price" property="price" />
  13. <result column="sn" property="sn" />
  14. <result column="type" property="type" />
  15. <result column="product_name" property="productName" />
  16. <result column="es" property="es" />
  17. <result column="pay_date" property="payDate" />
  18. </resultMap>
  19. <resultMap id="orderDaoChuDTO" type="com.szwl.model.bean.OrderDaoChuDTO">
  20. <result column="username" jdbcType="VARCHAR" property="username" />
  21. <result column="name" jdbcType="VARCHAR" property="name" />
  22. <result column="phone" jdbcType="VARCHAR" property="phone" />
  23. <result column="clientId" jdbcType="VARCHAR" property="clientId" />
  24. <result column="adminId" jdbcType="BIGINT" property="adminId" />
  25. <result column="priceTotal" jdbcType="DECIMAL" property="priceTotal" />
  26. <result column="address" jdbcType="VARCHAR" property="address" />
  27. <result column="equipmentType" jdbcType="VARCHAR" property="equipmentType" />
  28. <result column="createDate" jdbcType="VARCHAR" property="createDate" />
  29. <result column="equipmentTotal" jdbcType="VARCHAR" property="equipmentTotal" />
  30. <result column="lastUsername" jdbcType="VARCHAR" property="lastUsername" />
  31. </resultMap>
  32. <!-- 通用查询结果列 -->
  33. <sql id="Base_Column_List">
  34. id, create_date, modify_date, admin_id, client_id, pay_type, price, sn, type, product_name, es, pay_date
  35. </sql>
  36. <select id="getOrderDaoCu" resultMap="orderDaoChuDTO" parameterType="com.szwl.model.query.OrderDaoChuParam">
  37. select sum(price) AS priceTotal,admin_id AS adminId,client_id AS clientId
  38. from t_coin_order where 1=1
  39. <if test="adminId != null and adminId !=''">
  40. and admin_id= #{adminId} -- 订单所属商家id
  41. </if>
  42. <if test="clientId != null and clientId !=''">
  43. and client_id = #{clientId}
  44. </if>
  45. and create_date >= STR_TO_DATE(CONCAT(#{begin},' 00:00:00'),'%Y/%m/%d %H:%i:%s')
  46. <![CDATA[ and create_date <= STR_TO_DATE(CONCAT(#{end},' 23:59:59'),'%Y/%m/%d %H:%i:%s') ]]>
  47. <if test="type != null and type !='' and type==2">
  48. group by adminId
  49. </if>
  50. <if test="type != null and type !='' and type==1">
  51. group by clientId
  52. </if>
  53. order by priceTotal desc
  54. limit #{current} , #{size}
  55. </select>
  56. </mapper>