yonge 5 年之前
父節點
當前提交
1d13514ee5

+ 88 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/TenantPaymentOrderQueryInfo.java

@@ -0,0 +1,88 @@
+package com.ym.mec.biz.dal.page;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import com.ym.mec.biz.dal.entity.TenantPaymentOrder.TenantPaymentType;
+import com.ym.mec.biz.dal.enums.DealStatusEnum;
+import com.ym.mec.common.page.QueryInfo;
+
+public class TenantPaymentOrderQueryInfo extends QueryInfo {
+
+	@ApiModelProperty(value = "开始时间", required = false)
+	private String orderStartDate;
+
+	@ApiModelProperty(value = "截止时间", required = false)
+	private String orderEndDate;
+
+	@ApiModelProperty(value = "交易类型", required = false)
+	private TenantPaymentType type;
+
+	@ApiModelProperty(value = "老师编号", required = false)
+	private Integer userId;
+
+	@ApiModelProperty(value = "交易状态", required = false)
+	private DealStatusEnum status;
+
+	@ApiModelProperty(value = "分部编号", required = false)
+	private String organId;
+
+	@ApiModelProperty(value = "支付方式", required = false)
+	private String paymentChannel;
+
+	public String getOrderStartDate() {
+		return orderStartDate;
+	}
+
+	public void setOrderStartDate(String orderStartDate) {
+		this.orderStartDate = orderStartDate;
+	}
+
+	public String getOrderEndDate() {
+		return orderEndDate;
+	}
+
+	public void setOrderEndDate(String orderEndDate) {
+		this.orderEndDate = orderEndDate;
+	}
+
+	public TenantPaymentType getType() {
+		return type;
+	}
+
+	public void setType(TenantPaymentType type) {
+		this.type = type;
+	}
+
+	public Integer getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Integer userId) {
+		this.userId = userId;
+	}
+
+	public DealStatusEnum getStatus() {
+		return status;
+	}
+
+	public void setStatus(DealStatusEnum status) {
+		this.status = status;
+	}
+
+	public String getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(String organId) {
+		this.organId = organId;
+	}
+
+	public String getPaymentChannel() {
+		return paymentChannel;
+	}
+
+	public void setPaymentChannel(String paymentChannel) {
+		this.paymentChannel = paymentChannel;
+	}
+
+}

+ 31 - 2
mec-biz/src/main/resources/config/mybatis/TenantPaymentOrderMapper.xml

@@ -30,6 +30,32 @@
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 	</resultMap>
+	
+	<sql id="queryPaymentOrder">
+        <where>
+            <if test="organId != null">
+                AND FIND_IN_SET(tpo.organ_id_,#{organId})
+            </if>
+            <if test="orderStartDate != null">
+                AND DATE_FORMAT(tpo.create_time_,'%Y-%m-%d') &gt;= #{orderStartDate}
+            </if>
+            <if test="orderEndDate != null">
+                AND DATE_FORMAT(tpo.create_time_,'%Y-%m-%d') &lt;= #{orderEndDate}
+            </if>
+            <if test="tenantPaymentType != null">
+                AND tpo.type_ = #{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+            <if test="userId != null">
+                AND tpo.user_id_ = #{userId}
+            </if>
+            <if test="paymentChannel != null">
+                AND tpo.payment_channel_ NOT IN (#{paymentChannel})
+            </if>
+            <if test="status != null">
+                AND tpo.status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
+            </if>
+        </where>
+    </sql>
 
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="TenantPaymentOrder">
@@ -139,13 +165,16 @@
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="TenantPaymentOrder"
 		parameterType="map">
-		SELECT * FROM tenant_payment_order ORDER BY id_
+		SELECT tpo.* FROM tenant_payment_order tpo
+        <include refid="queryPaymentOrder"/>
+		ORDER BY tpo.id_
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM tenant_payment_order
+		SELECT COUNT(tpo.id_) FROM tenant_payment_order tpo
+        <include refid="queryPaymentOrder"/>
 	</select>
 	
 	<select id="queryByUserId" resultMap="TenantPaymentOrder">

+ 40 - 0
mec-web/src/main/java/com/ym/mec/web/controller/TenantPaymentOrderController.java

@@ -0,0 +1,40 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.biz.dal.entity.TenantPaymentOrder;
+import com.ym.mec.biz.dal.page.TenantPaymentOrderQueryInfo;
+import com.ym.mec.biz.service.TenantPaymentOrderService;
+import com.ym.mec.common.controller.BaseController;
+
+@Api(tags = "租户订单服务")
+@RequestMapping("tenantPaymentOrder")
+@RestController
+public class TenantPaymentOrderController extends BaseController {
+
+    @Autowired
+    private TenantPaymentOrderService tenantPaymentOrderService;
+
+    @ApiOperation(value = "分页查询订单")
+    @GetMapping("/queryPage")
+    public Object queryPage(TenantPaymentOrderQueryInfo queryInfo){
+        return succeed(tenantPaymentOrderService.queryPage(queryInfo));
+    }
+
+    @ApiOperation(value = "查询订单明细")
+    @GetMapping("/query")
+    public Object query(long id){
+        TenantPaymentOrder order = tenantPaymentOrderService.get(id);
+        if(order == null){
+        	return failed("订单不存在");
+        }
+        return succeed(order);
+    }
+
+}