123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799 |
- <?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.shawn.repository.TOrderMapper">
- <resultMap id="BaseResultMap" type="com.shawn.model.entity.TOrder">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
- <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
- <result column="admin_id" jdbcType="BIGINT" property="adminId" />
- <result column="admin_proportion" jdbcType="DECIMAL" property="adminProportion" />
- <result column="agency_id" jdbcType="BIGINT" property="agencyId" />
- <result column="agency_proportion" jdbcType="DECIMAL" property="agencyProportion" />
- <result column="alt_info" jdbcType="VARCHAR" property="altInfo" />
- <result column="client_id" jdbcType="VARCHAR" property="clientId" />
- <result column="equipment_id" jdbcType="BIGINT" property="equipmentId" />
- <result column="frp_code" jdbcType="VARCHAR" property="frpCode" />
- <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
- <result column="merchant_proportion" jdbcType="DECIMAL" property="merchantProportion" />
- <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" />
- <result column="personage_id" jdbcType="BIGINT" property="personageId" />
- <result column="personage_proportion" jdbcType="DECIMAL" property="personageProportion" />
- <result column="price" jdbcType="DECIMAL" property="price" />
- <result column="product_id" jdbcType="BIGINT" property="productId" />
- <result column="product_name" jdbcType="VARCHAR" property="productName" />
- <result column="refund_date" jdbcType="TIMESTAMP" property="refundDate" />
- <result column="sn" jdbcType="VARCHAR" property="sn" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="type" jdbcType="INTEGER" property="type" />
- <result column="trx_no" jdbcType="VARCHAR" property="trxNo" />
- <result column="refund_trx_no" jdbcType="VARCHAR" property="refundTrxNo" />
- <result column="refund_amount" jdbcType="DECIMAL" property="refundAmount" />
- </resultMap>
- <resultMap id="chartBean" type="com.shawn.model.Bean.ChartBean">
- <result column="categorie" jdbcType="VARCHAR" property="categorie" />
- <result column="saleNum" jdbcType="INTEGER" property="saleNum" />
- <result column="salePrice" jdbcType="DECIMAL" property="salePrice" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- id, create_date, modify_date, admin_id, admin_proportion, agency_id, agency_proportion,
- alt_info, client_id, equipment_id, frp_code, merchant_id, merchant_proportion, pay_date,
- personage_id, personage_proportion, price, product_id, product_name, refund_date,
- sn, status, type, trx_no, refund_trx_no, refund_amount
- </sql>
- <select id="selectByExample" parameterType="com.shawn.model.entity.TOrderExample" resultMap="BaseResultMap">
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from t_order
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- <if test="limit != null">
- <if test="offset != null">
- limit ${offset}, ${limit}
- </if>
- <if test="offset == null">
- limit ${limit}
- </if>
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from t_order
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from t_order
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <delete id="deleteByExample" parameterType="com.shawn.model.entity.TOrderExample">
- delete from t_order
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.shawn.model.entity.TOrder">
- insert into t_order (id, create_date, modify_date,
- admin_id, admin_proportion, agency_id,
- agency_proportion, alt_info, client_id,
- equipment_id, frp_code, merchant_id,
- merchant_proportion, pay_date, personage_id,
- personage_proportion, price, product_id,
- product_name, refund_date, sn,
- status, type, trx_no,
- refund_trx_no, refund_amount)
- values (#{id,jdbcType=BIGINT}, #{createDate,jdbcType=TIMESTAMP}, #{modifyDate,jdbcType=TIMESTAMP},
- #{adminId,jdbcType=BIGINT}, #{adminProportion,jdbcType=DECIMAL}, #{agencyId,jdbcType=BIGINT},
- #{agencyProportion,jdbcType=DECIMAL}, #{altInfo,jdbcType=VARCHAR}, #{clientId,jdbcType=VARCHAR},
- #{equipmentId,jdbcType=BIGINT}, #{frpCode,jdbcType=VARCHAR}, #{merchantId,jdbcType=BIGINT},
- #{merchantProportion,jdbcType=DECIMAL}, #{payDate,jdbcType=TIMESTAMP}, #{personageId,jdbcType=BIGINT},
- #{personageProportion,jdbcType=DECIMAL}, #{price,jdbcType=DECIMAL}, #{productId,jdbcType=BIGINT},
- #{productName,jdbcType=VARCHAR}, #{refundDate,jdbcType=TIMESTAMP}, #{sn,jdbcType=VARCHAR},
- #{status,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{trxNo,jdbcType=VARCHAR},
- #{refundTrxNo,jdbcType=VARCHAR}, #{refundAmount,jdbcType=DECIMAL})
- </insert>
- <insert id="insertSelective" parameterType="com.shawn.model.entity.TOrder">
- insert into t_order
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="createDate != null">
- create_date,
- </if>
- <if test="modifyDate != null">
- modify_date,
- </if>
- <if test="adminId != null">
- admin_id,
- </if>
- <if test="adminProportion != null">
- admin_proportion,
- </if>
- <if test="agencyId != null">
- agency_id,
- </if>
- <if test="agencyProportion != null">
- agency_proportion,
- </if>
- <if test="altInfo != null">
- alt_info,
- </if>
- <if test="clientId != null">
- client_id,
- </if>
- <if test="equipmentId != null">
- equipment_id,
- </if>
- <if test="frpCode != null">
- frp_code,
- </if>
- <if test="merchantId != null">
- merchant_id,
- </if>
- <if test="merchantProportion != null">
- merchant_proportion,
- </if>
- <if test="payDate != null">
- pay_date,
- </if>
- <if test="personageId != null">
- personage_id,
- </if>
- <if test="personageProportion != null">
- personage_proportion,
- </if>
- <if test="price != null">
- price,
- </if>
- <if test="productId != null">
- product_id,
- </if>
- <if test="productName != null">
- product_name,
- </if>
- <if test="refundDate != null">
- refund_date,
- </if>
- <if test="sn != null">
- sn,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="type != null">
- type,
- </if>
- <if test="trxNo != null">
- trx_no,
- </if>
- <if test="refundTrxNo != null">
- refund_trx_no,
- </if>
- <if test="refundAmount != null">
- refund_amount,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=BIGINT},
- </if>
- <if test="createDate != null">
- #{createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="modifyDate != null">
- #{modifyDate,jdbcType=TIMESTAMP},
- </if>
- <if test="adminId != null">
- #{adminId,jdbcType=BIGINT},
- </if>
- <if test="adminProportion != null">
- #{adminProportion,jdbcType=DECIMAL},
- </if>
- <if test="agencyId != null">
- #{agencyId,jdbcType=BIGINT},
- </if>
- <if test="agencyProportion != null">
- #{agencyProportion,jdbcType=DECIMAL},
- </if>
- <if test="altInfo != null">
- #{altInfo,jdbcType=VARCHAR},
- </if>
- <if test="clientId != null">
- #{clientId,jdbcType=VARCHAR},
- </if>
- <if test="equipmentId != null">
- #{equipmentId,jdbcType=BIGINT},
- </if>
- <if test="frpCode != null">
- #{frpCode,jdbcType=VARCHAR},
- </if>
- <if test="merchantId != null">
- #{merchantId,jdbcType=BIGINT},
- </if>
- <if test="merchantProportion != null">
- #{merchantProportion,jdbcType=DECIMAL},
- </if>
- <if test="payDate != null">
- #{payDate,jdbcType=TIMESTAMP},
- </if>
- <if test="personageId != null">
- #{personageId,jdbcType=BIGINT},
- </if>
- <if test="personageProportion != null">
- #{personageProportion,jdbcType=DECIMAL},
- </if>
- <if test="price != null">
- #{price,jdbcType=DECIMAL},
- </if>
- <if test="productId != null">
- #{productId,jdbcType=BIGINT},
- </if>
- <if test="productName != null">
- #{productName,jdbcType=VARCHAR},
- </if>
- <if test="refundDate != null">
- #{refundDate,jdbcType=TIMESTAMP},
- </if>
- <if test="sn != null">
- #{sn,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="type != null">
- #{type,jdbcType=INTEGER},
- </if>
- <if test="trxNo != null">
- #{trxNo,jdbcType=VARCHAR},
- </if>
- <if test="refundTrxNo != null">
- #{refundTrxNo,jdbcType=VARCHAR},
- </if>
- <if test="refundAmount != null">
- #{refundAmount,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.shawn.model.entity.TOrderExample" resultType="java.lang.Long">
- select count(*) from t_order
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- update t_order
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=BIGINT},
- </if>
- <if test="record.createDate != null">
- create_date = #{record.createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.modifyDate != null">
- modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.adminId != null">
- admin_id = #{record.adminId,jdbcType=BIGINT},
- </if>
- <if test="record.adminProportion != null">
- admin_proportion = #{record.adminProportion,jdbcType=DECIMAL},
- </if>
- <if test="record.agencyId != null">
- agency_id = #{record.agencyId,jdbcType=BIGINT},
- </if>
- <if test="record.agencyProportion != null">
- agency_proportion = #{record.agencyProportion,jdbcType=DECIMAL},
- </if>
- <if test="record.altInfo != null">
- alt_info = #{record.altInfo,jdbcType=VARCHAR},
- </if>
- <if test="record.clientId != null">
- client_id = #{record.clientId,jdbcType=VARCHAR},
- </if>
- <if test="record.equipmentId != null">
- equipment_id = #{record.equipmentId,jdbcType=BIGINT},
- </if>
- <if test="record.frpCode != null">
- frp_code = #{record.frpCode,jdbcType=VARCHAR},
- </if>
- <if test="record.merchantId != null">
- merchant_id = #{record.merchantId,jdbcType=BIGINT},
- </if>
- <if test="record.merchantProportion != null">
- merchant_proportion = #{record.merchantProportion,jdbcType=DECIMAL},
- </if>
- <if test="record.payDate != null">
- pay_date = #{record.payDate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.personageId != null">
- personage_id = #{record.personageId,jdbcType=BIGINT},
- </if>
- <if test="record.personageProportion != null">
- personage_proportion = #{record.personageProportion,jdbcType=DECIMAL},
- </if>
- <if test="record.price != null">
- price = #{record.price,jdbcType=DECIMAL},
- </if>
- <if test="record.productId != null">
- product_id = #{record.productId,jdbcType=BIGINT},
- </if>
- <if test="record.productName != null">
- product_name = #{record.productName,jdbcType=VARCHAR},
- </if>
- <if test="record.refundDate != null">
- refund_date = #{record.refundDate,jdbcType=TIMESTAMP},
- </if>
- <if test="record.sn != null">
- sn = #{record.sn,jdbcType=VARCHAR},
- </if>
- <if test="record.status != null">
- status = #{record.status,jdbcType=INTEGER},
- </if>
- <if test="record.type != null">
- type = #{record.type,jdbcType=INTEGER},
- </if>
- <if test="record.trxNo != null">
- trx_no = #{record.trxNo,jdbcType=VARCHAR},
- </if>
- <if test="record.refundTrxNo != null">
- refund_trx_no = #{record.refundTrxNo,jdbcType=VARCHAR},
- </if>
- <if test="record.refundAmount != null">
- refund_amount = #{record.refundAmount,jdbcType=DECIMAL},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- update t_order
- set id = #{record.id,jdbcType=BIGINT},
- create_date = #{record.createDate,jdbcType=TIMESTAMP},
- modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
- admin_id = #{record.adminId,jdbcType=BIGINT},
- admin_proportion = #{record.adminProportion,jdbcType=DECIMAL},
- agency_id = #{record.agencyId,jdbcType=BIGINT},
- agency_proportion = #{record.agencyProportion,jdbcType=DECIMAL},
- alt_info = #{record.altInfo,jdbcType=VARCHAR},
- client_id = #{record.clientId,jdbcType=VARCHAR},
- equipment_id = #{record.equipmentId,jdbcType=BIGINT},
- frp_code = #{record.frpCode,jdbcType=VARCHAR},
- merchant_id = #{record.merchantId,jdbcType=BIGINT},
- merchant_proportion = #{record.merchantProportion,jdbcType=DECIMAL},
- pay_date = #{record.payDate,jdbcType=TIMESTAMP},
- personage_id = #{record.personageId,jdbcType=BIGINT},
- personage_proportion = #{record.personageProportion,jdbcType=DECIMAL},
- price = #{record.price,jdbcType=DECIMAL},
- product_id = #{record.productId,jdbcType=BIGINT},
- product_name = #{record.productName,jdbcType=VARCHAR},
- refund_date = #{record.refundDate,jdbcType=TIMESTAMP},
- sn = #{record.sn,jdbcType=VARCHAR},
- status = #{record.status,jdbcType=INTEGER},
- type = #{record.type,jdbcType=INTEGER},
- trx_no = #{record.trxNo,jdbcType=VARCHAR},
- refund_trx_no = #{record.refundTrxNo,jdbcType=VARCHAR},
- refund_amount = #{record.refundAmount,jdbcType=DECIMAL}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.shawn.model.entity.TOrder">
- update t_order
- <set>
- <if test="createDate != null">
- create_date = #{createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="modifyDate != null">
- modify_date = #{modifyDate,jdbcType=TIMESTAMP},
- </if>
- <if test="adminId != null">
- admin_id = #{adminId,jdbcType=BIGINT},
- </if>
- <if test="adminProportion != null">
- admin_proportion = #{adminProportion,jdbcType=DECIMAL},
- </if>
- <if test="agencyId != null">
- agency_id = #{agencyId,jdbcType=BIGINT},
- </if>
- <if test="agencyProportion != null">
- agency_proportion = #{agencyProportion,jdbcType=DECIMAL},
- </if>
- <if test="altInfo != null">
- alt_info = #{altInfo,jdbcType=VARCHAR},
- </if>
- <if test="clientId != null">
- client_id = #{clientId,jdbcType=VARCHAR},
- </if>
- <if test="equipmentId != null">
- equipment_id = #{equipmentId,jdbcType=BIGINT},
- </if>
- <if test="frpCode != null">
- frp_code = #{frpCode,jdbcType=VARCHAR},
- </if>
- <if test="merchantId != null">
- merchant_id = #{merchantId,jdbcType=BIGINT},
- </if>
- <if test="merchantProportion != null">
- merchant_proportion = #{merchantProportion,jdbcType=DECIMAL},
- </if>
- <if test="payDate != null">
- pay_date = #{payDate,jdbcType=TIMESTAMP},
- </if>
- <if test="personageId != null">
- personage_id = #{personageId,jdbcType=BIGINT},
- </if>
- <if test="personageProportion != null">
- personage_proportion = #{personageProportion,jdbcType=DECIMAL},
- </if>
- <if test="price != null">
- price = #{price,jdbcType=DECIMAL},
- </if>
- <if test="productId != null">
- product_id = #{productId,jdbcType=BIGINT},
- </if>
- <if test="productName != null">
- product_name = #{productName,jdbcType=VARCHAR},
- </if>
- <if test="refundDate != null">
- refund_date = #{refundDate,jdbcType=TIMESTAMP},
- </if>
- <if test="sn != null">
- sn = #{sn,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="type != null">
- type = #{type,jdbcType=INTEGER},
- </if>
- <if test="trxNo != null">
- trx_no = #{trxNo,jdbcType=VARCHAR},
- </if>
- <if test="refundTrxNo != null">
- refund_trx_no = #{refundTrxNo,jdbcType=VARCHAR},
- </if>
- <if test="refundAmount != null">
- refund_amount = #{refundAmount,jdbcType=DECIMAL},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.shawn.model.entity.TOrder">
- update t_order
- set create_date = #{createDate,jdbcType=TIMESTAMP},
- modify_date = #{modifyDate,jdbcType=TIMESTAMP},
- admin_id = #{adminId,jdbcType=BIGINT},
- admin_proportion = #{adminProportion,jdbcType=DECIMAL},
- agency_id = #{agencyId,jdbcType=BIGINT},
- agency_proportion = #{agencyProportion,jdbcType=DECIMAL},
- alt_info = #{altInfo,jdbcType=VARCHAR},
- client_id = #{clientId,jdbcType=VARCHAR},
- equipment_id = #{equipmentId,jdbcType=BIGINT},
- frp_code = #{frpCode,jdbcType=VARCHAR},
- merchant_id = #{merchantId,jdbcType=BIGINT},
- merchant_proportion = #{merchantProportion,jdbcType=DECIMAL},
- pay_date = #{payDate,jdbcType=TIMESTAMP},
- personage_id = #{personageId,jdbcType=BIGINT},
- personage_proportion = #{personageProportion,jdbcType=DECIMAL},
- price = #{price,jdbcType=DECIMAL},
- product_id = #{productId,jdbcType=BIGINT},
- product_name = #{productName,jdbcType=VARCHAR},
- refund_date = #{refundDate,jdbcType=TIMESTAMP},
- sn = #{sn,jdbcType=VARCHAR},
- status = #{status,jdbcType=INTEGER},
- type = #{type,jdbcType=INTEGER},
- trx_no = #{trxNo,jdbcType=VARCHAR},
- refund_trx_no = #{refundTrxNo,jdbcType=VARCHAR},
- refund_amount = #{refundAmount,jdbcType=DECIMAL}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <insert id="insertBatch" parameterType="java.util.List">
- insert into t_order (id,create_date,modify_date,admin_id,admin_proportion,agency_id,agency_proportion,alt_info,client_id,equipment_id,frp_code,merchant_id,merchant_proportion,pay_date,personage_id,personage_proportion,price,product_id,product_name,refund_date,sn,status,type,trx_no,refund_trx_no,refund_amount)
- <foreach collection="list" index="index" item="item" separator="union all">
- select #{item.id,jdbcType=BIGINT},#{item.createDate,jdbcType=TIMESTAMP},#{item.modifyDate,jdbcType=TIMESTAMP},#{item.adminId,jdbcType=BIGINT},#{item.adminProportion,jdbcType=DECIMAL},#{item.agencyId,jdbcType=BIGINT},#{item.agencyProportion,jdbcType=DECIMAL},#{item.altInfo,jdbcType=VARCHAR},#{item.clientId,jdbcType=VARCHAR},#{item.equipmentId,jdbcType=BIGINT},#{item.frpCode,jdbcType=VARCHAR},#{item.merchantId,jdbcType=BIGINT},#{item.merchantProportion,jdbcType=DECIMAL},#{item.payDate,jdbcType=TIMESTAMP},#{item.personageId,jdbcType=BIGINT},#{item.personageProportion,jdbcType=DECIMAL},#{item.price,jdbcType=DECIMAL},#{item.productId,jdbcType=BIGINT},#{item.productName,jdbcType=VARCHAR},#{item.refundDate,jdbcType=TIMESTAMP},#{item.sn,jdbcType=VARCHAR},#{item.status,jdbcType=INTEGER},#{item.type,jdbcType=INTEGER},#{item.trxNo,jdbcType=VARCHAR},#{item.refundTrxNo,jdbcType=VARCHAR},#{item.refundAmount,jdbcType=DECIMAL} from dual
- </foreach>
- </insert>
- <delete id="deleteBatchByIdList" parameterType="java.util.List">
- DELETE FROM t_order where id in
- <foreach close=")" collection="list" item="item" open="(" separator=",">
- #{item}
- </foreach>
- </delete>
- <update id="updateBatchByIdList" parameterType="com.shawn.model.param.TOrderParam">
- update t_order
- <trim prefix="set" suffixOverrides=",">
- <if test="id != null">
- id = #{id},
- </if>
- <if test="createDate != null">
- create_date = #{createDate},
- </if>
- <if test="modifyDate != null">
- modify_date = #{modifyDate},
- </if>
- <if test="adminId != null">
- admin_id = #{adminId},
- </if>
- <if test="adminProportion != null">
- admin_proportion = #{adminProportion},
- </if>
- <if test="agencyId != null">
- agency_id = #{agencyId},
- </if>
- <if test="agencyProportion != null">
- agency_proportion = #{agencyProportion},
- </if>
- <if test="altInfo != null">
- alt_info = #{altInfo},
- </if>
- <if test="clientId != null">
- client_id = #{clientId},
- </if>
- <if test="equipmentId != null">
- equipment_id = #{equipmentId},
- </if>
- <if test="frpCode != null">
- frp_code = #{frpCode},
- </if>
- <if test="merchantId != null">
- merchant_id = #{merchantId},
- </if>
- <if test="merchantProportion != null">
- merchant_proportion = #{merchantProportion},
- </if>
- <if test="payDate != null">
- pay_date = #{payDate},
- </if>
- <if test="personageId != null">
- personage_id = #{personageId},
- </if>
- <if test="personageProportion != null">
- personage_proportion = #{personageProportion},
- </if>
- <if test="price != null">
- price = #{price},
- </if>
- <if test="productId != null">
- product_id = #{productId},
- </if>
- <if test="productName != null">
- product_name = #{productName},
- </if>
- <if test="refundDate != null">
- refund_date = #{refundDate},
- </if>
- <if test="sn != null">
- sn = #{sn},
- </if>
- <if test="status != null">
- status = #{status},
- </if>
- <if test="type != null">
- type = #{type},
- </if>
- <if test="trxNo != null">
- trx_no = #{trxNo},
- </if>
- <if test="refundTrxNo != null">
- refund_trx_no = #{refundTrxNo},
- </if>
- <if test="refundAmount != null">
- refund_amount = #{refundAmount},
- </if>
- </trim>
- where id in
- <foreach close=")" collection="primaryKeyList" item="item" open="(" separator=",">
- #{item}
- </foreach>
- </update>
- <!-- 日统计 -->
- <select id="getDayStatistics" resultMap="chartBean" parameterType="com.shawn.model.param.StatisticsParam">
- select concat(DATE_FORMAT( a.create_date,'%H'),'点') as categorie,count(1) as saleNum,sum(a.price) as salePrice from t_order a
- where a.status='1' -- 支付成功
- <if test="adminId != null and adminId !=''">
- and a.admin_id= #{adminId} -- 所属商家id
- </if>
- <if test="equipmentId != null and equipmentId !=''">
- and a.equipment_id= #{equipmentId} -- 设备id
- </if>
- and DATE_FORMAT( a.create_date,'%Y/%m/%d') = #{startDate}
- group by DATE_FORMAT( a.create_date,'%H')
- order by categorie
- </select>
- <!-- 周统计 -->
- <select id="getWeekStatistics" resultMap="chartBean" parameterType="com.shawn.model.param.StatisticsParam">
- SELECT tab1.categorie,ifnull(tab2.saleNum,0) as saleNum,ifnull(tab2.salePrice,0) as salePrice from (
- select '周1' as categorie from dual UNION all
- select '周2' as categorie from dual UNION all
- select '周3' as categorie from dual UNION all
- select '周4' as categorie from dual UNION all
- select '周5' as categorie from dual UNION all
- select '周6' as categorie from dual UNION all
- select '周日' as categorie from dual) tab1
- left join (
- select case DATE_FORMAT( a.create_date,'%w') when 0 then '周日' else CONCAT('周',DATE_FORMAT( a.create_date,'%w')) end as categorie,
- count(1) as saleNum,sum(a.price) as salePrice from t_order a
- where a.status='1' -- 支付成功
- <if test="adminId != null and adminId !=''">
- and a.admin_id= #{adminId} -- 所属商家id
- </if>
- <if test="equipmentId != null and equipmentId !=''">
- and a.equipment_id= #{equipmentId} -- 设备id
- </if>
- AND a.create_date >= STR_TO_DATE(CONCAT(#{startDate},' 00:00:00'),'%Y/%m/%d %H:%i:%s')
- <![CDATA[ AND a.create_date <= STR_TO_DATE(CONCAT(#{endDate},' 23:59:59'),'%Y/%m/%d %H:%i:%s') ]]>
- group by DATE_FORMAT( a.create_date,'%w')
- ) tab2 on tab1.categorie = tab2.categorie
- </select>
- <!-- 月统计 -->
- <select id="getMonthStatistics" resultMap="chartBean" parameterType="com.shawn.model.param.StatisticsParam">
- select DATE_FORMAT( a.create_date,'%m月%d') as categorie,count(1) as saleNum,sum(a.price) as salePrice from t_order a
- where a.status='1' -- 支付成功
- <if test="adminId != null and adminId !=''">
- and a.admin_id= #{adminId} -- 所属商家id
- </if>
- <if test="equipmentId != null and equipmentId !=''">
- and a.equipment_id= #{equipmentId} -- 设备id
- </if>
- AND a.create_date >= STR_TO_DATE(CONCAT(#{startDate},' 00:00:00'),'%Y/%m/%d %H:%i:%s')
- <![CDATA[ AND a.create_date <= STR_TO_DATE(CONCAT(#{endDate},' 23:59:59'),'%Y/%m/%d %H:%i:%s') ]]>
- group by DATE_FORMAT( a.create_date,'%m月%d')
- </select>
- <!-- 年统计 -->
- <select id="getYearStatistics" resultMap="chartBean" parameterType="com.shawn.model.param.StatisticsParam">
- SELECT tab1.categorie,ifnull(tab2.saleNum,0) as saleNum,ifnull(tab2.salePrice,0) as salePrice from (
- select '01月' as categorie from dual UNION all
- select '02月' as categorie from dual UNION all
- select '03月' as categorie from dual UNION all
- select '04月' as categorie from dual UNION all
- select '05月' as categorie from dual UNION all
- select '06月' as categorie from dual UNION all
- select '07月' as categorie from dual UNION all
- select '08月' as categorie from dual UNION all
- select '09月' as categorie from dual UNION all
- select '10月' as categorie from dual UNION all
- select '11月' as categorie from dual UNION all
- select '12月' as categorie from dual) tab1
- left join (
- select concat(DATE_FORMAT( a.create_date,'%m'),'月') as categorie,count(1) as saleNum,sum(a.price) as salePrice from t_order a
- where a.status='1' -- 支付成功
- <if test="adminId != null and adminId !=''">
- and a.admin_id= #{adminId} -- 所属商家id
- </if>
- <if test="equipmentId != null and equipmentId !=''">
- and a.equipment_id= #{equipmentId} -- 设备id
- </if>
- AND a.create_date >= STR_TO_DATE(CONCAT(#{startDate},' 00:00:00'),'%Y/%m/%d %H:%i:%s')
- <![CDATA[ AND a.create_date <= STR_TO_DATE(CONCAT(#{endDate},' 23:59:59'),'%Y/%m/%d %H:%i:%s') ]]>
- group by DATE_FORMAT( a.create_date,'%m')
- ) tab2 on tab1.categorie = tab2.categorie
- </select>
- <!-- 汇总统计-->
- <select id="getMainStatistics" resultMap="chartBean">
- select 'day' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
- where date_format(a.create_date,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
- and a.status='1'
- <if test="adminId != null and adminId !=''">
- and a.admin_id= #{adminId} -- 所属商家id
- </if>
- <if test="equipmentId != null and equipmentId !=''">
- and a.equipment_id= #{equipmentId} -- 设备id
- </if>
- UNION all
- select 'week' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
- where YEARWEEK(date_format(a.create_date,'%Y-%m-%d'),1) = YEARWEEK(now(),1)
- and a.status='1'
- <if test="adminId != null and adminId !=''">
- and a.admin_id= #{adminId} -- 所属商家id
- </if>
- <if test="equipmentId != null and equipmentId !=''">
- and a.equipment_id= #{equipmentId} -- 设备id
- </if>
- UNION all
- select 'month' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
- where date_format(a.create_date,'%Y-%m') = date_format(now(),'%Y-%m')
- and a.status='1'
- <if test="adminId != null and adminId !=''">
- and a.admin_id= #{adminId} -- 所属商家id
- </if>
- <if test="equipmentId != null and equipmentId !=''">
- and a.equipment_id= #{equipmentId} -- 设备id
- </if>
- UNION all
- select 'year' as categorie, count(1) as saleNum,ifnull(sum(a.price),0) as salePrice from t_order a
- where date_format(a.create_date,'%Y') = date_format(now(),'%Y')
- and a.status='1'
- <if test="adminId != null and adminId !=''">
- and a.admin_id= #{adminId} -- 所属商家id
- </if>
- <if test="equipmentId != null and equipmentId !=''">
- and a.equipment_id= #{equipmentId} -- 设备id
- </if>
- </select>
- <!-- 统计 机器销售-->
- <select id="getEquipmentStatistics" resultMap="chartBean" parameterType="com.shawn.model.param.StatisticsParam">
- select ifnull(b.name,SUBSTRING(a.client_id,1,4)) as categorie,count(1) as saleNum,sum(a.price) as salePrice
- from t_order a,t_equipment b
- where b.id = a.equipment_id
- and a.admin_id= #{adminId} -- 所属商家id
- AND a.create_date >= STR_TO_DATE(CONCAT(#{startDate},' 00:00:00'),'%Y/%m/%d %H:%i:%s')
- <![CDATA[ AND a.create_date <= STR_TO_DATE(CONCAT(#{endDate},' 23:59:59'),'%Y/%m/%d %H:%i:%s') ]]>
- group by b.id
- order by saleNum desc
- limit 10
- </select>
- </mapper>
|