123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.slodon.b2b2c.dao.write.statistics.GoodsDayWriteMapper">
- <resultMap id="resultMap" type="com.slodon.b2b2c.statistics.pojo.GoodsDay">
- <id column="stats_id" property="statsId" />
- <result column="stats_time" property="statsTime" />
- <result column="web_site" property="webSite" />
- <result column="goods_id" property="goodsId" />
- <result column="goods_name" property="goodsName" />
- <result column="goods_image" property="goodsImage" />
- <result column="visitor_num" property="visitorNum" />
- <result column="view_num" property="viewNum" />
- <result column="order_submit_num" property="orderSubmitNum" />
- <result column="order_submit_amount" property="orderSubmitAmount" />
- <result column="order_pay_num" property="orderPayNum" />
- <result column="sale_amount" property="saleAmount" />
- <result column="sale_num" property="saleNum" />
- <result column="collection_num" property="collectionNum" />
- <result column="add_cart_member_num" property="addCartMemberNum" />
- <result column="brand_id" property="brandId" />
- <result column="brand_name" property="brandName" />
- <result column="store_id" property="storeId" />
- <result column="store_name" property="storeName" />
- <result column="goods_category_id1" property="goodsCategoryId1" />
- <result column="goods_category_name1" property="goodsCategoryName1" />
- <result column="goods_price" property="goodsPrice" />
- <result column="return_num" property="returnNum" />
- <result column="return_product_num" property="returnProductNum" />
- <result column="return_amount" property="returnAmount" />
- <result column="order_submit_member_num" property="orderSubmitMemberNum" />
- </resultMap>
- <!--除主键外的所有字段,用于插入操作-->
- <sql id="columns">
- <trim suffixOverrides=",">
- <if test="statsTime != null">
- `stats_time`,
- </if>
- <if test="webSite != null">
- `web_site`,
- </if>
- <if test="goodsId != null">
- `goods_id`,
- </if>
- <if test="goodsName != null">
- `goods_name`,
- </if>
- <if test="goodsImage != null">
- `goods_image`,
- </if>
- <if test="visitorNum != null">
- `visitor_num`,
- </if>
- <if test="viewNum != null">
- `view_num`,
- </if>
- <if test="orderSubmitNum != null">
- `order_submit_num`,
- </if>
- <if test="orderSubmitAmount != null">
- `order_submit_amount`,
- </if>
- <if test="orderPayNum != null">
- `order_pay_num`,
- </if>
- <if test="saleAmount != null">
- `sale_amount`,
- </if>
- <if test="saleNum != null">
- `sale_num`,
- </if>
- <if test="collectionNum != null">
- `collection_num`,
- </if>
- <if test="addCartMemberNum != null">
- `add_cart_member_num`,
- </if>
- <if test="brandId != null">
- `brand_id`,
- </if>
- <if test="brandName != null">
- `brand_name`,
- </if>
- <if test="storeId != null">
- `store_id`,
- </if>
- <if test="storeName != null">
- `store_name`,
- </if>
- <if test="goodsCategoryId1 != null">
- `goods_category_id1`,
- </if>
- <if test="goodsCategoryName1 != null">
- `goods_category_name1`,
- </if>
- <if test="goodsPrice != null">
- `goods_price`,
- </if>
- <if test="returnNum != null">
- `return_num`,
- </if>
- <if test="returnProductNum != null">
- `return_product_num`,
- </if>
- <if test="returnAmount != null">
- `return_amount`,
- </if>
- <if test="orderSubmitMemberNum != null">
- `order_submit_member_num`,
- </if>
- </trim>
- </sql>
- <!--按照主键值进行操作-->
- <sql id="pkWhere">
- WHERE `stats_id` = #{primaryKey}
- </sql>
- <!--操作条件-->
- <sql id="whereCondition">
- <if test="example != null">
- <trim prefix="WHERE" prefixOverrides="AND|OR">
- <if test="example.statsIdNotEquals != null">
- AND `stats_id` != #{example.statsIdNotEquals}
- </if>
- <if test="example.statsIdIn != null">
- AND `stats_id` in (${example.statsIdIn})
- </if>
- <if test="example.statsTimeAfter != null">
- AND `stats_time` <![CDATA[ >= ]]> #{example.statsTimeAfter}
- </if>
- <if test="example.statsTimeBefore != null">
- AND `stats_time` <![CDATA[ <= ]]> #{example.statsTimeBefore}
- </if>
- <if test="example.webSite != null">
- AND `web_site` = #{example.webSite}
- </if>
- <if test="example.goodsId != null">
- AND `goods_id` = #{example.goodsId}
- </if>
- <if test="example.goodsName != null">
- AND `goods_name` = #{example.goodsName}
- </if>
- <if test="example.goodsNameLike != null">
- AND `goods_name` like concat('%',#{example.goodsNameLike},'%')
- </if>
- <if test="example.goodsImage != null">
- AND `goods_image` = #{example.goodsImage}
- </if>
- <if test="example.visitorNum != null">
- AND `visitor_num` = #{example.visitorNum}
- </if>
- <if test="example.viewNum != null">
- AND `view_num` = #{example.viewNum}
- </if>
- <if test="example.orderSubmitNum != null">
- AND `order_submit_num` = #{example.orderSubmitNum}
- </if>
- <if test="example.orderSubmitAmount != null">
- AND `order_submit_amount` = #{example.orderSubmitAmount}
- </if>
- <if test="example.orderPayNum != null">
- AND `order_pay_num` = #{example.orderPayNum}
- </if>
- <if test="example.saleAmount != null">
- AND `sale_amount` = #{example.saleAmount}
- </if>
- <if test="example.saleNum != null">
- AND `sale_num` = #{example.saleNum}
- </if>
- <if test="example.collectionNum != null">
- AND `collection_num` = #{example.collectionNum}
- </if>
- <if test="example.addCartMemberNum != null">
- AND `add_cart_member_num` = #{example.addCartMemberNum}
- </if>
- <if test="example.brandId != null">
- AND `brand_id` = #{example.brandId}
- </if>
- <if test="example.brandName != null">
- AND `brand_name` = #{example.brandName}
- </if>
- <if test="example.brandNameLike != null">
- AND `brand_name` like concat('%',#{example.brandNameLike},'%')
- </if>
- <if test="example.storeId != null">
- AND `store_id` = #{example.storeId}
- </if>
- <if test="example.storeName != null">
- AND `store_name` = #{example.storeName}
- </if>
- <if test="example.storeNameLike != null">
- AND `store_name` like concat('%',#{example.storeNameLike},'%')
- </if>
- <if test="example.goodsCategoryId1 != null">
- AND `goods_category_id1` = #{example.goodsCategoryId1}
- </if>
- <if test="example.goodsCategoryName1 != null">
- AND `goods_category_name1` = #{example.goodsCategoryName1}
- </if>
- <if test="example.goodsCategoryName1Like != null">
- AND `goods_category_name1` like concat('%',#{example.goodsCategoryName1Like},'%')
- </if>
- <if test="example.goodsPrice != null">
- AND `goods_price` = #{example.goodsPrice}
- </if>
- <if test="example.returnNum != null">
- AND `return_num` = #{example.returnNum}
- </if>
- <if test="example.returnProductNum != null">
- AND `return_product_num` = #{example.returnProductNum}
- </if>
- <if test="example.returnAmount != null">
- AND `return_amount` = #{example.returnAmount}
- </if>
- <if test="example.orderSubmitMemberNum != null">
- AND `order_submit_member_num` = #{example.orderSubmitMemberNum}
- </if>
- </trim>
- </if>
- </sql>
- <!--排序条件-->
- <sql id="orderBy">
- ORDER BY `stats_id` DESC
- </sql>
- <sql id="orderByOther">
- order by ${example.orderBy}
- </sql>
- <!--分组条件-->
- <sql id="groupBy">
- group by ${example.groupBy}
- </sql>
- <!--分页条件-->
- <sql id="limit">
- <if test="size != null and size > 0">
- limit #{startRow},#{size}
- </if>
- </sql>
- <!--查询符合条件的记录数-->
- <select id="countByExample" parameterType="com.slodon.b2b2c.statistics.example.GoodsDayExample" resultType="java.lang.Integer">
- SELECT
- COUNT(*)
- FROM `stats_goods_day`
- <include refid="whereCondition" />
- </select>
- <!--根据主键查询记录-->
- <select id="getByPrimaryKey" resultMap="resultMap">
- SELECT
- *
- FROM `stats_goods_day`
- <include refid="pkWhere" />
- </select>
- <!--查询符合条件的记录(所有字段)-->
- <select id="listByExample" resultMap="resultMap">
- SELECT
- *
- FROM `stats_goods_day`
- <include refid="whereCondition" />
- <if test="example.groupBy != null">
- <include refid="groupBy" />
- </if>
- <choose>
- <when test="example.orderBy != null">
- <include refid="orderByOther" />
- </when>
- <otherwise>
- <include refid="orderBy" />
- </otherwise>
- </choose>
- </select>
- <!--分页查询符合条件的记录(所有字段)-->
- <select id="listPageByExample" resultMap="resultMap">
- SELECT
- *
- FROM `stats_goods_day`
- <include refid="whereCondition" />
- <if test="example.groupBy != null">
- <include refid="groupBy" />
- </if>
- <choose>
- <when test="example.orderBy != null">
- <include refid="orderByOther" />
- </when>
- <otherwise>
- <include refid="orderBy" />
- </otherwise>
- </choose>
- <include refid="limit" />
- </select>
- <!--查询符合条件的记录(指定字段)-->
- <select id="listFieldsByExample" resultMap="resultMap">
- SELECT
- ${fields}
- FROM `stats_goods_day`
- <include refid="whereCondition" />
- <if test="example.groupBy != null">
- <include refid="groupBy" />
- </if>
- <choose>
- <when test="example.orderBy != null">
- <include refid="orderByOther" />
- </when>
- <otherwise>
- <include refid="orderBy" />
- </otherwise>
- </choose>
- </select>
- <!--分页查询符合条件的记录(指定字段)-->
- <select id="listFieldsPageByExample" resultMap="resultMap">
- SELECT
- ${fields}
- FROM `stats_goods_day`
- <include refid="whereCondition" />
- <if test="example.groupBy != null">
- <include refid="groupBy" />
- </if>
- <choose>
- <when test="example.orderBy != null">
- <include refid="orderByOther" />
- </when>
- <otherwise>
- <include refid="orderBy" />
- </otherwise>
- </choose>
- <include refid="limit" />
- </select>
- <!--根据条件删除记录,可多条删除-->
- <delete id="deleteByExample">
- DELETE FROM `stats_goods_day`
- <include refid="whereCondition" />
- </delete>
- <!--根据主键删除记录-->
- <delete id="deleteByPrimaryKey">
- DELETE FROM `stats_goods_day`
- <include refid="pkWhere" />
- </delete>
- <!--插入一条记录-->
- <insert id="insert" keyColumn="stats_id" keyProperty="statsId" parameterType="com.slodon.b2b2c.statistics.pojo.GoodsDay" useGeneratedKeys="true">
- INSERT INTO `stats_goods_day`(
- <include refid="columns" />
- )
- VALUES(
- <trim suffixOverrides=",">
- <if test="statsTime != null">
- #{statsTime},
- </if>
- <if test="webSite != null">
- #{webSite},
- </if>
- <if test="goodsId != null">
- #{goodsId},
- </if>
- <if test="goodsName != null">
- #{goodsName},
- </if>
- <if test="goodsImage != null">
- #{goodsImage},
- </if>
- <if test="visitorNum != null">
- #{visitorNum},
- </if>
- <if test="viewNum != null">
- #{viewNum},
- </if>
- <if test="orderSubmitNum != null">
- #{orderSubmitNum},
- </if>
- <if test="orderSubmitAmount != null">
- #{orderSubmitAmount},
- </if>
- <if test="orderPayNum != null">
- #{orderPayNum},
- </if>
- <if test="saleAmount != null">
- #{saleAmount},
- </if>
- <if test="saleNum != null">
- #{saleNum},
- </if>
- <if test="collectionNum != null">
- #{collectionNum},
- </if>
- <if test="addCartMemberNum != null">
- #{addCartMemberNum},
- </if>
- <if test="brandId != null">
- #{brandId},
- </if>
- <if test="brandName != null">
- #{brandName},
- </if>
- <if test="storeId != null">
- #{storeId},
- </if>
- <if test="storeName != null">
- #{storeName},
- </if>
- <if test="goodsCategoryId1 != null">
- #{goodsCategoryId1},
- </if>
- <if test="goodsCategoryName1 != null">
- #{goodsCategoryName1},
- </if>
- <if test="goodsPrice != null">
- #{goodsPrice},
- </if>
- <if test="returnNum != null">
- #{returnNum},
- </if>
- <if test="returnProductNum != null">
- #{returnProductNum},
- </if>
- <if test="returnAmount != null">
- #{returnAmount},
- </if>
- <if test="orderSubmitMemberNum != null">
- #{orderSubmitMemberNum},
- </if>
- </trim>
- )
- </insert>
- <!--按条件更新记录中不为空的字段-->
- <update id="updateByExampleSelective">
- UPDATE `stats_goods_day`
- <trim prefix="SET" suffixOverrides=",">
- <if test="record.statsTime != null">
- `stats_time` = #{record.statsTime},
- </if>
- <if test="record.webSite != null">
- `web_site` = #{record.webSite},`
- </if>
- <if test="record.goodsId != null">
- `goods_id` = #{record.goodsId},
- </if>
- <if test="record.goodsName != null">
- `goods_name` = #{record.goodsName},
- </if>
- <if test="record.goodsImage != null">
- `goods_image` = #{record.goodsImage},
- </if>
- <if test="record.visitorNum != null">
- `visitor_num` = #{record.visitorNum},
- </if>
- <if test="record.viewNum != null">
- `view_num` = #{record.viewNum},
- </if>
- <if test="record.orderSubmitNum != null">
- `order_submit_num` = #{record.orderSubmitNum},
- </if>
- <if test="record.orderSubmitAmount != null">
- `order_submit_amount` = #{record.orderSubmitAmount},
- </if>
- <if test="record.orderPayNum != null">
- `order_pay_num` = #{record.orderPayNum},
- </if>
- <if test="record.saleAmount != null">
- `sale_amount` = #{record.saleAmount},
- </if>
- <if test="record.saleNum != null">
- `sale_num` = #{record.saleNum},
- </if>
- <if test="record.collectionNum != null">
- `collection_num` = #{record.collectionNum},
- </if>
- <if test="record.addCartMemberNum != null">
- `add_cart_member_num` = #{record.addCartMemberNum},
- </if>
- <if test="record.brandId != null">
- `brand_id` = #{record.brandId},
- </if>
- <if test="record.brandName != null">
- `brand_name` = #{record.brandName},
- </if>
- <if test="record.storeId != null">
- `store_id` = #{record.storeId},
- </if>
- <if test="record.storeName != null">
- `store_name` = #{record.storeName},
- </if>
- <if test="record.goodsCategoryId1 != null">
- `goods_category_id1` = #{record.goodsCategoryId1},
- </if>
- <if test="record.goodsCategoryName1 != null">
- `goods_category_name1` = #{record.goodsCategoryName1},
- </if>
- <if test="record.goodsPrice != null">
- `goods_price` = #{record.goodsPrice},
- </if>
- <if test="record.returnNum != null">
- `return_num` = #{record.returnNum},
- </if>
- <if test="record.returnProductNum != null">
- `return_product_num` = #{record.returnProductNum},
- </if>
- <if test="record.returnAmount != null">
- `return_amount` = #{record.returnAmount},
- </if>
- <if test="record.orderSubmitMemberNum != null">
- `order_submit_member_num` = #{record.orderSubmitMemberNum},
- </if>
- </trim>
- <include refid="whereCondition" />
- </update>
- <!--按照主键更新记录中不为空的字段-->
- <update id="updateByPrimaryKeySelective">
- UPDATE `stats_goods_day`
- <trim prefix="SET" suffixOverrides=",">
- <if test="statsTime != null">
- `stats_time` = #{statsTime},
- </if>
- <if test="webSite != null">
- `web_site` = #{webSite},
- </if>
- <if test="goodsId != null">
- `goods_id` = #{goodsId},
- </if>
- <if test="goodsName != null">
- `goods_name` = #{goodsName},
- </if>
- <if test="goodsImage != null">
- `goods_image` = #{goodsImage},
- </if>
- <if test="visitorNum != null">
- `visitor_num` = #{visitorNum},
- </if>
- <if test="viewNum != null">
- `view_num` = #{viewNum},
- </if>
- <if test="orderSubmitNum != null">
- `order_submit_num` = #{orderSubmitNum},
- </if>
- <if test="orderSubmitAmount != null">
- `order_submit_amount` = #{orderSubmitAmount},
- </if>
- <if test="orderPayNum != null">
- `order_pay_num` = #{orderPayNum},
- </if>
- <if test="saleAmount != null">
- `sale_amount` = #{saleAmount},
- </if>
- <if test="saleNum != null">
- `sale_num` = #{saleNum},
- </if>
- <if test="collectionNum != null">
- `collection_num` = #{collectionNum},
- </if>
- <if test="addCartMemberNum != null">
- `add_cart_member_num` = #{addCartMemberNum},
- </if>
- <if test="brandId != null">
- `brand_id` = #{brandId},
- </if>
- <if test="brandName != null">
- `brand_name` = #{brandName},
- </if>
- <if test="storeId != null">
- `store_id` = #{storeId},
- </if>
- <if test="storeName != null">
- `store_name` = #{storeName},
- </if>
- <if test="goodsCategoryId1 != null">
- `goods_category_id1` = #{goodsCategoryId1},
- </if>
- <if test="goodsCategoryName1 != null">
- `goods_category_name1` = #{goodsCategoryName1},
- </if>
- <if test="goodsPrice != null">
- `goods_price` = #{goodsPrice},
- </if>
- <if test="returnNum != null">
- `return_num` = #{returnNum},
- </if>
- <if test="returnProductNum != null">
- `return_product_num` = #{returnProductNum},
- </if>
- <if test="returnAmount != null">
- `return_amount` = #{returnAmount},
- </if>
- <if test="orderSubmitMemberNum != null">
- `order_submit_member_num` = #{orderSubmitMemberNum},
- </if>
- </trim>
- WHERE `stats_id` = #{statsId}
- </update>
- </mapper>
|