<?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.panzhihua.service_community.dao.ComBatteryCommodityOrderMapper">
|
|
<resultMap type="com.panzhihua.service_community.entity.ComBatteryCommodityOrder" id="ComBatteryCommodityOrderMap">
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
<result property="storeId" column="store_id" jdbcType="INTEGER"/>
|
<result property="addressId" column="address_id" jdbcType="INTEGER"/>
|
<result property="activityId" column="activity_id" jdbcType="INTEGER"/>
|
<result property="commodityId" column="commodity_id" jdbcType="INTEGER"/>
|
<result property="specsId" column="specs_id" jdbcType="INTEGER"/>
|
<result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
|
<result property="activityType" column="activity_type" jdbcType="INTEGER"/>
|
<result property="status" column="status" jdbcType="INTEGER"/>
|
<result property="collageStatus" column="collage_status" jdbcType="INTEGER"/>
|
<result property="bargainStatus" column="bargain_status" jdbcType="INTEGER"/>
|
<result property="payStatus" column="pay_status" jdbcType="INTEGER"/>
|
<result property="isDel" column="is_del" jdbcType="INTEGER"/>
|
<result property="payType" column="pay_type" jdbcType="INTEGER"/>
|
<result property="count" column="count" jdbcType="INTEGER"/>
|
<result property="price" column="price" jdbcType="VARCHAR"/>
|
<result property="amount" column="amount" jdbcType="VARCHAR"/>
|
<result property="freight" column="freight" jdbcType="VARCHAR"/>
|
<result property="logisticsNo" column="logistics_no" jdbcType="VARCHAR"/>
|
<result property="logisticsCompany" column="logistics_company" jdbcType="VARCHAR"/>
|
<result property="finalAmount" column="final_amount" jdbcType="VARCHAR"/>
|
<result property="payNo" column="pay_no" jdbcType="VARCHAR"/>
|
<result property="payAmount" column="pay_amount" jdbcType="VARCHAR"/>
|
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
<result property="deliveryTime" column="delivery_time" jdbcType="TIMESTAMP"/>
|
<result property="receivingTime" column="receiving_time" jdbcType="TIMESTAMP"/>
|
<result property="createAt" column="create_at" jdbcType="TIMESTAMP"/>
|
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
<result property="updateAt" column="update_at" jdbcType="TIMESTAMP"/>
|
<result property="updateBy" column="update_by" jdbcType="INTEGER"/>
|
<result property="receivingName" column="receiving_name" jdbcType="VARCHAR"/>
|
<result property="receivingPhone" column="receiving_phone" jdbcType="VARCHAR"/>
|
<result property="receivingRegion" column="receiving_region" jdbcType="VARCHAR"/>
|
<result property="receivingAddress" column="receiving_address" jdbcType="VARCHAR"/>
|
</resultMap>
|
|
<!--查询单个-->
|
<select id="queryById" resultType="com.panzhihua.common.model.vos.common.ComBatteryCommodityOrderVo">
|
SELECT
|
cbco.id,
|
cbco.user_id,
|
cbco.store_id,
|
cbco.address_id,
|
cbco.activity_id,
|
cbco.commodity_id,
|
cbco.specs_id,
|
cbco.order_no,
|
cbco.activity_type,
|
cbco.`status`,
|
cbco.collage_status,
|
cbco.bargain_status,
|
cbco.pay_status,
|
cbco.pay_type,
|
cbco.count,
|
cbco.price,
|
cbco.amount,
|
cbco.freight,
|
cbco.logistics_no,
|
cbco.logistics_company,
|
cbco.final_amount,
|
cbco.pay_no,
|
cbco.pay_amount,
|
cbco.remark,
|
cbco.delivery_time,
|
cbco.receiving_time,
|
cbco.create_at,
|
cbco.create_by,
|
cbco.update_at,
|
cbco.update_by,
|
cbco.receiving_name,
|
cbco.receiving_phone,
|
cbco.receiving_region_code,
|
cbco.receiving_region,
|
cbco.receiving_address,
|
su.phone,
|
cbc.`name` as commodityName,
|
cbcs.`name` as specsName
|
FROM
|
com_battery_commodity_order AS cbco
|
left join sys_user as su on su.user_id = cbco.user_id
|
left join com_battery_commodity as cbc on cbc.id = cbco.commodity_id
|
left join com_battery_commodity_specs as cbcs on cbcs.id = cbco.specs_id
|
where cbco.id = #{id}
|
</select>
|
|
<!--查询指定行数据-->
|
<select id="queryAllByLimit" resultType="com.panzhihua.common.model.vos.common.ComBatteryCommodityOrderVo">
|
SELECT
|
cbco.id,
|
cbco.user_id,
|
cbco.store_id,
|
cbco.address_id,
|
cbco.activity_id,
|
cbco.commodity_id,
|
cbco.specs_id,
|
cbco.order_no,
|
cbco.activity_type,
|
cbco.`status`,
|
cbco.collage_status,
|
cbco.bargain_status,
|
cbco.pay_status,
|
cbco.pay_type,
|
cbco.count,
|
cbco.price,
|
cbco.amount,
|
cbco.freight,
|
cbco.logistics_no,
|
cbco.logistics_company,
|
cbco.final_amount,
|
cbco.pay_no,
|
cbco.pay_amount,
|
cbco.remark,
|
cbco.delivery_time,
|
cbco.receiving_time,
|
cbco.create_at,
|
cbco.create_by,
|
cbco.update_at,
|
cbco.update_by,
|
cbco.receiving_name,
|
cbco.receiving_phone,
|
cbco.receiving_region_code,
|
cbco.receiving_region,
|
cbco.receiving_address,
|
su.phone,
|
su.nick_name as nickName,
|
cbc.`name` as commodityName,
|
cbcs.`images` as commodityImages,
|
cbcs.`name` as specsName
|
FROM
|
com_battery_commodity_order AS cbco
|
left join sys_user as su on su.user_id = cbco.user_id
|
left join com_battery_commodity as cbc on cbc.id = cbco.commodity_id
|
left join com_battery_commodity_specs as cbcs on cbcs.id = cbco.specs_id
|
<where>
|
and cbco.is_del = 2
|
<if test="dto.id != null">
|
and cbco.id = #{dto.id}
|
</if>
|
<if test="dto.userId != null">
|
and cbco.user_id = #{dto.userId}
|
</if>
|
<if test="dto.storeId != null">
|
and cbco.store_id = #{dto.storeId}
|
</if>
|
<if test="dto.activityId != null">
|
and cbco.activity_id = #{dto.activityId}
|
</if>
|
<if test="dto.orderNo != null and dto.orderNo != ''">
|
and cbco.order_no = #{dto.orderNo}
|
</if>
|
<if test="dto.activityType != null">
|
and cbco.activity_type = #{dto.activityType}
|
</if>
|
<if test="dto.status != null">
|
and cbco.status = #{dto.status}
|
</if>
|
<if test="dto.collageStatus != null">
|
and cbco.collage_status = #{dto.collageStatus}
|
</if>
|
<if test="dto.bargainStatus != null">
|
and cbco.bargain_status = #{dto.bargainStatus}
|
</if>
|
<if test="dto.payStatus != null">
|
and cbco.pay_status = #{dto.payStatus}
|
</if>
|
<if test="dto.payType != null">
|
and cbco.pay_type = #{dto.payType}
|
</if>
|
<if test="dto.isApplets != null and dto.isApplets == 1">
|
and cbco.status in (2,3,4)
|
</if>
|
<if test="dto.isAdmin != null and dto.isAdmin == 1">
|
and cbco.status in (2,3,4)
|
</if>
|
<if test="dto.payNo != null and dto.payNo != ''">
|
and cbco.pay_no = #{dto.payNo}
|
</if>
|
</where>
|
order by cbco.create_at desc
|
</select>
|
|
<!--查询所有数据-->
|
<select id="queryAllByList" resultType="com.panzhihua.common.model.vos.common.ComBatteryCommodityOrderVo">
|
SELECT
|
cbco.id,
|
cbco.user_id,
|
cbco.store_id,
|
cbco.address_id,
|
cbco.activity_id,
|
cbco.commodity_id,
|
cbco.specs_id,
|
cbco.order_no,
|
cbco.activity_type,
|
cbco.`status`,
|
cbco.collage_status,
|
cbco.bargain_status,
|
cbco.pay_status,
|
cbco.pay_type,
|
cbco.count,
|
cbco.price,
|
cbco.amount,
|
cbco.freight,
|
cbco.logistics_no,
|
cbco.logistics_company,
|
cbco.final_amount,
|
cbco.pay_no,
|
cbco.pay_amount,
|
cbco.remark,
|
cbco.delivery_time,
|
cbco.receiving_time,
|
cbco.create_at,
|
cbco.create_by,
|
cbco.update_at,
|
cbco.update_by,
|
cbco.receiving_name,
|
cbco.receiving_phone,
|
cbco.receiving_region_code,
|
cbco.receiving_region,
|
cbco.receiving_address,
|
su.phone,
|
cbc.`name` as commodityName,
|
cbcs.`images` as commodityImages,
|
cbcs.`name` as specsName
|
FROM
|
com_battery_commodity_order AS cbco
|
left join sys_user as su on su.user_id = cbco.user_id
|
left join com_battery_commodity as cbc on cbc.id = cbco.commodity_id
|
left join com_battery_commodity_specs as cbcs on cbcs.id = cbco.specs_id
|
<where>
|
and cbco.is_del = 2
|
<if test="dto.id != null">
|
and cbco.id = #{dto.id}
|
</if>
|
<if test="dto.userId != null">
|
and cbco.user_id = #{dto.userId}
|
</if>
|
<if test="dto.storeId != null">
|
and cbco.store_id = #{dto.storeId}
|
</if>
|
<if test="dto.activityId != null">
|
and cbco.activity_id = #{dto.activityId}
|
</if>
|
<if test="dto.orderNo != null and dto.orderNo != ''">
|
and cbco.order_no = #{dto.orderNo}
|
</if>
|
<if test="dto.activityType != null">
|
and cbco.activity_type = #{dto.activityType}
|
</if>
|
<if test="dto.status != null">
|
and cbco.status = #{dto.status}
|
</if>
|
<if test="dto.collageStatus != null">
|
and cbco.collage_status = #{dto.collageStatus}
|
</if>
|
<if test="dto.bargainStatus != null">
|
and cbco.bargain_status = #{dto.bargainStatus}
|
</if>
|
<if test="dto.payStatus != null">
|
and cbco.pay_status = #{dto.payStatus}
|
</if>
|
<if test="dto.payType != null">
|
and cbco.pay_type = #{dto.payType}
|
</if>
|
<if test="dto.payNo != null and dto.payNo != ''">
|
and cbco.pay_no = #{dto.payNo}
|
</if>
|
</where>
|
order by cbco.create_at desc
|
</select>
|
|
<select id="queryTeamIdByUserId" resultType="com.panzhihua.common.model.vos.common.ComBatteryActivityTeamVo">
|
select id as teamId,create_at as teamEndTime from com_battery_commodity_order_collage_team
|
where activity_id = #{activityId} and user_id = #{userId} and status = 1
|
</select>
|
|
<select id="queryTeamIdByUserIdBargain" resultType="com.panzhihua.common.model.vos.common.ComBatteryActivityTeamVo">
|
select cbcob.id as teamId,cbcob.create_at as teamEndTime from com_battery_commodity_order_bargain as cbcob
|
left join com_battery_commodity_order as cbco on cbco.id = cbcob.order_id
|
where cbcob.user_id = #{userId} and cbcob.activity_id = #{activityId} and cbco.bargain_status = 1
|
</select>
|
|
</mapper>
|