| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_common_order where co_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!--测试 --> |
| | | <select id="test" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | SELECT co.`co_order_no`,co.`co_source_type`,SUM(co.`co_settlement`) as co_settlement,co.`co_uid`,co.`co_third_create_time` FROM yeshi_ec_common_order co LEFT JOIN yeshi_ec_threesale s ON s.`worker_id`=co.`co_uid` LEFT JOIN yeshi_ec_user_invite_valid_record r ON r.`tvr_uid`=s.`worker_id` WHERE s.`id`>0 AND r.`tvr_id` IS NULL AND co.`co_state`=2 AND co.`co_settle_time`>'2020-07-01' AND '2020-07-27 17:00:00'> co.`co_settle_time` GROUP BY co.`co_order_no`,co.`co_source_type` |
| | | </select> |
| | | |
| | | |
| | | <select id="countByOrderNOAndOrderType" resultType="java.lang.Integer">select |
| | | count(co_id) from yeshi_ec_common_order where co_order_no=#{orderNO} |
| | | and co_source_type=#{orderType} |
| | |
| | | co.co_source_type=#{sourceType} |
| | | <if test="tradeIdList!=null"> |
| | | <foreach collection="tradeIdList" item="tradeId" open=" and (" |
| | | close=")" separator=" or ">co.co_trade_id=#{tradeId}</foreach> |
| | | close=")" separator=" or ">co.co_trade_id=#{tradeId} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="listBySourceTypeAndStateAndThirdCrateTime" |
| | |
| | | co.co_source_type=#{sourceType} |
| | | <if test="state!=null">and co_state=#{state}</if> |
| | | <if test="minTime!=null">and |
| | | UNIX_TIMESTAMP(co_third_create_time)*1000>=#{minTime}</if> |
| | | UNIX_TIMESTAMP(co_third_create_time)*1000>=#{minTime} |
| | | </if> |
| | | <if test="maxTime!=null">and #{maxTime}> |
| | | UNIX_TIMESTAMP(co_third_create_time)*1000 |
| | | </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> |
| | | close=")" separator="or">co.co_source_type = #{item} |
| | | </foreach> |
| | | </if> |
| | | <![CDATA[AND co.co_source_type <> 4 AND co.co_source_type <> 5]]> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` ORDER BY |
| | |
| | | <!-- 订单来源 --> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" |
| | | close=")" separator="or">co.co_source_type = #{item}</foreach> |
| | | close=")" separator="or">co.co_source_type = #{item} |
| | | </foreach> |
| | | </if> |
| | | <![CDATA[AND co.co_source_type <> 4 AND co.co_source_type <> 5]]> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | |
| | | <!-- 订单来源 --> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" |
| | | close=")" separator="or">co.co_source_type = #{item}</foreach> |
| | | close=")" separator="or">co.co_source_type = #{item} |
| | | </foreach> |
| | | </if> |
| | | </sql> |
| | | <select id="getOrderCount" resultMap="OrderCountMap"> |
| | |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | <if test="listGoodsId != null"> |
| | | <foreach collection="listGoodsId" item="goodsId" open=" and (" |
| | | separator=" or " close=")">co.`co_order_goods_id` =#{goodsId}</foreach> |
| | | separator=" or " close=")">co.`co_order_goods_id` =#{goodsId} |
| | | </foreach> |
| | | </if> |
| | | <if test="listShopId != null"> |
| | | <foreach collection="listShopId" item="shopId" open=" and (" |
| | | separator=" or " close=")">g.`cog_shop_id` =#{shopId}</foreach> |
| | | separator=" or " close=")">g.`cog_shop_id` =#{shopId} |
| | | </foreach> |
| | | </if> |
| | | <if test="minTime != null"> |
| | | <!-- 高风险订单 --> |
| | | AND co.`co_third_create_time`>#{minTime} AND<![CDATA[ (co.`co_estimate`>= ${money} OR co.`co_eIncome`> ${money})]]> |
| | | AND co.`co_third_create_time`>#{minTime} AND |
| | | <![CDATA[ (co.`co_estimate`>= ${money} OR co.`co_eIncome`> ${money})]]> |
| | | </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 |
| | |
| | | <if test="source != null">AND co.co_source_type = #{source}</if> |
| | | <if test="listGoodsId != null"> |
| | | <foreach collection="listGoodsId" item="goodsId" open=" and (" |
| | | separator=" or " close=")">co.`co_order_goods_id` =#{goodsId}</foreach> |
| | | separator=" or " close=")">co.`co_order_goods_id` =#{goodsId} |
| | | </foreach> |
| | | </if> |
| | | <if test="listShopId != null"> |
| | | <foreach collection="listShopId" item="shopId" open=" and (" |
| | | separator=" or " close=")">g.`cog_shop_id` =#{shopId}</foreach> |
| | | separator=" or " close=")">g.`cog_shop_id` =#{shopId} |
| | | </foreach> |
| | | </if> |
| | | <if test="payment != null">AND |
| | | co.co_payment <![CDATA[<]]> |
| | |
| | | </if> |
| | | <if test="minTime != null"> |
| | | <!-- 高风险订单 --> |
| | | AND co.`co_third_create_time`>#{minTime} AND<![CDATA[ (co.`co_estimate`>= ${money} OR co.`co_eIncome`> ${money})]]> |
| | | AND co.`co_third_create_time`>#{minTime} AND |
| | | <![CDATA[ (co.`co_estimate`>= ${money} OR co.`co_eIncome`> ${money})]]> |
| | | </if> |
| | | </select> |
| | | <select id="countQueryWithNoChild" resultType="java.lang.Long"> |
| | |
| | | SELECT * FROM yeshi_ec_common_order co WHERE co_uid = #{uid} |
| | | <if test="stateList!=null"> |
| | | <foreach collection="stateList" separator=" or " open="and (" |
| | | item="state" close=")">co_state=#{state}</foreach> |
| | | item="state" close=")">co_state=#{state} |
| | | </foreach> |
| | | </if> |
| | | limit #{start},#{count} |
| | | </select> |
| | |
| | | <!-- 订单来源 --> |
| | | <if test="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" |
| | | close=")" separator="or">co.co_source_type = #{item}</foreach> |
| | | 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="listSource != null and listSource.size() > 0"> |
| | | <foreach collection="listSource" item="item" open="AND (" |
| | | close=")" separator="or">co.co_source_type = #{item}</foreach> |
| | | close=")" separator="or">co.co_source_type = #{item} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |