| | |
| | | <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" /> |
| | | |
| | |
| | | <association property="commonOrderGoods" column="co_order_goods_id" |
| | | javaType="com.yeshi.fanli.entity.order.CommonOrderGoods"> |
| | | <id column="co_order_goods_id" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | |
| | | <resultMap id="BaseDetailResultMap" type="com.yeshi.fanli.entity.order.CommonOrder"> |
| | | <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_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" /> |
| | | |
| | | <association property="userInfo" column="co_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="co_uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | <association property="commonOrderGoods" resultMap="com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper.BaseResultMap"> |
| | | |
| | | </association> |
| | | </resultMap> |
| | | |
| | |
| | | <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" /> |
| | | |
| | |
| | | |
| | | </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_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_create_time,co_update_time |
| | | <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_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_order_by,co_create_time,co_update_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | count(co_id) from yeshi_ec_common_order where co_order_no=#{orderNO} |
| | | and co_source_type=#{orderType} |
| | | </select> |
| | | |
| | | <select id="selectByOrderNoAndOrderTypeAndOrderBy" resultMap="BaseResultMap"> |
| | | select |
| | | * from yeshi_ec_common_order where co_order_no=#{orderNo} |
| | | and |
| | | co_source_type=#{orderType} and co_order_by=#{orderBy} |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_common_order where co_id = #{id,jdbcType=BIGINT}</delete> |
| | | yeshi_ec_common_order where co_id = #{id,jdbcType=BIGINT} |
| | | </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) |
| | |
| | | <if test="settlement != null">co_settlement,</if> |
| | | <if test="thirdCreateTime != null">co_third_create_time,</if> |
| | | <if test="settleTime != null">co_settle_time,</if> |
| | | <if test="orderBy != null">co_order_by,</if> |
| | | <if test="createTime != null">co_create_time,</if> |
| | | <if test="updateTime != null">co_update_time,</if> |
| | | </trim> |
| | |
| | | <if test="settlement != null">#{settlement,jdbcType=DECIMAL},</if> |
| | | <if test="thirdCreateTime != null">#{thirdCreateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="settleTime != null">#{settleTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | |
| | | #{payment,jdbcType=DECIMAL},co_settlement = |
| | | #{settlement,jdbcType=DECIMAL},co_third_create_time = |
| | | #{thirdCreateTime,jdbcType=TIMESTAMP},co_settle_time = |
| | | #{settleTime,jdbcType=TIMESTAMP},co_create_time = |
| | | #{settleTime,jdbcType=TIMESTAMP},co_order_by = |
| | | #{orderBy,jdbcType=INTEGER},co_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},co_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where co_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | <if test="thirdCreateTime != null">co_third_create_time=#{thirdCreateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="settleTime != null">co_settle_time=#{settleTime,jdbcType=TIMESTAMP},</if> |
| | | <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> |
| | | </set> |
| | |
| | | <select id="listGroupOrderNoByUid" resultMap="ResultMap"> |
| | | SELECT COALESCE(SUM(th.`hb_money`),0)AS totalMoney,tc.*,th.hb_state AS |
| | | hongBaoState, th.hb_type AS hongBaoType, |
| | | th.hb_get_time AS accountTime,th.hb_get_time AS accountTime,th.hb_pre_get_time AS |
| | | th.hb_get_time AS |
| | | accountTime,th.hb_get_time AS accountTime,th.hb_pre_get_time AS |
| | | preAccountTime |
| | | FROM yeshi_ec_common_order tc |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | LEFT JOIN |
| | | yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN |
| | | yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | th.`hb_pid` = tr.`ho_hongbao_id` ) |
| | | WHERE th.`hb_uid` = #{uid} |
| | | <if test="state != null and state == 1"> <!-- 未到账 --> |
| | |
| | | DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1 |
| | | </if> |
| | | GROUP BY tc.`co_order_no`,tc.co_source_type |
| | | ORDER BY tc.co_create_time DESC |
| | | ORDER BY tc.co_create_time |
| | | DESC |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countGroupOrderNoByUid" resultType="java.lang.Long"> |
| | | SELECT IFNULL(COUNT(DISTINCT tc.`co_order_no`,tc.`co_source_type`),0) |
| | | FROM yeshi_ec_common_order tc |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON |
| | | tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON |
| | | (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | th.`hb_pid` = tr.`ho_hongbao_id` ) |
| | | WHERE th.`hb_uid` = #{uid} |
| | | <if test="state != null and state == 1"> <!-- 未到账 --> |
| | |
| | | SELECT COALESCE(SUM(tc.`co_settlement`),0)AS |
| | | totalSettlement,COALESCE(SUM(tc.`co_count`),0)AS |
| | | totalCount,tc.`co_source_type`,tc.`co_order_no`,tg.* |
| | | FROM yeshi_ec_common_order_goods tg |
| | | LEFT JOIN yeshi_ec_common_order tc ON tc.`co_order_goods_id` = tg.`cog_id` |
| | | FROM |
| | | yeshi_ec_common_order_goods tg |
| | | LEFT JOIN yeshi_ec_common_order tc ON |
| | | tc.`co_order_goods_id` = tg.`cog_id` |
| | | WHERE |
| | | <foreach collection="list" item="item" separator=" OR "> |
| | | (tc.`co_source_type` = #{item.sourceType,jdbcType=INTEGER} AND |
| | |
| | | SELECT IFNULL(COUNT(DISTINCT |
| | | tc.`co_order_no`,tc.`co_source_type`),0) AS self,0 AS shared,0 AS |
| | | invite FROM yeshi_ec_common_order tc |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_order |
| | | tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT |
| | | JOIN yeshi_ec_hongbao_v2 th ON tr.`ho_hongbao_id` = th.`hb_id` |
| | | JOIN yeshi_ec_hongbao_v2 th ON |
| | | tr.`ho_hongbao_id` = th.`hb_id` |
| | | WHERE |
| | | th.`hb_uid` = ${uid} |
| | | AND (th.`hb_type` = 1 OR th.`hb_type` = 2) |
| | | AND |
| | | (th.`hb_type` = 1 OR th.`hb_type` = 2) |
| | | <if test="day != null and day == 1"> |
| | | AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | |
| | | SELECT 0 AS self, IFNULL(COUNT(DISTINCT |
| | | tc.`co_order_no`,tc.`co_source_type`),0) AS shared,0 AS invite FROM |
| | | yeshi_ec_common_order tc |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON |
| | | tr.`ho_order_id` = tc.`co_id` |
| | | LEFT |
| | | JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | JOIN yeshi_ec_hongbao_v2 th ON |
| | | (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | th.`hb_pid` = tr.`ho_hongbao_id` ) |
| | | WHERE th.`hb_uid` = ${uid} |
| | | AND (th.`hb_type` = 20 OR th.`hb_type` = 21 OR th.`hb_type` = 22) |
| | | AND (th.`hb_type` = 20 OR th.`hb_type` = 21 |
| | | OR th.`hb_type` = 22) |
| | | <if test="day != null and day == 1"> |
| | | AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | |
| | | SELECT 0 AS self,0 AS shared,IFNULL(COUNT(DISTINCT |
| | | tc.`co_order_no`,tc.`co_source_type`),0) AS invite FROM |
| | | yeshi_ec_common_order tc |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON |
| | | tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON |
| | | (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | th.`hb_pid` = tr.`ho_hongbao_id` ) |
| | | WHERE th.`hb_uid` = ${uid} |
| | | AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7) |
| | | AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR |
| | | th.`hb_type` = 7) |
| | | <if test="day != null and day == 1"> |
| | | AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | |
| | | tc.`co_order_no`,tc.`co_source_type`),0) AS valid,0 AS proces,0 AS |
| | | Invalid |
| | | FROM yeshi_ec_common_order tc |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | LEFT JOIN yeshi_ec_hongbao_order |
| | | tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON |
| | | (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | th.`hb_pid` = tr.`ho_hongbao_id` ) |
| | | WHERE th.`hb_uid` = #{uid} AND |
| | | (tc.`co_state` = 1 OR tc.`co_state` = 2) |
| | |
| | | tc.`co_order_no`,tc.`co_source_type`),0) AS proces,0 AS Invalid |
| | | FROM |
| | | yeshi_ec_common_order tc |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON |
| | | tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON |
| | | (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | th.`hb_pid` = tr.`ho_hongbao_id` ) |
| | | WHERE th.`hb_uid` = #{uid} AND |
| | | tc.`co_state` =3 |
| | |
| | | tc.`co_order_no`,tc.`co_source_type`),0) AS Invalid |
| | | FROM |
| | | yeshi_ec_common_order tc |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON |
| | | tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON |
| | | (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | th.`hb_pid` = tr.`ho_hongbao_id` ) |
| | | WHERE th.`hb_uid`= #{uid} AND |
| | | tc.`co_state` = 4 |
| | |
| | | <select id="countBonusOrderMoney" resultType="java.math.BigDecimal"> |
| | | SELECT COALESCE(SUM(th.`hb_money`),0)AS totalmoney FROM |
| | | yeshi_ec_common_order tc |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON |
| | | tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON |
| | | (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | th.`hb_pid` = tr.`ho_hongbao_id` ) |
| | | WHERE <![CDATA[tc.`co_state` <> 4]]> |
| | | <if test="uid != null"> |
| | |
| | | <select id="listBonusOrder" resultMap="ResultMap"> |
| | | SELECT COALESCE(SUM(th.`hb_money`),0)AS totalMoney,tc.*,th.hb_state AS |
| | | hongBaoState, th.hb_type AS hongBaoType, |
| | | th.hb_get_time AS accountTime,th.hb_get_time AS accountTime,th.hb_pre_get_time AS |
| | | th.hb_get_time AS |
| | | accountTime,th.hb_get_time AS accountTime,th.hb_pre_get_time AS |
| | | preAccountTime |
| | | FROM yeshi_ec_common_order tc |
| | | LEFT JOIN yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | LEFT JOIN |
| | | yeshi_ec_hongbao_order tr ON tr.`ho_order_id` = tc.`co_id` |
| | | LEFT JOIN |
| | | yeshi_ec_hongbao_v2 th ON (tr.`ho_hongbao_id` = th.`hb_id` OR |
| | | th.`hb_pid` = tr.`ho_hongbao_id` ) |
| | | WHERE th.`hb_uid` = #{uid} |
| | | <if test="type != null and type == 1"> <!-- 自购订单 --> |
| | |
| | | DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1 |
| | | </if> |
| | | GROUP BY tc.`co_order_no`,tc.co_source_type |
| | | ORDER BY tc.co_create_time DESC |
| | | ORDER BY tc.co_create_time |
| | | DESC |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |