| | |
| | | <result column="to_orderby" property="orderBy" jdbcType="INTEGER" /> |
| | | <result column="to_relation_id" property="relationId" jdbcType="VARCHAR" /> |
| | | <result column="to_special_id" property="specialId" jdbcType="VARCHAR" /> |
| | | <result column="to_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <sql id="Base_Column_List">to_id,to_create_time,to_click_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id |
| | | <sql id="Base_Column_List">to_id,to_create_time,to_click_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id |
| | | </sql> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order where to_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectTaoBaoOrderByOrderId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order where to_order_id = #{0} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectLatestByAuctionId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | |
| | | from yeshi_ec_taobao_order where to_auction_id = #{0} order by to_id |
| | | desc limit 1 |
| | | </select> |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_taobao_order where to_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | yeshi_ec_taobao_order where to_id = #{id,jdbcType=BIGINT}</delete> |
| | | <delete id="deleteByOrderId" parameterType="java.lang.String">delete from |
| | | yeshi_ec_taobao_order where to_order_id = #{0} |
| | | </delete> |
| | | |
| | | |
| | | yeshi_ec_taobao_order where to_order_id = #{0}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_order |
| | | (to_id,to_create_time,to_click_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id) |
| | | (to_id,to_create_time,to_click_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{createTime,jdbcType=VARCHAR},#{clickTime,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{auctionId,jdbcType=BIGINT},#{managerWangWang,jdbcType=VARCHAR},#{shop,jdbcType=VARCHAR},#{count,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{orderState,jdbcType=VARCHAR},#{orderType,jdbcType=VARCHAR},#{iRatio,jdbcType=DECIMAL},#{sRatio,jdbcType=DECIMAL},#{payment,jdbcType=DECIMAL},#{estimate,jdbcType=DECIMAL},#{settlement,jdbcType=DECIMAL},#{eIncome,jdbcType=DECIMAL},#{settlementTime,jdbcType=VARCHAR},#{tkRate,jdbcType=DECIMAL},#{tkMoney,jdbcType=DECIMAL},#{technologySupportPercent,jdbcType=DECIMAL},#{subsidyRatio,jdbcType=DECIMAL},#{subsidy,jdbcType=DECIMAL},#{subsidyType,jdbcType=VARCHAR},#{transactionPlatform,jdbcType=VARCHAR},#{thirdService,jdbcType=VARCHAR},#{orderId,jdbcType=VARCHAR},#{className,jdbcType=VARCHAR},#{sourceMediaId,jdbcType=VARCHAR},#{sourceMediaName,jdbcType=VARCHAR},#{adPositionId,jdbcType=VARCHAR},#{adPositionName,jdbcType=VARCHAR}, |
| | | #{latestUpdateTime,jdbcType=TIMESTAMP},#{orderBy,jdbcType=INTEGER}, |
| | | #{relationId,jdbcType=VARCHAR},#{specialId,jdbcType=VARCHAR} |
| | | ) |
| | | </insert> |
| | | ,#{tradeId,jdbcType=VARCHAR})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_taobao_order |
| | |
| | | <if test="orderBy != null">to_orderby,</if> |
| | | <if test="relationId != null">to_relation_id,</if> |
| | | <if test="specialId != null">to_special_id,</if> |
| | | <if test="tradeId != null">to_trade_id,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="relationId != null">#{relationId,jdbcType=VARCHAR},</if> |
| | | <if test="specialId != null">#{specialId,jdbcType=VARCHAR},</if> |
| | | |
| | | |
| | | |
| | | <if test="tradeId != null">#{tradeId,jdbcType=VARCHAR}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder">update |
| | |
| | | #{title,jdbcType=VARCHAR},to_auction_id = |
| | | #{auctionId,jdbcType=BIGINT},to_manager_wangwang = |
| | | #{managerWangWang,jdbcType=VARCHAR},to_shop = |
| | | #{shop,jdbcType=VARCHAR},to_count = |
| | | #{count,jdbcType=INTEGER},to_price |
| | | = |
| | | #{price,jdbcType=DECIMAL},to_order_state = |
| | | #{shop,jdbcType=VARCHAR},to_count = #{count,jdbcType=INTEGER},to_price |
| | | = #{price,jdbcType=DECIMAL},to_order_state = |
| | | #{orderState,jdbcType=VARCHAR},to_order_type = |
| | | #{orderType,jdbcType=VARCHAR},to_iratio = |
| | | #{iRatio,jdbcType=DECIMAL},to_sratio = |
| | |
| | | #{latestUpdateTime,jdbcType=TIMESTAMP},to_orderby= |
| | | #{orderBy,jdbcType=INTEGER},to_relation_id = |
| | | #{relationId,jdbcType=VARCHAR},to_special_id= |
| | | #{specialId,jdbcType=VARCHAR} |
| | | where to_id = |
| | | #{id,jdbcType=BIGINT} |
| | | #{specialId,jdbcType=VARCHAR} ,to_trade_id |
| | | =#{tradeId,jdbcType=VARCHAR} where to_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrder"> |
| | | update yeshi_ec_taobao_order |
| | |
| | | </if> |
| | | <if test="latestUpdateTime != null">to_latest_updatetime=#{latestUpdateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="orderBy != null">to_orderby=#{orderBy,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="relationId != null">to_relation_id=#{relationId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="specialId != null">to_special_id=#{specialId,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="orderBy != null">to_orderby=#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="relationId != null">to_relation_id=#{relationId,jdbcType=VARCHAR},</if> |
| | | <if test="specialId != null">to_special_id=#{specialId,jdbcType=VARCHAR},</if> |
| | | <if test="id !=null">to_id =#{id,jdbcType=BIGINT},</if> |
| | | <if test="tradeId !=null">to_trade_id =#{tradeId,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where to_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <resultMap id="ResultMapExtral" type="com.yeshi.fanli.entity.admin.ReslutOrder"> |
| | | <id column="to_id" property="tboid" jdbcType="BIGINT" /> |
| | | <result column="to_create_time" property="createTime" jdbcType="VARCHAR" /> |
| | |
| | | <id column="uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | <select id="countByOdrerType" resultType="java.util.HashMap"> |
| | | SELECT COUNT(to_id)AS |
| | | <select id="countByOdrerType" resultType="java.util.HashMap">SELECT COUNT(to_id)AS |
| | | countTotal ,IFNULL(SUM(CASE WHEN `to_order_state` = '订单结算' THEN 1 WHEN |
| | | `to_order_state` = '订单成功' THEN 1 ELSE 0 END),0) AS countSettlement, |
| | | IFNULL(SUM(CASE WHEN `to_order_state` = '订单付款' THEN 1 ELSE 0 END),0) |
| | | AS countPayment, |
| | | IFNULL(SUM(CASE WHEN `to_order_state` = '订单失效' THEN 1 |
| | | ELSE 0 END),0) AS countInvalid |
| | | FROM `yeshi_ec_taobao_order` |
| | | AS countPayment, IFNULL(SUM(CASE WHEN `to_order_state` = '订单失效' THEN 1 |
| | | ELSE 0 END),0) AS countInvalid FROM `yeshi_ec_taobao_order`</select> |
| | | <select id="countToday" resultType="java.lang.Integer">SELECT |
| | | COUNT(DISTINCT(tb.to_order_id)) FROM `yeshi_ec_taobao_order` tb WHERE <![CDATA[tb.`to_order_state`<>'订单失效' AND TO_DAYS(tb.`to_create_time`) = TO_DAYS(NOW())]]> |
| | | </select> |
| | | |
| | | <select id="countToday" resultType="java.lang.Integer"> |
| | | SELECT COUNT(DISTINCT(tb.to_order_id)) FROM `yeshi_ec_taobao_order` tb |
| | | WHERE <![CDATA[tb.`to_order_state`<>'订单失效' AND TO_DAYS(tb.`to_create_time`) = TO_DAYS(NOW())]]> |
| | | <select id="countYesterday" resultType="java.lang.Integer">SELECT |
| | | COUNT(DISTINCT(td.to_order_id))FROM `yeshi_ec_taobao_order` td WHERE <![CDATA[td.`to_order_state`<>'订单失效' AND TO_DAYS(NOW()) - TO_DAYS( td.`to_create_time`) = 1 ]]> |
| | | </select> |
| | | |
| | | <select id="countYesterday" resultType="java.lang.Integer"> |
| | | SELECT COUNT(DISTINCT(td.to_order_id))FROM `yeshi_ec_taobao_order` td |
| | | WHERE <![CDATA[td.`to_order_state`<>'订单失效' AND TO_DAYS(NOW()) - TO_DAYS( td.`to_create_time`) = 1 ]]> |
| | | </select> |
| | | |
| | | |
| | | <select id="countEstimate" resultType="java.lang.Double"> |
| | | SELECT IFNULL(SUM(t.to_estimate),0) FROM `yeshi_ec_taobao_order` t |
| | | WHERE <![CDATA[ t.`to_order_state`<> '订单失效' ]]> |
| | | <select id="countEstimate" resultType="java.lang.Double">SELECT |
| | | IFNULL(SUM(t.to_estimate),0) FROM `yeshi_ec_taobao_order` t WHERE <![CDATA[ t.`to_order_state`<> '订单失效' ]]> |
| | | AND DATE_FORMAT(t.`to_create_time` , '%Y-%m-%d' )= #{date} |
| | | </select> |
| | | |
| | | |
| | | <select id="getStateByOrderIdAndPayment" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order |
| | | where to_order_id = #{orderId} and |
| | | from yeshi_ec_taobao_order where to_order_id = #{orderId} and |
| | | to_payment = #{payment} |
| | | </select> |
| | | |
| | | |
| | | <sql id="Column_DateType"> |
| | | <if test="dateType == 1"> |
| | | DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d') AS 'showDate' |
| | | <if test="dateType == 1">DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d') AS 'showDate' |
| | | </if> |
| | | <if test="dateType == 2"> |
| | | DATE_FORMAT(t.`to_create_time`,'%m') AS 'showDate' |
| | | </if> |
| | | <if test="dateType == 3"> |
| | | DATE_FORMAT(t.`to_create_time`,'%Y') AS 'showDate' |
| | | </if> |
| | | <if test="dateType == 2">DATE_FORMAT(t.`to_create_time`,'%m') AS 'showDate'</if> |
| | | <if test="dateType == 3">DATE_FORMAT(t.`to_create_time`,'%Y') AS 'showDate'</if> |
| | | </sql> |
| | | |
| | | <sql id="Count_Select_DateType"> |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}' |
| | |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d') <![CDATA[ <= ]]>'${endTime}' |
| | | </if> |
| | | <if test="year != null and year != '' "> |
| | | AND DATE_FORMAT(t.`to_create_time`,'%Y') = '${year}' |
| | | </if> |
| | | <if test="year != null and year != '' ">AND DATE_FORMAT(t.`to_create_time`,'%Y') = '${year}'</if> |
| | | </sql> |
| | | |
| | | <sql id="Count_Group_DateType"> |
| | | <if test="dateType == 1"> |
| | | GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d') |
| | | </if> |
| | | <if test="dateType == 2"> |
| | | GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y-%m') |
| | | </if> |
| | | <if test="dateType == 3"> |
| | | GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y') |
| | | </if> |
| | | <if test="dateType == 1">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d')</if> |
| | | <if test="dateType == 2">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y-%m')</if> |
| | | <if test="dateType == 3">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y')</if> |
| | | </sql> |
| | | |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | SELECT IFNULL(COUNT(t.`to_id`),0) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM `yeshi_ec_taobao_order` t |
| | | WHERE t.`to_create_time` IS NOT NULL |
| | | FROM `yeshi_ec_taobao_order` t WHERE t.`to_create_time` IS NOT NULL |
| | | <include refid="Count_Select_DateType" /> |
| | | <include refid="Count_Group_DateType" /> |
| | | ORDER BY t.`to_create_time` |
| | | </select> |
| | | |
| | | |
| | | </mapper> |