123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586 |
- <?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.steerinfo.dil.mapper.BmstruckStatementMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.BmstruckStatement">
- <id column="STATEMENT_ID" jdbcType="DECIMAL" property="statementId"/>
- <result column="STATEMENT_NUMBER" jdbcType="VARCHAR" property="statementNumber"/>
- <result column="COST_ID" jdbcType="DECIMAL" property="costId"/>
- <result column="STATEMENT_PAYMENT_UNIT" jdbcType="VARCHAR" property="statementPaymentUnit"/>
- <result column="STATEMENT_EXCLUD_TAX" jdbcType="DECIMAL" property="statementExcludTax"/>
- <result column="STATEMENT_INCLUD_TAX" jdbcType="DECIMAL" property="statementIncludTax"/>
- <result column="STATEMENT_REMARK" jdbcType="VARCHAR" property="statementRemark"/>
- <result column="STATEMENT_SETTLEMENT_STATUS" jdbcType="VARCHAR" property="statementSettlementStatus"/>
- <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
- <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
- <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
- <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
- <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
- </resultMap>
- <sql id="columns">
- STATEMENT_ID, STATEMENT_NUMBER, COST_ID, STATEMENT_PAYMENT_UNIT, STATEMENT_EXCLUD_TAX,
- STATEMENT_INCLUD_TAX, STATEMENT_REMARK, STATEMENT_SETTLEMENT_STATUS, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
- </sql>
- <sql id="columns_alias">
- t.STATEMENT_ID, t.STATEMENT_NUMBER, t.COST_ID, t.STATEMENT_PAYMENT_UNIT, t.STATEMENT_EXCLUD_TAX,
- t.STATEMENT_INCLUD_TAX, t.STATEMENT_REMARK, t.STATEMENT_SETTLEMENT_STATUS, t.INSERT_USERNAME,
- t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
- </sql>
- <sql id="select">
- SELECT
- <include refid="columns"/>
- FROM BMSTRUCK_STATEMENT
- </sql>
- <sql id="select_alias">
- SELECT
- <include refid="columns_alias"/>
- FROM BMSTRUCK_STATEMENT t
- </sql>
- <sql id="where">
- <where>
- <if test="statementId != null">
- and STATEMENT_ID = #{statementId}
- </if>
- <if test="statementNumber != null and statementNumber != ''">
- and STATEMENT_NUMBER = #{statementNumber}
- </if>
- <if test="costId != null">
- and COST_ID = #{costId}
- </if>
- <if test="statementPaymentUnit != null and statementPaymentUnit != ''">
- and STATEMENT_PAYMENT_UNIT = #{statementPaymentUnit}
- </if>
- <if test="statementExcludTax != null">
- and STATEMENT_EXCLUD_TAX = #{statementExcludTax}
- </if>
- <if test="statementIncludTax != null">
- and STATEMENT_INCLUD_TAX = #{statementIncludTax}
- </if>
- <if test="statementRemark != null and statementRemark != ''">
- and STATEMENT_REMARK = #{statementRemark}
- </if>
- <if test="statementSettlementStatus != null and statementSettlementStatus != ''">
- and STATEMENT_SETTLEMENT_STATUS = #{statementSettlementStatus}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="statementId != null">
- and STATEMENT_ID = #{statementId}
- </if>
- <if test="statementNumber != null and statementNumber != ''">
- and STATEMENT_NUMBER LIKE '%${statementNumber}%'
- </if>
- <if test="costId != null">
- and COST_ID = #{costId}
- </if>
- <if test="statementPaymentUnit != null and statementPaymentUnit != ''">
- and STATEMENT_PAYMENT_UNIT LIKE '%${statementPaymentUnit}%'
- </if>
- <if test="statementExcludTax != null">
- and STATEMENT_EXCLUD_TAX = #{statementExcludTax}
- </if>
- <if test="statementIncludTax != null">
- and STATEMENT_INCLUD_TAX = #{statementIncludTax}
- </if>
- <if test="statementRemark != null and statementRemark != ''">
- and STATEMENT_REMARK LIKE '%${statementRemark}%'
- </if>
- <if test="statementSettlementStatus != null and statementSettlementStatus != ''">
- and STATEMENT_SETTLEMENT_STATUS LIKE '%${statementSettlementStatus}%'
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- and INSERT_USERNAME LIKE '%${insertUsername}%'
- </if>
- <if test="insertTime != null">
- and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- and UPDATE_USERNAME LIKE '%${updateUsername}%'
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete
- from BMSTRUCK_STATEMENT
- where STATEMENT_ID = #{statementId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from BMSTRUCK_STATEMENT
- where 1!=1
- <if test="statementNumber != null and statementNumber != ''">
- or STATEMENT_NUMBER = #{statementNumber}
- </if>
- <if test="costId != null">
- or COST_ID = #{costId}
- </if>
- <if test="statementPaymentUnit != null and statementPaymentUnit != ''">
- or STATEMENT_PAYMENT_UNIT = #{statementPaymentUnit}
- </if>
- <if test="statementExcludTax != null">
- or STATEMENT_EXCLUD_TAX = #{statementExcludTax}
- </if>
- <if test="statementIncludTax != null">
- or STATEMENT_INCLUD_TAX = #{statementIncludTax}
- </if>
- <if test="statementRemark != null and statementRemark != ''">
- or STATEMENT_REMARK = #{statementRemark}
- </if>
- <if test="statementSettlementStatus != null and statementSettlementStatus != ''">
- or STATEMENT_SETTLEMENT_STATUS = #{statementSettlementStatus}
- </if>
- <if test="insertUsername != null and insertUsername != ''">
- or INSERT_USERNAME = #{insertUsername}
- </if>
- <if test="insertTime != null">
- or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
- </if>
- <if test="updateUsername != null and updateUsername != ''">
- or UPDATE_USERNAME = #{updateUsername}
- </if>
- <if test="updateTime != null">
- or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
- </if>
- <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
- or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.BmstruckStatement">
- insert into BMSTRUCK_STATEMENT (STATEMENT_ID, STATEMENT_NUMBER, COST_ID,
- STATEMENT_PAYMENT_UNIT, STATEMENT_EXCLUD_TAX,
- STATEMENT_INCLUD_TAX, STATEMENT_REMARK, STATEMENT_SETTLEMENT_STATUS,
- INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK)
- values (#{statementId,jdbcType=DECIMAL}, #{statementNumber,jdbcType=VARCHAR}, #{costId,jdbcType=DECIMAL},
- #{statementPaymentUnit,jdbcType=VARCHAR}, #{statementExcludTax,jdbcType=DECIMAL},
- #{statementIncludTax,jdbcType=DECIMAL}, #{statementRemark,jdbcType=VARCHAR},
- #{statementSettlementStatus,jdbcType=VARCHAR},
- #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
- #{updateUsername,jdbcType=VARCHAR},
- #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmstruckStatement">
- insert into BMSTRUCK_STATEMENT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="statementId != null">
- STATEMENT_ID,
- </if>
- <if test="statementNumber != null">
- STATEMENT_NUMBER,
- </if>
- <if test="costId != null">
- COST_ID,
- </if>
- <if test="statementPaymentUnit != null">
- STATEMENT_PAYMENT_UNIT,
- </if>
- <if test="statementExcludTax != null">
- STATEMENT_EXCLUD_TAX,
- </if>
- <if test="statementIncludTax != null">
- STATEMENT_INCLUD_TAX,
- </if>
- <if test="statementRemark != null">
- STATEMENT_REMARK,
- </if>
- <if test="statementSettlementStatus != null">
- STATEMENT_SETTLEMENT_STATUS,
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME,
- </if>
- <if test="insertTime != null">
- INSERT_TIME,
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME,
- </if>
- <if test="updateTime != null">
- UPDATE_TIME,
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="statementId != null">
- #{statementId,jdbcType=DECIMAL},
- </if>
- <if test="statementNumber != null">
- #{statementNumber,jdbcType=VARCHAR},
- </if>
- <if test="costId != null">
- #{costId,jdbcType=DECIMAL},
- </if>
- <if test="statementPaymentUnit != null">
- #{statementPaymentUnit,jdbcType=VARCHAR},
- </if>
- <if test="statementExcludTax != null">
- #{statementExcludTax,jdbcType=DECIMAL},
- </if>
- <if test="statementIncludTax != null">
- #{statementIncludTax,jdbcType=DECIMAL},
- </if>
- <if test="statementRemark != null">
- #{statementRemark,jdbcType=VARCHAR},
- </if>
- <if test="statementSettlementStatus != null">
- #{statementSettlementStatus,jdbcType=VARCHAR},
- </if>
- <if test="insertUsername != null">
- #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmstruckStatement">
- update BMSTRUCK_STATEMENT
- set STATEMENT_NUMBER = #{statementNumber,jdbcType=VARCHAR},
- COST_ID = #{costId,jdbcType=DECIMAL},
- STATEMENT_PAYMENT_UNIT = #{statementPaymentUnit,jdbcType=VARCHAR},
- STATEMENT_EXCLUD_TAX = #{statementExcludTax,jdbcType=DECIMAL},
- STATEMENT_INCLUD_TAX = #{statementIncludTax,jdbcType=DECIMAL},
- STATEMENT_REMARK = #{statementRemark,jdbcType=VARCHAR},
- STATEMENT_SETTLEMENT_STATUS = #{statementSettlementStatus,jdbcType=VARCHAR},
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
- where STATEMENT_ID = #{statementId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmstruckStatement">
- update BMSTRUCK_STATEMENT
- <set>
- <if test="statementNumber != null">
- STATEMENT_NUMBER = #{statementNumber,jdbcType=VARCHAR},
- </if>
- <if test="costId != null">
- COST_ID = #{costId,jdbcType=DECIMAL},
- </if>
- <if test="statementPaymentUnit != null">
- STATEMENT_PAYMENT_UNIT = #{statementPaymentUnit,jdbcType=VARCHAR},
- </if>
- <if test="statementExcludTax != null">
- STATEMENT_EXCLUD_TAX = #{statementExcludTax,jdbcType=DECIMAL},
- </if>
- <if test="statementIncludTax != null">
- STATEMENT_INCLUD_TAX = #{statementIncludTax,jdbcType=DECIMAL},
- </if>
- <if test="statementRemark != null">
- STATEMENT_REMARK = #{statementRemark,jdbcType=VARCHAR},
- </if>
- <if test="statementSettlementStatus != null">
- STATEMENT_SETTLEMENT_STATUS = #{statementSettlementStatus,jdbcType=VARCHAR},
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateUsername != null">
- UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="insertUpdateRemark != null">
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
- </if>
- </set>
- where STATEMENT_ID = #{statementId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select"/>
- where STATEMENT_ID = #{statementId,jdbcType=DECIMAL}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="where"/>
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="whereLike"/>
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into BMSTRUCK_STATEMENT
- (STATEMENT_ID,
- STATEMENT_NUMBER, COST_ID, STATEMENT_PAYMENT_UNIT,
- STATEMENT_EXCLUD_TAX, STATEMENT_INCLUD_TAX,
- STATEMENT_REMARK, STATEMENT_SETTLEMENT_STATUS,
- INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME,
- INSERT_UPDATE_REMARK)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.statementId,jdbcType=DECIMAL},
- #{item.statementNumber,jdbcType=VARCHAR}, #{item.costId,jdbcType=DECIMAL},
- #{item.statementPaymentUnit,jdbcType=VARCHAR},
- #{item.statementExcludTax,jdbcType=DECIMAL}, #{item.statementIncludTax,jdbcType=DECIMAL},
- #{item.statementRemark,jdbcType=VARCHAR}, #{item.statementSettlementStatus,jdbcType=VARCHAR},
- #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
- #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
- #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update BMSTRUCK_STATEMENT
- set
- STATEMENT_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.statementId,jdbcType=DECIMAL}
- </foreach>
- ,STATEMENT_NUMBER=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.statementNumber,jdbcType=VARCHAR}
- </foreach>
- ,COST_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.costId,jdbcType=DECIMAL}
- </foreach>
- ,STATEMENT_PAYMENT_UNIT=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.statementPaymentUnit,jdbcType=VARCHAR}
- </foreach>
- ,STATEMENT_EXCLUD_TAX=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.statementExcludTax,jdbcType=DECIMAL}
- </foreach>
- ,STATEMENT_INCLUD_TAX=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.statementIncludTax,jdbcType=DECIMAL}
- </foreach>
- ,STATEMENT_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.statementRemark,jdbcType=VARCHAR}
- </foreach>
- ,STATEMENT_SETTLEMENT_STATUS=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.statementSettlementStatus,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach collection="list" item="item" index="index" separator=" " open="case STATEMENT_ID" close="end">
- when #{item.statementId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- where STATEMENT_ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.statementId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from BMSTRUCK_STATEMENT
- where STATEMENT_ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 展示汽运账单列表 -->
- <select id="getTruckStatementList" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT BS.STATEMENT_NUMBER AS "statementNumber",
- BS.INSERT_TIME AS "insertTime",
- BS.STATEMENT_PAYMENT_UNIT AS "statementPaymentUnit",
- BS.STATEMENT_EXCLUD_TAX AS "statementExcludTax",
- BC.CHECK_CARRIER_STATUS AS "checkCarrierStatus",
- BC.CHECK_RECEIVE_CUSTOMER_STATUS AS "checkReceiveCustomerStatus",
- BC.CHECK_SHIPPER_STATUS AS "checkShipperStatus",
- BS.STATEMENT_ID AS "statementId",
- BC.CARRIER_ID AS "carrierId",
- BC.SHIPPER_ID AS "shipperId"
- FROM BMSTRUCK_STATEMENT BS
- LEFT JOIN BMSTRUCK_CHECK BC
- ON BC.STATEMENT_ID = BS.STATEMENT_ID
- )
- <where>
- <if test="statementNumber!= null">
- and
- <foreach collection="statementNumber" item="item" open="(" separator="," close=")">
- "statementNumber" in #{item}
- </foreach>
- </if>
- <if test="insertTime!= null">
- and
- <foreach collection="insertTime" item="item" open="(" separator="," close=")">
- "insertTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="statementPaymentUnit!= null">
- and
- <foreach collection="statementPaymentUnit" item="item" open="(" separator="," close=")">
- "statementPaymentUnit" in #{item}
- </foreach>
- </if>
- <if test="statementExcludTax!= null">
- and
- <foreach collection="statementExcludTax" item="item" open="(" separator="," close=")">
- "statementExcludTax" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- <sql id="orderBy">
- <if test="orderField != null and orderField != ''">
- order by "${orderField}"
- <if test="orderType != null and orderType != ''">
- ${orderType}
- </if>
- </if>
- <if test="orderField == null ">
- order by "insertTime" desc
- </if>
- </sql>
- <!-- 销售汽运账单下的详单 -->
- <select id="getSaleTruckStatementDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
- SELECT * FROM(
- SELECT DISTINCT
- bdo.INSERT_TIME as "insertTime",
- bdo.DETAILS_ID as "detailsId",
- oo.ORDER_ID as "orderId",
- bdo.DETAILS_NO as "detailsNo",
- oo.ORDER_NUMBER as "orderNumber",
- bdo.DETAILS_TIME as "detailsTime",
- rc.CAPACITY_NUMBER as "capacityNumber",
- rct.CAPACITY_TYPE_NAME as "capacityTypeName",
- rs.SHIPPER_NAME as "shipperName",
- rco.CONSIGNEE_RECEIVE_ADDRESS as "consigneeReceiveAddress",
- actp.PRICE_VALUE as "priceValue",
- bdo.DETAILS_AMOUNT as "detailsAmount"
- FROM BMSTRUCK_DETAILS_ORDER bdo
- LEFT JOIN OMSTRUCK_ORDER oo
- ON oo.ORDER_ID = bdo.ORDER_ID
- LEFT JOIN AMS_SALE_ORDER_MATERIAL asom
- ON oo.ORDER_PLAN_ID = asom.SALE_ORDER_MATERIAL_ID
- LEFT JOIN AMS_SALE_ORDER aso
- ON aso.SALE_ORDER_ID = asom.SALE_ORDER_ID
- LEFT JOIN RMS_SHIPPER rs
- ON rs.SHIPPER_ID = aso.SHIPPER_ID
- LEFT JOIN RMS_CONSIGNEE rco
- ON rco.CONSIGNEE_ID = aso.RECEIVE_ID
- LEFT JOIN RMS_CAPACITY rc
- ON oo.CAPACITY_ID = rc.CAPACITY_ID
- LEFT JOIN RMS_CAPACITY_TYPE rct
- ON rct.CAPACITY_TYPE_ID = rc.CAPACITY_TYPE_ID
- LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE actp
- ON actp.PRICE_ID = bdo.PRICE_ID
- LEFT JOIN BMSTRUCK_DETAILS_STATEMENT bds
- ON bdo.DETAILS_ID = bds.DETAILS_ID
- WHERE bds.STATEMENT_ID = #{statementId}
- AND bdo.WETHER_TO_STATEMENT = 0
- )
- <where>
- <if test="detailsNo!= null">
- and
- <foreach collection="detailsNo" item="item" open="(" separator="," close=")">
- "detailsNo" in #{item}
- </foreach>
- </if>
- <if test="orderNumber!= null">
- and
- <foreach collection="orderNumber" item="item" open="(" separator="," close=")">
- "orderNumber" in #{item}
- </foreach>
- </if>
- <if test="detailsTime!= null">
- and
- <foreach collection="detailsTime" item="item" open="(" separator="," close=")">
- "detailsTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
- </foreach>
- </if>
- <if test="capacityNumber!= null">
- and
- <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
- "capacityNumber" in #{item}
- </foreach>
- </if>
- <if test="capacityTypeName!= null">
- and
- <foreach collection="capacityTypeName" item="item" open="(" separator="," close=")">
- "capacityTypeName" in #{item}
- </foreach>
- </if>
- <if test="shipperName!= null">
- and
- <foreach collection="shipperName" item="item" open="(" separator="," close=")">
- "shipperName" in #{item}
- </foreach>
- </if>
- <if test="consigneeReceiveAddress!= null">
- and
- <foreach collection="consigneeReceiveAddress" item="item" open="(" separator="," close=")">
- "consigneeReceiveAddress" in #{item}
- </foreach>
- </if>
- <if test="priceValue!= null">
- and
- <foreach collection="priceValue" item="item" open="(" separator="," close=")">
- "priceValue" in #{item}
- </foreach>
- </if>
- <if test="detailsAmount!= null">
- and
- <foreach collection="detailsAmount" item="item" open="(" separator="," close=")">
- "detailsAmount" in #{item}
- </foreach>
- </if>
- </where>
- <include refid="orderBy"></include>
- </select>
- </mapper>
|