admin
2019-01-03 5981b2cae7c20ec9021c8ccbe1a926f35f640210
fanli/src/main/java/com/yeshi/fanli/mapping/order/HongBaoOrderMapper.xml
@@ -11,12 +11,30 @@
         <id column="ho_hongbao_id" property="id" jdbcType="BIGINT" />
      </association>
      <association property="commonOrderGoods" column="ho_order_id"
      <association property="commonOrder" column="ho_order_id"
         javaType="com.yeshi.fanli.entity.order.CommonOrder">
         <id column="ho_order_id" property="id" jdbcType="BIGINT" />
      </association>
   </resultMap>
   <resultMap id="BaseDetailResultMap" type="com.yeshi.fanli.entity.order.HongBaoOrder">
      <id column="ho_id" property="id" jdbcType="BIGINT" />
      <result column="ho_create_time" property="createTime" jdbcType="TIMESTAMP" />
      <association property="hongBaoV2"
         resultMap="com.yeshi.fanli.dao.mybatis.HongBaoV2Mapper.BaseResultMap">
      </association>
      <association property="commonOrder"
         resultMap="com.yeshi.fanli.dao.mybatis.order.CommonOrderMapper.BaseDetailResultMap">
      </association>
   </resultMap>
   <sql id="Base_Column_List">
      ho_id,ho_hongbao_id,ho_order_id,ho_create_time
   </sql>
@@ -26,18 +44,43 @@
      <include refid="Base_Column_List" />
      from yeshi_ec_hongbao_order where ho_id = #{id,jdbcType=BIGINT}
   </select>
   <select id="selectByCommonOrderId" resultMap="BaseResultMap"
      parameterType="java.lang.Long">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_hongbao_order where ho_order_id = #{0}
   </select>
   <select id="listFanLiOrder" resultMap="BaseDetailResultMap">
      SELECT * FROM (SELECT *
      FROM yeshi_ec_hongbao_v2 h WHERE h.`hb_uid`=#{uid} AND h.`hb_type`=1
      ORDER BY h.`hb_create_time` DESC LIMIT #{start},#{count}) hh LEFT JOIN
      yeshi_ec_hongbao_order ho ON ho.`ho_hongbao_id`=hh.hb_id
      LEFT JOIN
      yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` LEFT
      JOIN
      yeshi_ec_common_order_goods g ON
      g.`cog_id`=co.`co_order_goods_id`
   </select>
   <select id="countFanLiOrder" resultType="java.lang.Long"
      parameterType="java.lang.Long">
      SELECT COUNT(h.`hb_id`) FROM yeshi_ec_hongbao_v2 h WHERE
      h.`hb_uid`=#{0} AND
      h.`hb_type`=1
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
      yeshi_ec_hongbao_order where ho_id = #{id,jdbcType=BIGINT}</delete>
      yeshi_ec_hongbao_order where ho_id = #{id,jdbcType=BIGINT}
   </delete>
   <insert id="insert" parameterType="com.yeshi.fanli.entity.order.HongBaoOrder"
      useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_hongbao_order
      (ho_id,ho_hongbao_id,ho_order_id,ho_create_time) values