admin
2019-08-19 9c09cead959dbeef292628f345e5f80c30fc3d17
fanli/src/main/java/com/yeshi/fanli/mapping/pdd/PDDOrderMapper.xml
@@ -34,6 +34,8 @@
         jdbcType="BIGINT" />
      <result column="po_order_modify_at" property="orderModifyAt"
         jdbcType="BIGINT" />
      <result column="po_order_receive_time" property="orderReceiveTime"
         jdbcType="BIGINT" />
      <result column="po_custom_parameters" property="customParameters"
         jdbcType="VARCHAR" />
      <result column="po_order_settle_time" property="orderSettleTime"
@@ -42,7 +44,7 @@
      <result column="po_create_time" property="createTime" jdbcType="TIMESTAMP" />
      <result column="po_update_time" property="updateTime" jdbcType="TIMESTAMP" />
   </resultMap>
   <sql id="Base_Column_List">po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time
   <sql id="Base_Column_List">po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time,po_order_receive_time
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap"
      parameterType="java.lang.Long">
@@ -64,9 +66,9 @@
   </delete>
   <insert id="insert" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder"
      useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_pdd_order
      (po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time)
      (po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time,po_order_receive_time)
      values
      (#{id,jdbcType=BIGINT},#{orderSn,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{groupId,jdbcType=BIGINT},#{goodsName,jdbcType=VARCHAR},#{goodsThumbnailUrl,jdbcType=VARCHAR},#{goodsQuantity,jdbcType=INTEGER},#{goodsPrice,jdbcType=BIGINT},#{orderAmount,jdbcType=BIGINT},#{pId,jdbcType=VARCHAR},#{promotionRate,jdbcType=BIGINT},#{promotionAmount,jdbcType=BIGINT},#{orderStatus,jdbcType=INTEGER},#{orderStatusDesc,jdbcType=VARCHAR},#{orderCreateTime,jdbcType=BIGINT},#{orderPayTime,jdbcType=BIGINT},#{orderGroupSuccessTime,jdbcType=BIGINT},#{orderVerifyTime,jdbcType=BIGINT},#{orderModifyAt,jdbcType=BIGINT},#{customParameters,jdbcType=VARCHAR},#{orderSettleTime,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
      (#{id,jdbcType=BIGINT},#{orderSn,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{groupId,jdbcType=BIGINT},#{goodsName,jdbcType=VARCHAR},#{goodsThumbnailUrl,jdbcType=VARCHAR},#{goodsQuantity,jdbcType=INTEGER},#{goodsPrice,jdbcType=BIGINT},#{orderAmount,jdbcType=BIGINT},#{pId,jdbcType=VARCHAR},#{promotionRate,jdbcType=BIGINT},#{promotionAmount,jdbcType=BIGINT},#{orderStatus,jdbcType=INTEGER},#{orderStatusDesc,jdbcType=VARCHAR},#{orderCreateTime,jdbcType=BIGINT},#{orderPayTime,jdbcType=BIGINT},#{orderGroupSuccessTime,jdbcType=BIGINT},#{orderVerifyTime,jdbcType=BIGINT},#{orderModifyAt,jdbcType=BIGINT},#{customParameters,jdbcType=VARCHAR},#{orderSettleTime,jdbcType=BIGINT},#{orderId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{orderReceiveTime,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder"
      useGeneratedKeys="true" keyProperty="id">
@@ -96,6 +98,7 @@
         <if test="orderId != null">po_order_id,</if>
         <if test="createTime != null">po_create_time,</if>
         <if test="updateTime != null">po_update_time,</if>
         <if test="orderReceiveTime != null">po_order_receive_time,</if>
      </trim>
      values
      <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -123,6 +126,7 @@
         <if test="orderId != null">#{orderId,jdbcType=VARCHAR},</if>
         <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
         <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
         <if test="orderReceiveTime != null">#{orderReceiveTime,jdbcType=BIGINT},</if>
      </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder">update
@@ -149,7 +153,8 @@
      #{orderSettleTime,jdbcType=BIGINT},po_order_id =
      #{orderId,jdbcType=VARCHAR},po_create_time =
      #{createTime,jdbcType=TIMESTAMP},po_update_time =
      #{updateTime,jdbcType=TIMESTAMP} where po_id = #{id,jdbcType=BIGINT}
      #{updateTime,jdbcType=TIMESTAMP},po_order_receive_time =
      #{orderReceiveTime,jdbcType=BIGINT} where po_id = #{id,jdbcType=BIGINT}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.pdd.PDDOrder">
      update yeshi_ec_pdd_order
@@ -185,15 +190,19 @@
         <if test="orderId != null">po_order_id=#{orderId,jdbcType=VARCHAR},</if>
         <if test="createTime != null">po_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
         <if test="updateTime != null">po_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
         <if test="orderReceiveTime != null">po_order_receive_time=#{orderReceiveTime,jdbcType=BIGINT},</if>
      </set>
      where po_id = #{id,jdbcType=BIGINT}
   </update>
   <!-- 统计 -->
   <sql id="Column_DateType">
      <if test="dateType == 1">FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') AS 'showDate'
      <if test="dateType == 1">FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') AS
         'showDate'
      </if>
      <if test="dateType == 2">FROM_UNIXTIME(po_order_create_time,'%m') AS 'showDate'</if>
      <if test="dateType == 3">FROM_UNIXTIME(po_order_create_time,'%Y') AS 'showDate'</if>
      <if test="dateType == 2">FROM_UNIXTIME(po_order_create_time,'%m') AS 'showDate'
      </if>
      <if test="dateType == 3">FROM_UNIXTIME(po_order_create_time,'%Y') AS 'showDate'
      </if>
   </sql>
   <sql id="Count_Select_DateType">
      <if test="startTime != null and startTime != '' ">
@@ -202,16 +211,18 @@
      <if test="endTime != null and endTime != '' ">
         AND FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') <![CDATA[ <= ]]>'${endTime}'
      </if>
      <if test="year != null and year != '' ">AND FROM_UNIXTIME(po_order_create_time,'%Y') = '${year}'</if>
      <if test="year != null and year != '' ">AND FROM_UNIXTIME(po_order_create_time,'%Y') = '${year}'
      </if>
   </sql>
   <sql id="Count_Group_DateType">
      <if test="dateType == 1">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d')</if>
      <if test="dateType == 1">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d')
      </if>
      <if test="dateType == 2">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y-%m')</if>
      <if test="dateType == 3">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y')</if>
   </sql>
   <select id="countOrderNumber" resultType="java.util.HashMap">
      SELECT IFNULL(COUNT(`po_id`),0) AS showValue,
      <include refid="Column_DateType" />
@@ -220,6 +231,6 @@
      <include refid="Count_Group_DateType" />
      ORDER BY po_order_create_time
   </select>
</mapper>