| | |
| | | <result column="co_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | <result column="co_state_desc" property="stateDesc" jdbcType="VARCHAR" /> |
| | | <result column="co_urank" property="urank" jdbcType="INTEGER" /> |
| | | <result column="co_child_source_type" property="childSourceType" |
| | | jdbcType="VARCHAR" /> |
| | | <association property="userInfo" column="co_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="co_uid" property="id" jdbcType="BIGINT" /> |
| | |
| | | <result column="co_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | <result column="co_state_desc" property="stateDesc" jdbcType="VARCHAR" /> |
| | | <result column="co_urank" property="urank" jdbcType="INTEGER" /> |
| | | <result column="co_child_source_type" property="childSourceType" |
| | | jdbcType="VARCHAR" /> |
| | | <association property="userInfo" column="co_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="co_uid" property="id" jdbcType="BIGINT" /> |
| | |
| | | <result column="shared" property="shared" jdbcType="BIGINT" /> |
| | | <result column="invite" property="invite" jdbcType="BIGINT" /> |
| | | </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,co_state_desc,co_urank |
| | | <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,co_state_desc,co_urank,co_child_source_type |
| | | </sql> |
| | | <sql id="Order_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, |
| | |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.CommonOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_order |
| | | (co_id,co_uid,co_order_no,co_source_type,co_source_position,co_order_goods_id,co_count,co_state,co_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_create_time,co_update_time,co_state_whole_order,co_order_by,co_trade_id,co_state_desc,co_urank) |
| | | (co_id,co_uid,co_order_no,co_source_type,co_source_position,co_order_goods_id,co_count,co_state,co_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_create_time,co_update_time,co_state_whole_order,co_order_by,co_trade_id,co_state_desc,co_urank,co_child_source_type) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{sourcePosition,jdbcType=VARCHAR},#{commonOrderGoods.id,jdbcType=BIGINT},#{count,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{estimate,jdbcType=DECIMAL},#{eIncome,jdbcType=DECIMAL},#{payment,jdbcType=DECIMAL},#{settlement,jdbcType=DECIMAL},#{thirdCreateTime,jdbcType=TIMESTAMP},#{settleTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{stateWholeOrder,jdbcType=INTEGER},#{orderBy,jdbcType=INTEGER},#{tradeId,jdbcType=VARCHAR},#{stateDesc,jdbcType=VARCHAR},#{urank,jdbcType=INTEGER}) |
| | | (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{sourcePosition,jdbcType=VARCHAR},#{commonOrderGoods.id,jdbcType=BIGINT},#{count,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{estimate,jdbcType=DECIMAL},#{eIncome,jdbcType=DECIMAL},#{payment,jdbcType=DECIMAL},#{settlement,jdbcType=DECIMAL},#{thirdCreateTime,jdbcType=TIMESTAMP},#{settleTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{stateWholeOrder,jdbcType=INTEGER},#{orderBy,jdbcType=INTEGER},#{tradeId,jdbcType=VARCHAR},#{stateDesc,jdbcType=VARCHAR},#{urank,jdbcType=INTEGER},#{childSourceType,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.CommonOrder" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="tradeId != null">co_trade_id,</if> |
| | | <if test="stateDesc != null">co_state_desc,</if> |
| | | <if test="urank != null">co_urank,</if> |
| | | <if test="childSourceType != null">co_child_source_type,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="tradeId != null">#{tradeId,jdbcType=VARCHAR},</if> |
| | | <if test="stateDesc != null">#{stateDesc,jdbcType=VARCHAR},</if> |
| | | <if test="urank != null">#{urank,jdbcType=INTEGER}</if> |
| | | <if test="urank != null">#{urank,jdbcType=INTEGER},</if> |
| | | <if test="childSourceType != null">#{childSourceType,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.CommonOrder">update |
| | |
| | | #{updateTime,jdbcType=TIMESTAMP} ,co_trade_id |
| | | =#{tradeId,jdbcType=VARCHAR},co_state_desc |
| | | =#{stateDesc,jdbcType=VARCHAR} ,co_urank =#{urank,jdbcType=INTEGER} |
| | | where co_id = #{id,jdbcType=BIGINT} |
| | | ,co_child_source_type =#{childSourceType,jdbcType=VARCHAR} where co_id |
| | | = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.CommonOrder"> |
| | | update yeshi_ec_common_order |
| | |
| | | <if test="orderBy != null">co_order_by=#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">co_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">co_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="id !=null">co_id =#{id,jdbcType=BIGINT},</if> |
| | | <if test="tradeId !=null">co_trade_id =#{tradeId,jdbcType=VARCHAR},</if> |
| | | <if test="stateDesc !=null">co_state_desc =#{stateDesc,jdbcType=VARCHAR},</if> |
| | | <if test="urank !=null">co_urank =#{urank,jdbcType=INTEGER},</if> |
| | | <if test="childSourceType !=null">co_child_source_type=#{childSourceType,jdbcType=VARCHAR}, |
| | | </if> |
| | | </set> |
| | | where co_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | <!-- 订单号查询 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | <!-- 订单来源 --> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" close=")" separator="or"> |
| | | co.co_source_type = #{item} |
| | | </foreach> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" |
| | | close=")" separator="or">co.co_source_type = #{item}</foreach> |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` ORDER BY |
| | | co.co_third_create_time DESC LIMIT ${start},${count} |
| | |
| | | <!-- 订单号查询 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | <!-- 订单来源 --> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" close=")" separator="or"> |
| | | co.co_source_type = #{item} |
| | | </foreach> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" |
| | | close=")" separator="or">co.co_source_type = #{item}</foreach> |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |
| | |
| | | '%Y%m'),DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1 |
| | | </if> |
| | | <!-- 订单来源 --> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" close=")" separator="or"> |
| | | co.co_source_type = #{item} |
| | | </foreach> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" |
| | | close=")" separator="or">co.co_source_type = #{item}</foreach> |
| | | </if> |
| | | </sql> |
| | | <select id="getOrderCount" resultMap="OrderCountMap"> |
| | |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <!-- 订单时间 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | |
| | | <if test="payment != null"> |
| | | AND co.co_payment <![CDATA[<]]> #{payment} |
| | | <if test="payment != null">AND |
| | | co.co_payment <![CDATA[<]]> |
| | | #{payment} |
| | | </if> |
| | | |
| | | ORDER BY co.co_third_create_time DESC LIMIT ${start},${count} |
| | | </select> |
| | | <select id="countQueryByUid" resultType="java.lang.Long"> |
| | |
| | | </if> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | <if test="payment != null"> |
| | | AND co.co_payment <![CDATA[<]]> #{payment} |
| | | <if test="payment != null">AND |
| | | co.co_payment <![CDATA[<]]> |
| | | #{payment} |
| | | </if> |
| | | ORDER BY co.co_third_create_time DESC LIMIT ${start},${count} ) A LEFT |
| | | JOIN yeshi_ec_user u ON u.id = A.hb_uid |
| | |
| | | <foreach collection="listShopId" item="shopId" open=" and (" |
| | | separator=" or " close=")">g.`cog_shop_id` =#{shopId}</foreach> |
| | | </if> |
| | | <if test="payment != null"> |
| | | AND co.co_payment <![CDATA[<]]> #{payment} |
| | | <if test="payment != null">AND |
| | | co.co_payment <![CDATA[<]]> |
| | | #{payment} |
| | | </if> |
| | | <if test="minTime != null"> |
| | | <!-- 高风险订单 --> |
| | |
| | | <if test="keyType == 1 ">AND co.co_order_no = '${key}'</if> |
| | | <if test="keyType == 2 ">AND hb.hb_uid = ${key}</if> |
| | | </if> |
| | | <if test="payment != null"> |
| | | AND co.co_payment <![CDATA[<]]> #{payment} |
| | | <if test="payment != null">AND |
| | | co.co_payment <![CDATA[<]]> |
| | | #{payment} |
| | | </if> |
| | | <!-- 订单来源 --> |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | |
| | | DATE_SUB(NOW(), INTERVAL 1 DAY) GROUP BY |
| | | co.`co_order_no`,co.`co_source_type`)A |
| | | </select> |
| | | |
| | | <select id="searchOrderByUid" resultMap="ResultMap"> |
| | | SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalMoney, hb.hb_state AS hongBaoState, hb.`hb_type` AS hongBaoType, |
| | | MAX(hb.`hb_get_time`) AS accountTime, MAX(hb.`hb_pre_get_time`) AS preAccountTime, <include refid="Order_Column_List" /> |
| | | FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN (SELECT <include refid="Hongbao_Column_List" /> FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<>10]]>)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` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <foreach collection="list" item="esOrder" open=" and (" close=")" separator=" or "> |
| | | (co.co_trade_id=#{esOrder.tradeId} AND co.co_source_type = #{esOrder.platform}) |
| | | SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalMoney, hb.hb_state AS |
| | | hongBaoState, hb.`hb_type` AS hongBaoType, MAX(hb.`hb_get_time`) AS |
| | | accountTime, MAX(hb.`hb_pre_get_time`) AS preAccountTime, |
| | | <include refid="Order_Column_List" /> |
| | | FROM yeshi_ec_hongbao_order ho LEFT JOIN (SELECT |
| | | <include refid="Hongbao_Column_List" /> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<>10]]>)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` WHERE |
| | | hb.hb_id IS NOT NULL |
| | | <foreach collection="list" item="esOrder" open=" and (" close=")" |
| | | separator=" or ">(co.co_trade_id=#{esOrder.tradeId} AND co.co_source_type = |
| | | #{esOrder.platform}) |
| | | </foreach> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` |
| | | ORDER BY co.co_third_create_time DESC |
| | | LIMIT ${start},${count} |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` ORDER BY |
| | | co.co_third_create_time DESC LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countSearchOrderByUid" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(ho_id),0) FROM (SELECT ho.ho_id FROM |
| | | yeshi_ec_hongbao_order ho LEFT JOIN (SELECT <include refid="Hongbao_Column_List" /> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]> |
| | | yeshi_ec_hongbao_order ho LEFT JOIN (SELECT |
| | | <include refid="Hongbao_Column_List" /> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]> |
| | | )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` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <foreach collection="list" item="esOrder" open=" and (" close=")" separator=" or "> |
| | | (co.co_trade_id=#{esOrder.tradeId} AND co.co_source_type = #{esOrder.platform}) |
| | | <foreach collection="list" item="esOrder" open=" and (" close=")" |
| | | separator=" or ">(co.co_trade_id=#{esOrder.tradeId} AND co.co_source_type = |
| | | #{esOrder.platform}) |
| | | </foreach> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |
| | | |
| | | <select id="getMinSettleTimeAndUid" resultMap="BaseResultMap"> |
| | | SELECT d.`co_uid`,MAX(d.`co_settle_time`) AS co_settle_time FROM `yeshi_ec_common_order` d |
| | | WHERE d.`co_settle_time` IS NOT NULL AND d.`co_payment` > 1 |
| | | GROUP BY d.`co_uid` |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getMinSettleTimeAndUid" resultMap="BaseResultMap">SELECT |
| | | d.`co_uid`,MAX(d.`co_settle_time`) AS co_settle_time FROM |
| | | `yeshi_ec_common_order` d WHERE d.`co_settle_time` IS NOT NULL AND |
| | | d.`co_payment` > 1 GROUP BY d.`co_uid`</select> |
| | | <select id="getOrderList" resultMap="ResultMap"> |
| | | SELECT hb.`hb_type` AS hongBaoType, MAX(hb.`hb_get_time`) AS |
| | | accountTime, MAX(hb.`hb_pre_get_time`) AS preAccountTime, |
| | |
| | | <!-- 订单号查询 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | <!-- 订单来源 --> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" close=")" separator="or"> |
| | | co.co_source_type = #{item} |
| | | </foreach> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" |
| | | close=")" separator="or">co.co_source_type = #{item}</foreach> |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` ORDER BY |
| | | co.co_third_create_time DESC LIMIT ${start},${count} |
| | |
| | | <!-- 订单号查询 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | <!-- 订单来源 --> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" close=")" separator="or"> |
| | | co.co_source_type = #{item} |
| | | </foreach> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" |
| | | close=")" separator="or">co.co_source_type = #{item}</foreach> |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |
| | | |
| | | <select id="countOrderByUidAndSettled" resultType="Long"> |
| | | SELECT COUNT(d.`co_id`) FROM `yeshi_ec_common_order` d |
| | | WHERE d.`co_uid` = #{uid} AND d.`co_settle_time` IS NOT NULL AND d.`co_payment` >= #{payment} |
| | | <select id="countOrderByUidAndSettled" resultType="Long">SELECT |
| | | COUNT(d.`co_id`) FROM `yeshi_ec_common_order` d WHERE d.`co_uid` = |
| | | #{uid} AND d.`co_settle_time` IS NOT NULL AND d.`co_payment` >= |
| | | #{payment} |
| | | </select> |
| | | </mapper> |