123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- <?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.kmall.admin.dao.SalesDataUploadDao">
- <resultMap type="com.kmall.admin.entity.SalesDataUploadEntity" id="salesDataUploadMap">
- <result property="fileId" column="file_id"/>
- <result property="fileName" column="file_name"/>
- <result property="fileType" column="file_type"/>
- <result property="uploadAddress" column="upload_address"/>
- <result property="createrSn" column="creater_sn"/>
- <result property="createrTime" column="creater_time"/>
- <result property="billTime" column="bill_time"/>
- <result property="checkTime" column="check_time"/>
- <result property="merchSN" column="merch_sn"/>
- <result property="shopSN" column="shop_sn"/>
- <result property="thirdMerchSN" column="third_merch_sn"/>
- </resultMap>
- <select id="queryObject" resultType="com.kmall.admin.entity.SalesDataUploadEntity">
- select
- u.file_id,
- u.file_name,
- u.file_type,
- u.upload_address,
- u.creater_sn,
- u.creater_time,
- su.username
- from mall_sales_data_upload u
- left join sys_user su
- on su.user_id = u.creater_sn
- where file_id = #{id}
- </select>
- <select id="queryList" resultType="com.kmall.admin.entity.SalesDataUploadEntity">
- select
- u.file_id,
- u.file_name,
- u.file_type,
- u.upload_address,
- u.creater_sn,
- u.creater_time,
- u.bill_time,
- u.check_time,
- u.merch_sn,
- u.third_merch_sn,
- u.shop_sn,
- ms.store_name shopName,
- su.username
- from mall_sales_data_upload u
- left join sys_user su
- on su.user_id = u.creater_sn
- left join mall_store ms
- on u.shop_sn = ms.id
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND u.file_name LIKE concat('%',#{name},'%')
- </if>
- <if test="startTime != null and startTime.trim() != ''">
- AND u.creater_time >= #{startTime}
- </if>
- <if test="endTime != null and endTime.trim() != ''">
- AND u.creater_time <= #{endTime}
- </if>
- <if test="merchSN != null and merchSN.trim() != ''">
- AND u.merch_sn = #{merchSN}
- </if>
- <if test="thirdMerchSN != null and thirdMerchSN.trim() != ''">
- AND u.third_merch_sn = #{thirdMerchSN}
- </if>
- <if test="shopSN != null and shopSN.trim() != ''">
- AND u.shop_sn = #{shopSN}
- </if>
- <choose>
- <when test="sidx != null and sidx.trim() != ''">
- order by ${sidx} ${order}
- </when>
- <otherwise>
- order by bill_time DESC, file_id desc
- </otherwise>
- </choose>
- <if test="offset != null and limit != null">
- limit #{offset}, #{limit}
- </if>
- </select>
-
- <select id="queryTotal" resultType="int">
- select count(*) from mall_sales_data_upload
- WHERE 1=1
- <if test="name != null and name.trim() != ''">
- AND file_name LIKE concat('%',#{name},'%')
- </if>
- <if test="startTime != null and startTime.trim() != ''">
- AND creater_time >= #{startTime}
- </if>
- <if test="endTime != null and endTime.trim() != ''">
- AND creater_time <= #{endTime}
- </if>
- <if test="merchSN != null and merchSN.trim() != ''">
- AND merch_sn = #{merchSN}
- </if>
- <if test="thirdMerchSN != null and thirdMerchSN.trim() != ''">
- AND third_merch_sn = #{thirdMerchSN}
- </if>
- <if test="shopSN != null and shopSN.trim() != ''">
- AND shop_sn = #{shopSN}
- </if>
- </select>
- <select id="queryObjects" resultType="com.kmall.admin.entity.SalesDataUploadEntity">
- select
- file_id,
- file_name,
- file_type,
- upload_address,
- creater_sn,
- creater_time,
- bill_time,
- check_time,
- merch_sn,
- third_merch_sn,
- shop_sn
- from mall_sales_data_upload
- where file_id in
- <foreach item="fileId" collection="array" open="(" separator="," close=")">
- #{fileId}
- </foreach>
- </select>
- <insert id="save" parameterType="com.kmall.admin.entity.SalesDataUploadEntity" useGeneratedKeys="true" keyProperty="fileId">
- insert into mall_sales_data_upload(
- `file_name`,
- `file_type`,
- `upload_address`,
- `creater_sn`,
- `creater_time`,
- `bill_time`,
- `check_time`,
- `merch_sn`,
- `third_merch_sn`,
- `shop_sn`)
- values(
- #{fileName},
- #{fileType},
- #{uploadAddress},
- #{createrSn},
- #{createrTime},
- #{billTime},
- #{checkTime},
- #{merchSN},
- #{thirdMerchSN},
- #{shopSN})
- </insert>
- <insert id="saveSalesDownload" parameterType="com.kmall.admin.entity.SalesDataDownloadEntity" useGeneratedKeys="true" keyProperty="id">
- insert into mall_sales_data_download(
- `file_id`,
- `download_ip`,
- `download_sn`,
- `download_time`)
- values(
- #{fileId},
- #{downloadIP},
- #{downloadSn},
- #{downloadTime})
- </insert>
- <update id="update" parameterType="com.kmall.admin.entity.SalesDataUploadEntity">
- update mall_sales_data_upload
- <set>
- <if test="fileName != null">`file_name` = #{fileName}, </if>
- <if test="fileType != null">`file_type` = #{fileType}, </if>
- <if test="uploadAddress != null">`upload_address` = #{uploadAddress}, </if>
- <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
- <if test="createrTime != null">`creater_time` = #{createrTime}</if>
- </set>
- where file_id = #{fileId}
- </update>
-
- <delete id="delete">
- delete from mall_sales_data_upload where file_id = #{value}
- </delete>
-
- <delete id="deleteBatch">
- delete from mall_sales_data_upload where file_id in
- <foreach item="fileId" collection="array" open="(" separator="," close=")">
- #{fileId}
- </foreach>
- </delete>
- </mapper>
|