jianlin 4 weeks ago
parent
commit
be7d1d3392
  1. 2
      src/main/java/com/example/demo/domain/dou/Pay.java
  2. 2
      src/main/java/com/example/demo/domain/dou/RechargeTotal.java
  3. 1
      src/main/java/com/example/demo/domain/dou/Spend.java
  4. 10
      src/main/resources/mapperLink/DouMapper.xml
  5. 7
      src/main/resources/mapperPay/PayMapper.xml

2
src/main/java/com/example/demo/domain/dou/Pay.java

@ -20,7 +20,7 @@ public class Pay {
private String nickname; private String nickname;
private BigDecimal price; private BigDecimal price;
private Integer count; private Integer count;
private Integer payStyle;
private String payStyle;
private Integer state; private Integer state;
private Integer platfrom; private Integer platfrom;
private Integer successTime; private Integer successTime;

2
src/main/java/com/example/demo/domain/dou/RechargeTotal.java

@ -19,7 +19,7 @@ public class RechargeTotal {
private String type; private String type;
private BigDecimal priceTotal; private BigDecimal priceTotal;
private Integer countTotal; private Integer countTotal;
private Integer payStyle;
private String payStyle;
private String deptName; private String deptName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")

1
src/main/java/com/example/demo/domain/dou/Spend.java

@ -37,4 +37,5 @@ public class Spend implements Serializable {
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endTime; private Date endTime;
private String room; private String room;
private Integer sourceType;
} }

10
src/main/resources/mapperLink/DouMapper.xml

@ -83,7 +83,7 @@
fm.nickname, fm.nickname,
fy.content, fy.content,
fy.pay_type, fy.pay_type,
fy.source_type AS good,
fy.source_type,
fm.jwcode, fm.jwcode,
fm.ip_address, fm.ip_address,
fy.money_free, fy.money_free,
@ -109,10 +109,10 @@
<if test="sourceName != null and sourceName.length > 0"> <if test="sourceName != null and sourceName.length > 0">
AND fy.source_name = #{sourceName} AND fy.source_name = #{sourceName}
</if> </if>
<if test="payType != null and payType.length > 0">
<if test="payType != null">
AND fy.pay_type = #{payType} AND fy.pay_type = #{payType}
</if> </if>
<if test="good != null and good.length > 0">
<if test="sourceType != null">
AND fy.source_type = #{good} AND fy.source_type = #{good}
</if> </if>
<if test="startTime != null and endTime != null"> <if test="startTime != null and endTime != null">
@ -144,10 +144,10 @@
<if test="sourceName != null and sourceName.length > 0"> <if test="sourceName != null and sourceName.length > 0">
AND fy.source_name = #{sourceName} AND fy.source_name = #{sourceName}
</if> </if>
<if test="payType != null and payType.length > 0">
<if test="payType != null">
AND fy.pay_type = #{payType} AND fy.pay_type = #{payType}
</if> </if>
<if test="sourceType != null and sourceType.length > 0">
<if test="sourceType != null ">
AND fy.source_type = #{sourceType} AND fy.source_type = #{sourceType}
</if> </if>
<if test="startTime != null and endTime != null"> <if test="startTime != null and endTime != null">

7
src/main/resources/mapperPay/PayMapper.xml

@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.demo.mapperPay.PayMapper"> <mapper namespace="com.example.demo.mapperPay.PayMapper">
<select id="getPay" resultType="com.example.demo.domain.dou.Pay"> <select id="getPay" resultType="com.example.demo.domain.dou.Pay">
SELECT go.jwcode,mi.name,mi.deptName,mi.shopName,go.type,go.order_no,go.price,go.count,gps.`name`,go.success_time from g_order as go
SELECT gps.`name` as payStyle,go.jwcode,mi.name,mi.deptName,mi.shopName,go.type,go.order_no,go.price,go.count,gps.`name`,go.success_time from g_order as go
LEFT JOIN member_info as mi on go.jwcode = mi.jwcode LEFT JOIN member_info as mi on go.jwcode = mi.jwcode
LEFT JOIN g_pay_style gps on go.pay_style=gps.id LEFT JOIN g_pay_style gps on go.pay_style=gps.id
<where> <where>
@ -18,7 +18,7 @@ LEFT JOIN member_info as mi on go.jwcode = mi.jwcode
and go.type = #{type} and go.type = #{type}
</if> </if>
<if test="payStyle != null and payStyle.length > 0"> <if test="payStyle != null and payStyle.length > 0">
and go.pay_style = #{payStyle}
and gps.`name` = #{payStyle}
</if> </if>
<if test="deptName !=null and deptName.length > 0"> <if test="deptName !=null and deptName.length > 0">
and mi.deptName = #{deptName} and mi.deptName = #{deptName}
@ -44,6 +44,7 @@ LEFT JOIN member_info as mi on go.jwcode = mi.jwcode
sum(price) as priceTotal, sum(price) as priceTotal,
sum(count) as countTotal sum(count) as countTotal
FROM g_order as go FROM g_order as go
LEFT JOIN g_pay_style gps on go.pay_style=gps.id
<where> <where>
<if test="jwcode != null"> <if test="jwcode != null">
and go.jwcode = #{jwcode} and go.jwcode = #{jwcode}
@ -55,7 +56,7 @@ LEFT JOIN member_info as mi on go.jwcode = mi.jwcode
and go.type = #{type} and go.type = #{type}
</if> </if>
<if test="payStyle != null and payStyle.length > 0"> <if test="payStyle != null and payStyle.length > 0">
and go.pay_style = #{payStyle}
and gps.`name` = #{payStyle}
</if> </if>
<if test="deptName !=null and deptName.length > 0"> <if test="deptName !=null and deptName.length > 0">
and mi.deptName = #{deptName} and mi.deptName = #{deptName}

Loading…
Cancel
Save