-- ----------------------------
-- Table structure for eb_user_recharge
-- ----------------------------
DROP TABLE IF EXISTS `eb_user_recharge`;
CREATE TABLE `eb_user_recharge` (
`id` int UNSIGNED NOT NULL AUTO_INCREMENT,
`uid` int NULL DEFAULT NULL COMMENT '充值用户UID',
`order_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '订单号',
`price` decimal(8, 2) NULL DEFAULT NULL COMMENT '充值金额',
`give_price` decimal(8, 2) NOT NULL DEFAULT 0.00 COMMENT '购买赠送金额',
`recharge_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '充值类型',
`paid` tinyint(1) NULL DEFAULT 0 COMMENT '是否充值',
`pay_time` timestamp NULL DEFAULT NULL COMMENT '充值支付时间',
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '充值时间',
`refund_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '退款金额',
`is_wechat_shipping` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否上传微信发货管理',
`out_trade_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '支付服务方订单号',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `order_id`(`order_id` ASC) USING BTREE,
INDEX `uid`(`uid` ASC) USING BTREE,
INDEX `recharge_type`(`recharge_type` ASC) USING BTREE,
INDEX `paid`(`paid` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户充值表' ROW_FORMAT = DYNAMIC;
这是原始SQL;但是xml里面的查询语句有问题
<select id="getAdminPage" resultType="com.zbkj.common.response.UserRechargeResponse"> select ur.*,u.nickname,u.avatar from eb_user_recharge as ur left join eb_user as u on ur.uid = u.uid where ur.paid = 1 <if test="orderNo != null and orderNo !=''"> and ur.order_no like CONCAT('%',#{orderNo},'%') </if> <if test="startTime != null and startTime != ''"> and ur.create_time between #{startTime} and #{endTime} </if> <if test="keywords != '' and keywords != null "> and ( ur.uid like CONCAT('%',#{keywords},'%') or u.nickname like CONCAT('%',#{keywords},'%') or u.phone like CONCAT('%',#{keywords},'%') ) </if> <if test="uid != null "> and ur.uid = #{uid} </if> <if test="nickname != '' and nickname != null "> and u.nickname like CONCAT('%',#{nickname},'%') </if> <if test="phone != '' and phone != null "> and u.phone like CONCAT('%',#{phone},'%') </if> order by ur.id desc</select>
压根没有(对应表 eb_user_recharge)的 order_no 字段

