| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?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.sckw.payment.dao.KwpLedgerLogisticsMapper">
- <resultMap id="BaseResultMap" type="com.sckw.payment.model.KwpLedgerLogistics">
- <!--@mbg.generated-->
- <!--@Table kwp_ledger_logistics-->
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="ent_id" jdbcType="BIGINT" property="entId" />
- <result column="l_ledger_no" jdbcType="VARCHAR" property="lLedgerNo" />
- <result column="name" jdbcType="VARCHAR" property="name" />
- <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
- <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
- <result column="tax_rate" jdbcType="INTEGER" property="taxRate" />
- <result column="trading" jdbcType="INTEGER" property="trading" />
- <result column="unload_amount" jdbcType="DECIMAL" property="unloadAmount" />
- <result column="load_amount" jdbcType="DECIMAL" property="loadAmount" />
- <result column="deficit_amount" jdbcType="DECIMAL" property="deficitAmount" />
- <result column="lose_amount" jdbcType="DECIMAL" property="loseAmount" />
- <result column="total_price" jdbcType="DECIMAL" property="totalPrice" />
- <result column="settle_price" jdbcType="DECIMAL" property="settlePrice" />
- <result column="actual_price" jdbcType="DECIMAL" property="actualPrice" />
- <result column="audit_user" jdbcType="VARCHAR" property="auditUser" />
- <result column="audit_phone" jdbcType="VARCHAR" property="auditPhone" />
- <result column="url" jdbcType="VARCHAR" property="url" />
- <result column="generate_time" jdbcType="TIMESTAMP" property="generateTime" />
- <result column="remark" jdbcType="VARCHAR" property="remark" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="create_by" jdbcType="BIGINT" property="createBy" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="update_by" jdbcType="BIGINT" property="updateBy" />
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--@mbg.generated-->
- id, ent_id, l_ledger_no, `name`, start_time, end_time, tax_rate, trading, unload_amount,
- load_amount, deficit_amount, lose_amount, total_price, settle_price, actual_price,
- audit_user, audit_phone, url, generate_time, remark, `status`, create_by, create_time,
- update_by, update_time, del_flag
- </sql>
- <select id="pageSelect" resultType="com.sckw.payment.model.dto.LedgerLogisticsDto">
- select kll.id,
- kll.l_ledger_no lLedgerNo,
- kll.name,
- kll.start_time startTime,
- kll.end_time endTime,
- kll.tax_rate taxRate,
- kll.trading,
- kll.unload_amount unloadAmount,
- kll.load_amount loadAmount,
- kll.deficit_amount deficitAmount,
- kll.lose_amount loseAmount,
- kll.total_price totalPrice,
- kll.settle_price settlePrice,
- kll.actual_price actualPrice,
- kll.url,
- kll.generate_time generateTime,
- kll.remark,
- kll.status,
- count(kllo.id) orderCount
- from kwp_ledger_logistics kll
- inner join kwp_ledger_logistics_order kllo on kll.id = kllo.l_ledger_id
- <where>
- <choose>
- <when test="ids != null and ids.size() != 0">
- kll.id in
- <foreach close=")" collection="ids" item="id" open="" separator=",">
- #{id,jdbcType=BIGINT}
- </foreach>
- </when>
- <otherwise>
- kll.del_flag = 0
- and kllo.del_flag = 0
- <if test="logisticsReq.status != null">
- and kll.status = #{logisticsReq.status}
- </if>
- <if test="logisticsReq.trading != null">
- and kll.trading = #{logisticsReq.trading,jdbcType=INTEGER}
- </if>
- <if test="logisticsReq.startCreateTime != null and logisticsReq.endCreateTime != null">
- and kll.generate_time between #{logisticsReq.startCreateTime,jdbcType=TIMESTAMP}
- and #{logisticsReq.endCreateTime,jdbcType=TIMESTAMP}
- </if>
- <if test="logisticsReq.keywords != null and logisticsReq.keywords != ''">
- and (
- kll.l_ledger_no like concat('%'
- , #{logisticsReq.keywords}
- , '%')
- or kll.check_user like concat('%'
- , #{logisticsReq.keywords}
- , '%')
- <if test="ids != null and ids.size() != 0">
- or kll.check_ent_id in
- <foreach close=")" collection="ids" item="item" open="(" separator=",">
- #{item,jdbcType=BIGINT}
- </foreach>
- </if>
- )
- </if>
- </otherwise>
- </choose>
- </where>
- group by kll.id, kll.check_ent_id, kll.carrier_ent_id, kll.l_ledger_no, kll.name, kll.start_time, kll.end_time,
- kll.tax_rate, kll.trading, kll.unload_amount, kll.load_amount, kll.deficit_amount, kll.lose_amount,
- kll.total_price, kll.settle_price, kll.actual_price, kll.check_phone, kll.check_user,
- kll.carrier_phone, kll.carrier_user, kll.url, kll.generate_time, kll.remark, kll.status
- order by kll.generate_time desc
- </select>
- </mapper>
|