<?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.ComBatteryCommodityOrderBargainMapper">
|
|
<resultMap type="com.panzhihua.service_community.entity.ComBatteryCommodityOrderBargain"
|
id="ComBatteryCommodityOrderBargainMap">
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
<result property="commodityId" column="commodity_id" jdbcType="INTEGER"/>
|
<result property="activityId" column="activity_id" jdbcType="INTEGER"/>
|
<result property="orderId" column="order_id" jdbcType="INTEGER"/>
|
<result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
|
<result property="originalPrice" column="original_price" jdbcType="VARCHAR"/>
|
<result property="targetPrice" column="target_price" jdbcType="VARCHAR"/>
|
<result property="currentPrice" column="current_price" jdbcType="VARCHAR"/>
|
<result property="count" column="count" jdbcType="INTEGER"/>
|
<result property="createAt" column="create_at" jdbcType="TIMESTAMP"/>
|
<result property="createBy" column="create_by" jdbcType="INTEGER"/>
|
</resultMap>
|
|
<!--查询单个-->
|
<select id="queryById" resultType="com.panzhihua.common.model.vos.common.ComBatteryCommodityOrderBargainVo">
|
SELECT
|
cbcob.id,
|
cbcob.user_id,
|
cbcob.commodity_id,
|
cbcob.activity_id,
|
cbcob.order_id,
|
cbcob.order_no,
|
cbcob.original_price,
|
cbcob.target_price,
|
cbcob.current_price,
|
cbcob.count,
|
cbcob.create_at,
|
cbcob.create_by,
|
su.nick_name as nickName,
|
su.image_url as imageUrl,
|
cbc.`name` as commodityName,
|
cbc.images as commodityImages,
|
cbco.bargain_status
|
FROM
|
com_battery_commodity_order_bargain as cbcob
|
left join com_battery_commodity_order as cbco on cbco.id = cbcob.order_id
|
left join com_battery_commodity as cbc on cbc.id = cbco.commodity_id
|
left join sys_user as su on su.user_id = cbcob.user_id
|
where cbcob.id = #{id}
|
</select>
|
|
<!--查询指定行数据-->
|
<select id="queryAllByLimit" resultType="com.panzhihua.common.model.vos.common.ComBatteryCommodityOrderBargainVo">
|
select
|
id, user_id, commodity_id, activity_id, order_id, order_no, original_price, target_price, current_price, count,
|
create_at, create_by
|
from com_battery_commodity_order_bargain
|
<where>
|
<if test="dto.id != null">
|
and id = #{dto.id}
|
</if>
|
<if test="dto.userId != null">
|
and user_id = #{dto.userId}
|
</if>
|
<if test="dto.commodityId != null">
|
and commodity_id = #{dto.commodityId}
|
</if>
|
<if test="dto.activityId != null">
|
and activity_id = #{dto.activityId}
|
</if>
|
<if test="dto.orderId != null">
|
and order_id = #{dto.orderId}
|
</if>
|
<if test="dto.orderNo != null and dto.orderNo != ''">
|
and order_no = #{dto.orderNo}
|
</if>
|
<if test="dto.originalPrice != null">
|
and original_price = #{dto.originalPrice}
|
</if>
|
<if test="dto.targetPrice != null">
|
and target_price = #{dto.targetPrice}
|
</if>
|
<if test="dto.currentPrice != null">
|
and current_price = #{dto.currentPrice}
|
</if>
|
<if test="dto.count != null">
|
and count = #{dto.count}
|
</if>
|
<if test="dto.createAt != null">
|
and create_at = #{dto.createAt}
|
</if>
|
<if test="dto.createBy != null">
|
and create_by = #{dto.createBy}
|
</if>
|
</where>
|
order by create_at desc
|
</select>
|
|
<!--查询所有数据-->
|
<select id="queryAllByList" resultType="com.panzhihua.common.model.vos.common.ComBatteryCommodityOrderBargainVo">
|
select
|
id, user_id, commodity_id, activity_id, order_id, order_no, original_price, target_price, current_price, count,
|
create_at, create_by
|
from com_battery_commodity_order_bargain
|
<where>
|
<if test="dto.id != null">
|
and id = #{dto.id}
|
</if>
|
<if test="dto.userId != null">
|
and user_id = #{dto.userId}
|
</if>
|
<if test="dto.commodityId != null">
|
and commodity_id = #{dto.commodityId}
|
</if>
|
<if test="dto.activityId != null">
|
and activity_id = #{dto.activityId}
|
</if>
|
<if test="dto.orderId != null">
|
and order_id = #{dto.orderId}
|
</if>
|
<if test="dto.orderNo != null and dto.orderNo != ''">
|
and order_no = #{dto.orderNo}
|
</if>
|
<if test="dto.originalPrice != null">
|
and original_price = #{dto.originalPrice}
|
</if>
|
<if test="dto.targetPrice != null">
|
and target_price = #{dto.targetPrice}
|
</if>
|
<if test="dto.currentPrice != null">
|
and current_price = #{dto.currentPrice}
|
</if>
|
<if test="dto.count != null">
|
and count = #{dto.count}
|
</if>
|
<if test="dto.createAt != null">
|
and create_at = #{dto.createAt}
|
</if>
|
<if test="dto.createBy != null">
|
and create_by = #{dto.createBy}
|
</if>
|
</where>
|
order by create_at desc
|
</select>
|
|
</mapper>
|