81 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			XML
		
	
		
		
			
		
	
	
			81 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			XML
		
	
|  | <?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.hcy.common.mapper.refund.OrderRefundMapper"> | ||
|  |     <!-- 通用查询映射结果 --> | ||
|  |     <resultMap id="BaseResultMap" type="com.hcy.common.entity.refund.OrderRefund"> | ||
|  |         <!-- <id column="id" property="id"/>
 | ||
|  |          <result column="create_id" property="createId"/> | ||
|  |          <result column="create_time" property="createTime"/> | ||
|  |          <result column="update_id" property="updateId"/> | ||
|  |          <result column="update_time" property="updateTime"/> | ||
|  |          <result column="company_id" property="companyId"/> | ||
|  |          <result column="account_id" property="accountId"/> | ||
|  |          <result column="account_chart_id" property="accountChartId"/> | ||
|  |          <result column="is_add_next_level" property="isAddNextLevel"/> | ||
|  |          <result column="is_reallocate" property="isReallocate"/> | ||
|  |          <result column="tenant_id" property="tenantId"/>--> | ||
|  |     </resultMap> | ||
|  | 
 | ||
|  |     <sql id="base_list"> | ||
|  |         select a.id, | ||
|  |         a.sn as refundSn, | ||
|  |         a.order_id as orderId, | ||
|  |         a.user_id as userId, | ||
|  |         a.type, | ||
|  |         a.order_terminal as orderTerminal, | ||
|  |         a.transaction_id as transactionId, | ||
|  |         a.order_amount as orderAmount, | ||
|  |         a.refund_amount as refundAmount, | ||
|  |         a.refund_status as refund_status, | ||
|  |         a.create_time as createTime, | ||
|  |         a.update_time as updateTime, | ||
|  |         a.refund_time as refundTime, | ||
|  |         b.sn as userSn, | ||
|  |         b.avatar, | ||
|  |         b.nickname, | ||
|  |         b.username, | ||
|  |         c.sn as orderSn, | ||
|  |         d.goods_name as goodsName | ||
|  |         from la_order_refund a | ||
|  |         left join la_user b on a.user_id = b.id | ||
|  |         left join la_order c on a.order_id = c.id | ||
|  |         left join la_order_goods d on a.order_id = d.order_id | ||
|  |         <where> | ||
|  |             <if test="form.refundSn != null and form.refundSn != ''"> | ||
|  |                 and a.sn like concat('%', #{form.refundSn}, '%') | ||
|  |             </if> | ||
|  |             <if test="form.orderSn != null and form.orderSn != ''"> | ||
|  |                 and c.sn like concat('%', #{form.orderSn}, '%') | ||
|  |             </if> | ||
|  |             <if test="form.type != null"> | ||
|  |                 and a.type = #{form.type} | ||
|  |             </if> | ||
|  |             <if test="form.userInfo != null and form.userInfo != ''"> | ||
|  |                 and (b.nickname like concat('%', #{form.userInfo}, '%') or | ||
|  |                 b.sn like concat('%', #{form.userInfo}, '%')) | ||
|  |             </if> | ||
|  |             <if test="form.orderTimeStart != null"> | ||
|  |                 and a.create_time >= #{form.orderTimeStart} | ||
|  |             </if> | ||
|  |             <if test="form.orderTimeEnd != null"> | ||
|  |                 and a.create_time <= #{form.orderTimeEnd} | ||
|  |             </if> | ||
|  |             <if test="form.refundStatus != null"> | ||
|  |                 and a.refund_status = #{form.refundStatus} | ||
|  |             </if> | ||
|  |             <if test="form.goodsName != null and form.goodsName != ''"> | ||
|  |                 and d.goods_name like concat('%', #{form.goodsName}, '%') | ||
|  |             </if> | ||
|  |         </where> | ||
|  |         order by a.id desc | ||
|  |     </sql> | ||
|  | 
 | ||
|  |     <select id="page" resultType="com.hcy.common.dto.result.OrderRefundPageResultDto"> | ||
|  |         <include refid="base_list"/> | ||
|  |     </select> | ||
|  | 
 | ||
|  |     <select id="selectListByParams" resultType="com.hcy.common.dto.result.OrderRefundPageResultDto"> | ||
|  |         <include refid="base_list"/> | ||
|  |     </select> | ||
|  | </mapper> |