| | |
| | | <result column="hb_id" property="hongbaoId" jdbcType="BIGINT" /> |
| | | |
| | | <result column="co_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | |
| | | <association property="userInfo" column="co_uid" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" /> |
| | | |
| | |
| | | resultMap="com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper.BaseResultMap" /> |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | | <resultMap id="ThreeResultMap" type="com.yeshi.fanli.vo.order.CommonOrderVO"> |
| | | <id column="co_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="co_order_no" property="orderNo" jdbcType="VARCHAR" /> |
| | | <result column="co_source_type" property="sourceType" jdbcType="INTEGER" /> |
| | | <result column="co_source_position" property="sourcePosition" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="co_count" property="count" jdbcType="INTEGER" /> |
| | | <result column="co_state" property="state" jdbcType="INTEGER" /> |
| | | <result column="co_state_whole_order" property="stateWholeOrder" |
| | | jdbcType="INTEGER" /> |
| | | <result column="co_estimate" property="estimate" jdbcType="DECIMAL" /> |
| | | <result column="co_eIncome" property="eIncome" jdbcType="DECIMAL" /> |
| | | <result column="co_payment" property="payment" jdbcType="DECIMAL" /> |
| | | <result column="co_settlement" property="settlement" jdbcType="DECIMAL" /> |
| | | <result column="co_third_create_time" property="thirdCreateTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="co_settle_time" property="settleTime" jdbcType="TIMESTAMP" /> |
| | | <result column="co_order_by" property="orderBy" jdbcType="INTEGER" /> |
| | | <result column="co_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="co_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="totalMoney" property="hongBao" jdbcType="DECIMAL" /> |
| | | <result column="couponMoney" property="couponMoney" jdbcType="DECIMAL" /> |
| | | <result column="hongBaoState" property="hongBaoState" jdbcType="INTEGER" /> |
| | | <result column="hongBaoType" property="hongBaoType" jdbcType="INTEGER" /> |
| | | <result column="accountTime" property="accountTime" jdbcType="TIMESTAMP" /> |
| | | <result column="preAccountTime" property="preAccountTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="totalCount" property="totalCount" jdbcType="INTEGER" /> |
| | | <result column="totalSettlement" property="totalSettlement" |
| | | jdbcType="DECIMAL" /> |
| | | <result column="totalPayment" property="totalPayment" jdbcType="DECIMAL" /> |
| | | <result column="userId" property="userId" jdbcType="VARCHAR" /> |
| | | <result column="userName" property="userName" jdbcType="VARCHAR" /> |
| | | <result column="userPortrait" property="userPortrait" jdbcType="VARCHAR" /> |
| | | <result column="hb_id" property="hongbaoId" jdbcType="BIGINT" /> |
| | | <result column="co_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | |
| | | <association property="userInfo" column="co_uid" |
| | | select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPKey"/> |
| | | |
| | | <association property="commonOrderGoods" column="co_order_goods_id" |
| | | select="com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper.selectByPrimaryKey"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">co_id,co_uid,co_order_no,co_source_type,co_source_position,co_order_goods_id,co_count,co_state,co_state_whole_order,co_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_order_by,co_create_time,co_update_time,co_trade_id |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | |
| | | #{orderNo} AND co.co_state<![CDATA[<>]]> |
| | | 4 AND v2.hb_uid = #{uid} ORDER BY co.`co_state` DESC LIMIT 1 |
| | | </select> |
| | | <select id="listQuery" resultMap="ResultMap"> |
| | | <select id="listQuery" resultMap="ThreeResultMap"> |
| | | SELECT A.*,u.id AS userId,u.`nick_name` AS userName,u.`portrait` AS |
| | | userPortrait FROM (SELECT hb.hb_id,hb.hb_uid,hb.`hb_money` AS |
| | | totalMoney, hb.hb_state AS hongBaoState, hb.`hb_type` AS hongBaoType, |
| | | hb.`hb_get_time` AS accountTime, hb.`hb_pre_get_time` AS |
| | | preAccountTime, co.*,cog.* FROM yeshi_ec_hongbao_order ho LEFT JOIN |
| | | preAccountTime, co.* FROM yeshi_ec_hongbao_order ho LEFT JOIN |
| | | (SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1 |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | <!-- 红包类型 --> |
| | | <include refid="SELECT_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` LEFT |
| | | JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= |
| | | co.`co_order_goods_id` WHERE hb.hb_id IS NOT NULL |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE" /> |
| | | <!-- 订单状态 --> |
| | | <if test="startTime != null and startTime != '' ">AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |
| | |
| | | <include refid="SELECT_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` LEFT |
| | | JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= |
| | | co.`co_order_goods_id` WHERE hb.hb_id IS NOT NULL |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE" /> |
| | | <!-- 订单状态 --> |
| | | <if test="startTime != null and startTime != '' ">AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |