12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061 |
- <?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.TmstruckWeightResultMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckWeightResult">
- <id column="WEIGHT_TASK_RESULT_ID" jdbcType="DECIMAL" property="weightTaskResultId" />
- <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
- <result column="RESULT_POUND_NO" jdbcType="VARCHAR" property="resultPoundNo" />
- <result column="RESULT_GROSS_WEIGHT" jdbcType="DECIMAL" property="resultGrossWeight" />
- <result column="RESULT_GROSS_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultGrossWeightTime" />
- <result column="RESULT_TARE_WEIGHT" jdbcType="DECIMAL" property="resultTareWeight" />
- <result column="RESULT_TARE_WEIGHT_TIME" jdbcType="TIMESTAMP" property="resultTareWeightTime" />
- <result column="RESULT_NET_WEIGHT" jdbcType="DECIMAL" property="resultNetWeight" />
- <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" />
- <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
- <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
- <result column="RESULT_GROSS_PLACE_ID" jdbcType="DECIMAL" property="resultGrossPlaceId" />
- <result column="RESULT_TARE_PLACE_ID" jdbcType="DECIMAL" property="resultTarePlaceId" />
- <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
- <result column="ISDEDUCT" jdbcType="DECIMAL" property="isdeduct" />
- <result column="ISQUALITY" jdbcType="DECIMAL" property="isquality" />
- <result column="GROSS_SEGMENT_SQE" jdbcType="DECIMAL" property="grossSegmentSqe" />
- <result column="TARE_SEGMENT_SQE" jdbcType="DECIMAL" property="tareSegmentSqe" />
- <result column="MATERIAL_NUM" jdbcType="DECIMAL" property="materialNum" />
- </resultMap>
- <sql id="columns">
- WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID, RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
- RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME, RESULT_NET_WEIGHT, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETE_NAME, DELETE_TIME,
- RESULT_GROSS_PLACE_ID, RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT, ISQUALITY, GROSS_SEGMENT_SQE,
- TARE_SEGMENT_SQE, MATERIAL_NUM
- </sql>
- <sql id="columns_alias">
- t.WEIGHT_TASK_RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_POUND_NO, t.RESULT_GROSS_WEIGHT,
- t.RESULT_GROSS_WEIGHT_TIME, t.RESULT_TARE_WEIGHT, t.RESULT_TARE_WEIGHT_TIME, t.RESULT_NET_WEIGHT,
- t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
- t.DELETE_NAME, t.DELETE_TIME, t.RESULT_GROSS_PLACE_ID, t.RESULT_TARE_PLACE_ID, t.MATERIAL_ID,
- t.ISDEDUCT, t.ISQUALITY, t.GROSS_SEGMENT_SQE, t.TARE_SEGMENT_SQE, t.MATERIAL_NUM
- </sql>
- <sql id="select">
- SELECT <include refid="columns" /> FROM TMSTRUCK_WEIGHT_RESULT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias" /> FROM TMSTRUCK_WEIGHT_RESULT t
- </sql>
- <sql id="where">
- <where>
- <if test="weightTaskResultId != null">
- and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
- </if>
- <if test="resultTotalId != null">
- and RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultPoundNo != null and resultPoundNo != ''">
- and RESULT_POUND_NO = #{resultPoundNo}
- </if>
- <if test="resultGrossWeight != null">
- and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
- </if>
- <if test="resultGrossWeightTime != null">
- and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
- </if>
- <if test="resultTareWeight != null">
- and RESULT_TARE_WEIGHT = #{resultTareWeight}
- </if>
- <if test="resultTareWeightTime != null">
- and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
- </if>
- <if test="resultNetWeight != null">
- and RESULT_NET_WEIGHT = #{resultNetWeight}
- </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>
- <if test="deleteName != null and deleteName != ''">
- and DELETE_NAME = #{deleteName}
- </if>
- <if test="deleteTime != null">
- and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
- </if>
- <if test="resultGrossPlaceId != null">
- and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
- </if>
- <if test="resultTarePlaceId != null">
- and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="isdeduct != null">
- and ISDEDUCT = #{isdeduct}
- </if>
- <if test="isquality != null">
- and ISQUALITY = #{isquality}
- </if>
- <if test="grossSegmentSqe != null">
- and GROSS_SEGMENT_SQE = #{grossSegmentSqe}
- </if>
- <if test="tareSegmentSqe != null">
- and TARE_SEGMENT_SQE = #{tareSegmentSqe}
- </if>
- <if test="materialNum != null">
- and MATERIAL_NUM = #{materialNum}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="weightTaskResultId != null">
- and WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
- </if>
- <if test="resultTotalId != null">
- and RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultPoundNo != null and resultPoundNo != ''">
- and RESULT_POUND_NO LIKE '%${resultPoundNo}%'
- </if>
- <if test="resultGrossWeight != null">
- and RESULT_GROSS_WEIGHT = #{resultGrossWeight}
- </if>
- <if test="resultGrossWeightTime != null">
- and TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = #{resultGrossWeightTime}
- </if>
- <if test="resultTareWeight != null">
- and RESULT_TARE_WEIGHT = #{resultTareWeight}
- </if>
- <if test="resultTareWeightTime != null">
- and TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = #{resultTareWeightTime}
- </if>
- <if test="resultNetWeight != null">
- and RESULT_NET_WEIGHT = #{resultNetWeight}
- </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>
- <if test="deleteName != null and deleteName != ''">
- and DELETE_NAME LIKE '%${deleteName}%'
- </if>
- <if test="deleteTime != null">
- and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
- </if>
- <if test="resultGrossPlaceId != null">
- and RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
- </if>
- <if test="resultTarePlaceId != null">
- and RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
- </if>
- <if test="materialId != null">
- and MATERIAL_ID = #{materialId}
- </if>
- <if test="isdeduct != null">
- and ISDEDUCT = #{isdeduct}
- </if>
- <if test="isquality != null">
- and ISQUALITY = #{isquality}
- </if>
- <if test="grossSegmentSqe != null">
- and GROSS_SEGMENT_SQE = #{grossSegmentSqe}
- </if>
- <if test="tareSegmentSqe != null">
- and TARE_SEGMENT_SQE = #{tareSegmentSqe}
- </if>
- <if test="materialNum != null">
- and MATERIAL_NUM = #{materialNum}
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
- delete from TMSTRUCK_WEIGHT_RESULT
- where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from TMSTRUCK_WEIGHT_RESULT
- where 1!=1
- <if test="resultTotalId != null">
- or RESULT_TOTAL_ID = #{resultTotalId}
- </if>
- <if test="resultPoundNo != null and resultPoundNo != ''">
- or RESULT_POUND_NO = #{resultPoundNo}
- </if>
- <if test="resultGrossWeight != null">
- or RESULT_GROSS_WEIGHT = #{resultGrossWeight}
- </if>
- <if test="resultGrossWeightTime != null">
- or TO_CHAR(RESULT_GROSS_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultGrossWeightTime}'
- </if>
- <if test="resultTareWeight != null">
- or RESULT_TARE_WEIGHT = #{resultTareWeight}
- </if>
- <if test="resultTareWeightTime != null">
- or TO_CHAR(RESULT_TARE_WEIGHT_TIME,'yyyy-MM-dd') = '#{resultTareWeightTime}'
- </if>
- <if test="resultNetWeight != null">
- or RESULT_NET_WEIGHT = #{resultNetWeight}
- </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>
- <if test="deleteName != null and deleteName != ''">
- or DELETE_NAME = #{deleteName}
- </if>
- <if test="deleteTime != null">
- or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
- </if>
- <if test="resultGrossPlaceId != null">
- or RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId}
- </if>
- <if test="resultTarePlaceId != null">
- or RESULT_TARE_PLACE_ID = #{resultTarePlaceId}
- </if>
- <if test="materialId != null">
- or MATERIAL_ID = #{materialId}
- </if>
- <if test="isdeduct != null">
- or ISDEDUCT = #{isdeduct}
- </if>
- <if test="isquality != null">
- or ISQUALITY = #{isquality}
- </if>
- <if test="grossSegmentSqe != null">
- or GROSS_SEGMENT_SQE = #{grossSegmentSqe}
- </if>
- <if test="tareSegmentSqe != null">
- or TARE_SEGMENT_SQE = #{tareSegmentSqe}
- </if>
- <if test="materialNum != null">
- or MATERIAL_NUM = #{materialNum}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
- insert into TMSTRUCK_WEIGHT_RESULT (WEIGHT_TASK_RESULT_ID, RESULT_TOTAL_ID,
- RESULT_POUND_NO, RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
- RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
- RESULT_NET_WEIGHT, INSERT_USERNAME, INSERT_TIME,
- UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
- RESULT_TARE_PLACE_ID, MATERIAL_ID, ISDEDUCT,
- ISQUALITY, GROSS_SEGMENT_SQE, TARE_SEGMENT_SQE,
- MATERIAL_NUM)
- values (#{weightTaskResultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
- #{resultPoundNo,jdbcType=VARCHAR}, #{resultGrossWeight,jdbcType=DECIMAL}, #{resultGrossWeightTime,jdbcType=TIMESTAMP},
- #{resultTareWeight,jdbcType=DECIMAL}, #{resultTareWeightTime,jdbcType=TIMESTAMP},
- #{resultNetWeight,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
- #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
- #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultGrossPlaceId,jdbcType=DECIMAL},
- #{resultTarePlaceId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL}, #{isdeduct,jdbcType=DECIMAL},
- #{isquality,jdbcType=DECIMAL}, #{grossSegmentSqe,jdbcType=DECIMAL}, #{tareSegmentSqe,jdbcType=DECIMAL},
- #{materialNum,jdbcType=DECIMAL})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
- insert into TMSTRUCK_WEIGHT_RESULT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="weightTaskResultId != null">
- WEIGHT_TASK_RESULT_ID,
- </if>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID,
- </if>
- <if test="resultPoundNo != null">
- RESULT_POUND_NO,
- </if>
- <if test="resultGrossWeight != null">
- RESULT_GROSS_WEIGHT,
- </if>
- <if test="resultGrossWeightTime != null">
- RESULT_GROSS_WEIGHT_TIME,
- </if>
- <if test="resultTareWeight != null">
- RESULT_TARE_WEIGHT,
- </if>
- <if test="resultTareWeightTime != null">
- RESULT_TARE_WEIGHT_TIME,
- </if>
- <if test="resultNetWeight != null">
- RESULT_NET_WEIGHT,
- </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>
- <if test="deleteName != null">
- DELETE_NAME,
- </if>
- <if test="deleteTime != null">
- DELETE_TIME,
- </if>
- <if test="resultGrossPlaceId != null">
- RESULT_GROSS_PLACE_ID,
- </if>
- <if test="resultTarePlaceId != null">
- RESULT_TARE_PLACE_ID,
- </if>
- <if test="materialId != null">
- MATERIAL_ID,
- </if>
- <if test="isdeduct != null">
- ISDEDUCT,
- </if>
- <if test="isquality != null">
- ISQUALITY,
- </if>
- <if test="grossSegmentSqe != null">
- GROSS_SEGMENT_SQE,
- </if>
- <if test="tareSegmentSqe != null">
- TARE_SEGMENT_SQE,
- </if>
- <if test="materialNum != null">
- MATERIAL_NUM,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="weightTaskResultId != null">
- #{weightTaskResultId,jdbcType=DECIMAL},
- </if>
- <if test="resultTotalId != null">
- #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="resultPoundNo != null">
- #{resultPoundNo,jdbcType=VARCHAR},
- </if>
- <if test="resultGrossWeight != null">
- #{resultGrossWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultGrossWeightTime != null">
- #{resultGrossWeightTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultTareWeight != null">
- #{resultTareWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultTareWeightTime != null">
- #{resultTareWeightTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultNetWeight != null">
- #{resultNetWeight,jdbcType=DECIMAL},
- </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>
- <if test="deleteName != null">
- #{deleteName,jdbcType=VARCHAR},
- </if>
- <if test="deleteTime != null">
- #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultGrossPlaceId != null">
- #{resultGrossPlaceId,jdbcType=DECIMAL},
- </if>
- <if test="resultTarePlaceId != null">
- #{resultTarePlaceId,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="isdeduct != null">
- #{isdeduct,jdbcType=DECIMAL},
- </if>
- <if test="isquality != null">
- #{isquality,jdbcType=DECIMAL},
- </if>
- <if test="grossSegmentSqe != null">
- #{grossSegmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="tareSegmentSqe != null">
- #{tareSegmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="materialNum != null">
- #{materialNum,jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
- update TMSTRUCK_WEIGHT_RESULT
- set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
- RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
- RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
- RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
- RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
- RESULT_NET_WEIGHT = #{resultNetWeight,jdbcType=DECIMAL},
- 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},
- DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
- DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
- RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
- RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
- ISQUALITY = #{isquality,jdbcType=DECIMAL},
- GROSS_SEGMENT_SQE = #{grossSegmentSqe,jdbcType=DECIMAL},
- TARE_SEGMENT_SQE = #{tareSegmentSqe,jdbcType=DECIMAL},
- MATERIAL_NUM = #{materialNum,jdbcType=DECIMAL}
- where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckWeightResult">
- update TMSTRUCK_WEIGHT_RESULT
- <set>
- <if test="resultTotalId != null">
- RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
- </if>
- <if test="resultPoundNo != null">
- RESULT_POUND_NO = #{resultPoundNo,jdbcType=VARCHAR},
- </if>
- <if test="resultGrossWeight != null">
- RESULT_GROSS_WEIGHT = #{resultGrossWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultGrossWeightTime != null">
- RESULT_GROSS_WEIGHT_TIME = #{resultGrossWeightTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultTareWeight != null">
- RESULT_TARE_WEIGHT = #{resultTareWeight,jdbcType=DECIMAL},
- </if>
- <if test="resultTareWeightTime != null">
- RESULT_TARE_WEIGHT_TIME = #{resultTareWeightTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultNetWeight != null">
- RESULT_NET_WEIGHT = #{resultNetWeight,jdbcType=DECIMAL},
- </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>
- <if test="deleteName != null">
- DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
- </if>
- <if test="deleteTime != null">
- DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
- </if>
- <if test="resultGrossPlaceId != null">
- RESULT_GROSS_PLACE_ID = #{resultGrossPlaceId,jdbcType=DECIMAL},
- </if>
- <if test="resultTarePlaceId != null">
- RESULT_TARE_PLACE_ID = #{resultTarePlaceId,jdbcType=DECIMAL},
- </if>
- <if test="materialId != null">
- MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
- </if>
- <if test="isdeduct != null">
- ISDEDUCT = #{isdeduct,jdbcType=DECIMAL},
- </if>
- <if test="isquality != null">
- ISQUALITY = #{isquality,jdbcType=DECIMAL},
- </if>
- <if test="grossSegmentSqe != null">
- GROSS_SEGMENT_SQE = #{grossSegmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="tareSegmentSqe != null">
- TARE_SEGMENT_SQE = #{tareSegmentSqe,jdbcType=DECIMAL},
- </if>
- <if test="materialNum != null">
- MATERIAL_NUM = #{materialNum,jdbcType=DECIMAL},
- </if>
- </set>
- where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="DECIMAL" resultMap="BaseResultMap">
- <include refid="select" />
- where WEIGHT_TASK_RESULT_ID = #{weightTaskResultId,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 TMSTRUCK_WEIGHT_RESULT
- (WEIGHT_TASK_RESULT_ID,
- RESULT_TOTAL_ID, RESULT_POUND_NO,
- RESULT_GROSS_WEIGHT, RESULT_GROSS_WEIGHT_TIME,
- RESULT_TARE_WEIGHT, RESULT_TARE_WEIGHT_TIME,
- RESULT_NET_WEIGHT, INSERT_USERNAME,
- INSERT_TIME, UPDATE_USERNAME,
- UPDATE_TIME, INSERT_UPDATE_REMARK,
- DELETE_NAME, DELETE_TIME, RESULT_GROSS_PLACE_ID,
- RESULT_TARE_PLACE_ID, MATERIAL_ID,
- ISDEDUCT, ISQUALITY, GROSS_SEGMENT_SQE,
- TARE_SEGMENT_SQE, MATERIAL_NUM)
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.weightTaskResultId,jdbcType=DECIMAL},
- #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultPoundNo,jdbcType=VARCHAR},
- #{item.resultGrossWeight,jdbcType=DECIMAL}, #{item.resultGrossWeightTime,jdbcType=TIMESTAMP},
- #{item.resultTareWeight,jdbcType=DECIMAL}, #{item.resultTareWeightTime,jdbcType=TIMESTAMP},
- #{item.resultNetWeight,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
- #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
- #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
- #{item.deleteName,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultGrossPlaceId,jdbcType=DECIMAL},
- #{item.resultTarePlaceId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL},
- #{item.isdeduct,jdbcType=DECIMAL}, #{item.isquality,jdbcType=DECIMAL}, #{item.grossSegmentSqe,jdbcType=DECIMAL},
- #{item.tareSegmentSqe,jdbcType=DECIMAL}, #{item.materialNum,jdbcType=DECIMAL} from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update TMSTRUCK_WEIGHT_RESULT
- set
- WEIGHT_TASK_RESULT_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.weightTaskResultId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_TOTAL_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_POUND_NO=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultPoundNo,jdbcType=VARCHAR}
- </foreach>
- ,RESULT_GROSS_WEIGHT=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeight,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_GROSS_WEIGHT_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossWeightTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_TARE_WEIGHT=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeight,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_TARE_WEIGHT_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTareWeightTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_NET_WEIGHT=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultNetWeight,jdbcType=DECIMAL}
- </foreach>
- ,INSERT_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,INSERT_UPDATE_REMARK=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
- </foreach>
- ,DELETE_NAME=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
- </foreach>
- ,DELETE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
- </foreach>
- ,RESULT_GROSS_PLACE_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultGrossPlaceId,jdbcType=DECIMAL}
- </foreach>
- ,RESULT_TARE_PLACE_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.resultTarePlaceId,jdbcType=DECIMAL}
- </foreach>
- ,MATERIAL_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
- </foreach>
- ,ISDEDUCT=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isdeduct,jdbcType=DECIMAL}
- </foreach>
- ,ISQUALITY=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.isquality,jdbcType=DECIMAL}
- </foreach>
- ,GROSS_SEGMENT_SQE=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.grossSegmentSqe,jdbcType=DECIMAL}
- </foreach>
- ,TARE_SEGMENT_SQE=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.tareSegmentSqe,jdbcType=DECIMAL}
- </foreach>
- ,MATERIAL_NUM=
- <foreach close="end" collection="list" index="index" item="item" open="case WEIGHT_TASK_RESULT_ID" separator=" ">
- when #{item.weightTaskResultId,jdbcType=DECIMAL} then #{item.materialNum,jdbcType=DECIMAL}
- </foreach>
- where WEIGHT_TASK_RESULT_ID in
- <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
- #{item.weightTaskResultId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from TMSTRUCK_WEIGHT_RESULT
- where WEIGHT_TASK_RESULT_ID in
- <foreach close=")" collection="list" item="id" open="(" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 得到计重实绩主键id -->
- <!-- 得到汽车衡id -->
- <select id="getTruckCalculateId" parameterType="java.lang.String" resultType="DECIMAL">
- SELECT
- RTC.TRUCK_CALCULATE_ID AS "resultTarePlaceId"
- FROM RMS_TRUCK_CALCULATE RTC
- WHERE RTC.TRUCK_CALCULATE_NUMBER = #{resultCalculateNumber}
- </select>
- <select id="getWeightTaskResultId" resultType="DECIMAL" parameterType="java.util.Map">
- SELECT TWR.WEIGHT_TASK_RESULT_ID as "weightTaskResultId"
- FROM TMSTRUCK_WEIGHT_RESULT TWR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
- ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- WHERE OO.ORDER_NUMBER = #{orderNumber,jdbcType=VARCHAR}
- and TWR.MATERIAL_ID=#{materialId,jdbcType=DECIMAL}
- </select>
- <select id="selectWzInputId" resultType="java.util.Map">
- --采购内转
- SELECT
- *
- FROM
- (
- (
- SELECT DISTINCT
- twr.RESULT_TOTAL_ID "resultTotalId",
- RC.CAPACITY_NUMBER "capacityNumber",
- to_char( TWR.RESULT_GROSS_WEIGHT_TIME, 'YYYYMMDDHH24MISS' ) "grossWeightTime",
- oo.order_id "orderId"
- FROM
- TMSTRUCK_WEIGHT_RESULT TWR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN TMSTRUCK_QUALITY_RESULT TQR ON TQR.TOTAL_RESULT_ID = TTR.RESULT_TOTAL_ID
- WHERE
- TWR.GROSS_SEGMENT_SQE = 7
- AND TWR.tare_SEGMENT_SQE = 9
- AND TER.SEGMEN_SQE = 6
- AND twr.RESULT_NET_WEIGHT IS NOT NULL
- AND TQR.RESULT_ID IS NULL
- AND OO.ORDER_STATUS = 2
- AND OO.ORDER_TYPE IN ( 10, 20 )
- ) UNION ALL--普通采购
- SELECT DISTINCT
- twr.RESULT_TOTAL_ID "resultTotalId",
- RC.CAPACITY_NUMBER "capacityNumber",
- to_char( TWR.RESULT_GROSS_WEIGHT_TIME, 'YYYYMMDDHH24MISS' ) "grossWeightTime",
- oo.order_id "orderId"
- FROM
- TMSTRUCK_WEIGHT_RESULT TWR
- LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
- LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- LEFT JOIN TMSTRUCK_QUALITY_RESULT TQR ON TQR.TOTAL_RESULT_ID = TTR.RESULT_TOTAL_ID
- WHERE
- twr.RESULT_NET_WEIGHT IS NOT NULL
- AND TQR.RESULT_ID IS NULL
- AND OO.ORDER_STATUS = 2
- AND OO.ORDER_TYPE IN ( 5, 6, 7, 17, 18,15, 16, 23, 24 )
- )
- ORDER BY
- "orderId" DESC
- </select>
- <update id="updateWzInputId" parameterType="decimal">
- update TMSTRUCK_WEIGHT_RESULT twr
- set twr.ISQUALITY=1
- where twr.RESULT_TOTAL_ID=#{resultTotalId}
- </update>
- <update id="updateTruckWeightResult" parameterType="java.util.Map">
- UPDATE (
- SELECT
- *
- FROM
- TMSTRUCK_WEIGHT_RESULT twr
- WHERE
- twr.RESULT_TOTAL_ID = (
- SELECT
- ttr.RESULT_TOTAL_ID
- FROM
- TMSTRUCK_TOTAL_RESULT ttr
- WHERE
- ttr.ORDER_ID = ( SELECT oo.ORDER_ID FROM OMSTRUCK_ORDER oo WHERE oo.ORDER_NUMBER = #{orderNumber} )
- )
- ) tt
- SET
- tt.RESULT_TARE_WEIGHT = #{resultWeight},
- tt.RESULT_NET_WEIGHT = #{resultNetWeight},
- tt.RESULT_TARE_PLACE_ID = #{resultTarePlaceId},
- tt.RESULT_TARE_WEIGHT_TIME = TO_DATE( #{resultWeightTime}, 'yyyy-mm-dd hh24:mi:ss' )
- </update>
- <update id="updateTruckWeightResultGross" parameterType="java.util.Map">
- UPDATE (
- SELECT
- *
- FROM
- TMSTRUCK_WEIGHT_RESULT twr
- WHERE
- twr.RESULT_TOTAL_ID = (
- SELECT
- ttr.RESULT_TOTAL_ID
- FROM
- TMSTRUCK_TOTAL_RESULT ttr
- WHERE
- ttr.ORDER_ID = ( SELECT oo.ORDER_ID FROM OMSTRUCK_ORDER oo WHERE oo.ORDER_NUMBER = #{orderNumber} )
- )
- and
- twr.MATERIAL_ID = #{materialId}
- ) tt
- SET tt.RESULT_POUND_NO = #{resultPoundNo},
- tt.RESULT_GROSS_WEIGHT = #{resultWeight},
- tt.RESULT_NET_WEIGHT = #{resultNetWeight},
- tt.RESULT_GROSS_PLACE_ID = #{resultTarePlaceId},
- tt.RESULT_GROSS_WEIGHT_TIME = TO_DATE( #{resultWeightTime}, 'yyyy-mm-dd hh24:mi:ss' )
- </update>
- <update id="linkageDeleteTransportOrder" parameterType="string">
- update OMSTRUCK_ORDER OO
- set OO.ORDER_STATUS = 8,
- OO.INSERT_UPDATE_REMARK = '计量联动删除'
- where OO.ORDER_NUMBER = #{orderNumber}
- </update>
- <!-- 通过运输订单号 查询实绩Id、总实绩ID -->
- <select id="selectTotalIdByOrderNo" parameterType="java.util.Map" resultType="java.util.Map">
- select *
- from (
- select OO.ORDER_ID "orderId",
- OO.ORDER_TYPE "orderTypee",
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- TTR.RESULT_TOTAL_ID "resultTotalId",
- RC.CAPACITY_NUMBER "capacityNumber",
- TWR.TARE_SEGMENT_SQE "tareSegmentSqe",
- TWR.GROSS_SEGMENT_SQE "grossSegmentSqe"
- from OMSTRUCK_ORDER OO
- left join TMSTRUCK_TOTAL_RESULT TTR
- on OO.ORDER_ID = TTR.ORDER_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- where OO.ORDER_NUMBER = #{orderNumber}
- <if test="materialId != null">
- and TWR.MATERIAL_ID = #{materialId}
- </if>
- )
- where rownum = 1
- </select>
- <!-- 通过汽车衡编号查询对应的汽车衡ID -->
- <select id="selectTruckCalculateId" parameterType="java.lang.String" resultType="int">
- select TRUCK_CALCULATE_ID
- from RMS_TRUCK_CALCULATE
- where TRUCK_CALCULATE_NUMBER = #{truckCalculateNumber}
- </select>
- <!-- 通过运输订单号查询计量实绩Id 条件 路段顺序号 和 净重 -->
- <select id="selectWeightIdByOrderId" parameterType="map" resultType="java.util.Map">
- select *
- from (
- select OO.ORDER_ID "orderId",
- OO.ORDER_TYPE "orderTypee",
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- TTR.RESULT_TOTAL_ID "resultTotalId",
- TWR.TARE_SEGMENT_SQE "tareSegmentSqe",
- TWR.GROSS_SEGMENT_SQE "grossSegmentSqe"
- from TMSTRUCK_WEIGHT_RESULT TWR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_ID = TTR.ORDER_ID
- where OO.ORDER_NUMBER = #{orderNumber}
- and TWR.RESULT_NET_WEIGHT is null
- order by "tareSegmentSqe"
- )
- where rownum = 1
- </select>
- <!-- 通过订单Id查询还没有净重的计量实绩 -->
- <select id="selectNoNetWeightResult" parameterType="string" resultType="int">
- select COUNT(TWR.WEIGHT_TASK_RESULT_ID)
- from TMSTRUCK_WEIGHT_RESULT TWR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_ID = TTR.ORDER_ID
- where OO.ORDER_NUMBER = #{orderNumber}
- and TWR.RESULT_NET_WEIGHT is null
- </select>
- <!-- 查询采购订单信息给金蝶 -->
- <select id="getPurOrderMesToKD" parameterType="string" resultType="java.util.Map">
- select APO.PURCHASE_ORDER_NO "No",
- APO.EAS_ENTRY_ID "easEntryId",
- RC.CAPACITY_NUMBER "capacityNumber",
- OO.ORDER_ID "orderId"
- from OMSTRUCK_ORDER OO
- left join AMS_PURCHASE_ORDER APO
- on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
- left join RMS_CAPACITY RC
- on RC.CAPACITY_ID = OO.CAPACITY_ID
- where OO.ORDER_NUMBER = #{orderNumber}
- </select>
- <select id="getMaterialNumber" parameterType="java.math.BigDecimal" resultType="java.util.Map">
- select OOM.MATERIAL_ID "materialId"
- from TMSTRUCK_TOTAL_RESULT TTR
- LEFT JOIN OMSTRUCK_ORDER OO
- ON OO.ORDER_ID = TTR.ORDER_ID
- LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM
- ON OOM.ORDER_ID = OO.ORDER_ID
- WHERE TTR.RESULT_TOTAL_ID =#{resultTotalId}
- </select>
- <!-- 查询采购内转总厂到老区的订单信息 -->
- <select id="get20PurOrderMesToKD" parameterType="string" resultType="java.util.Map">
- SELECT
- APO.PURCHASE_ORDER_NO "No",
- APO.EAS_ENTRY_ID "easEntryId",
- RC.CAPACITY_NUMBER "capacityNumber",
- OO.ORDER_ID "orderId"
- FROM
- OMSTRUCK_ORDER OO
- LEFT JOIN AMSTRUCK_INWARD_PLAN AIP ON AIP.PLAN_ID = OO.ORDER_PLAN_ID
- LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP ON ARP.PLAN_ID = AIP.PLAN_ID
- LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
- LEFT JOIN AMS_PURCHASE_ORDER APO ON APO.PURCHASE_ORDER_ID = AIR.PURCHASE_ORDER_ID
- LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
- WHERE
- OO.ORDER_NUMBER = #{orderNumber}
- </select>
- <select id="selectResultIdByOrderNoAndMaterialId" parameterType="map" resultType="java.util.Map">
- select TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- TWR.RESULT_TARE_WEIGHT "resultTareWeight",
- TWR.TARE_SEGMENT_SQE "tareSegmentSqe",
- TWR.RESULT_NET_WEIGHT "netWeight"
- from OMSTRUCK_ORDER OO
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.ORDER_ID = OO.ORDER_ID
- left join TMSTRUCK_WEIGHT_RESULT TWR
- on TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
- where
- OO.ORDER_NUMBER = #{orderNumber}
- and TWR.MATERIAL_ID = #{materialId}
- </select>
- <select id="getNoNetWeightResultId" parameterType="java.math.BigDecimal" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- TWR.TARE_SEGMENT_SQE "tareSegmentSqe"
- FROM TMSTRUCK_WEIGHT_RESULT TWR
- WHERE TWR.RESULT_TOTAL_ID = #{resultTotalId}
- AND TWR.RESULT_NET_WEIGHT IS NULL
- ORDER BY TWR.TARE_SEGMENT_SQE
- )
- WHERE ROWNUM <= 2
- </select>
- <select id="getNoNetWeightResultForSaleReturn" parameterType="java.math.BigDecimal" resultType="java.util.Map">
- SELECT *
- FROM (
- SELECT TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- TWR.GROSS_SEGMENT_SQE "tareSegmentSqe"
- FROM TMSTRUCK_WEIGHT_RESULT TWR
- WHERE TWR.RESULT_TOTAL_ID = #{resultTotalId}
- AND TWR.RESULT_NET_WEIGHT IS NULL
- ORDER BY TWR.GROSS_SEGMENT_SQE
- )
- WHERE ROWNUM <= 2
- </select>
- <select id="getAPOMes" parameterType="string" resultType="map">
- select APO.PURCHASE_ORDER_ID "purchaseOrderId",
- DB.MATERIAL_ID "materialId"
- from AMS_PURCHASE_ORDER APO
- left join DIL_BATCH DB on APO.BATCH_ID = DB.BATCH_ID
- where APO.PURCHASE_ORDER_NO = #{arrivalBillNo}
- </select>
- <select id="getOrderMes" resultType="java.util.Map">
- select *
- from (
- select OO.ORDER_ID "orderId",
- OO.ORDER_TYPE "orderTypee",
- OO.ORDER_NUMBER "orderNumber",
- TWR.WEIGHT_TASK_RESULT_ID "weightTaskResultId",
- TTR.RESULT_TOTAL_ID "resultTotalId",
- TWR.TARE_SEGMENT_SQE "tareSegmentSqe",
- TWR.GROSS_SEGMENT_SQE "grossSegmentSqe"
- from TMSTRUCK_WEIGHT_RESULT TWR
- left join TMSTRUCK_TOTAL_RESULT TTR
- on TTR.RESULT_TOTAL_ID = TWR.RESULT_TOTAL_ID
- left join OMSTRUCK_ORDER OO
- on OO.ORDER_ID = TTR.ORDER_ID
- left join RMS_CAPACITY RC
- ON RC.CAPACITY_ID = OO.CAPACITY_ID
- where RC.CAPACITY_NUMBER = #{carNo}
- and TWR.RESULT_NET_WEIGHT is null
- and oo.order_status = 5
- order by "tareSegmentSqe"
- )
- where rownum = 1
- </select>
- <select id="getHaveNetWeightByMaterial" resultType="java.lang.Integer">
- select count(TWR.WEIGHT_TASK_RESULT_ID) from TMSTRUCK_WEIGHT_RESULT TWR
- where twr.RESULT_TOTAL_ID = #{resultTotalId}
- and twr.material_id = #{materialId}
- and TWR.RESULT_NET_WEIGHT is not null
- </select>
- <select id="getMaterialId" resultType="java.math.BigDecimal" parameterType="java.util.Map">
- select RM.MATERIAL_ID from RMS_MATERIAL RM
- WHERE RM.MATERIAL_NAME = #{good}
- AND RM.MATERIAL_SPECIFICATION || '(' || RM.MATERIAL_MODEL || ')' = #{goodspa}
- </select>
- <select id="getSaleOrderMaterialNum" resultType="java.util.Map" parameterType="map">
- select OOM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
- ASM.MATERIAL_WEIGHT "materialWeight",
- ASM.SALE_MATERIAL_ID "saleMaterialId",
- ASM.MATERIAL_NUMBER "materialNumber"
- from AMS_SALE_ORDER_MATERIAL ASOM
- left join OMSTRUCK_ORDER OO on OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
- left join AMS_SALE_TRUCKNO_MATERIAL ASTM on ASOM.SALE_ORDER_MATERIAL_ID = ASTM.SALE_ORDER_MATERIAL_ID
- left join AMS_SALE_MATERIAL ASM on ASTM.MATERIAL_ID = ASM.SALE_MATERIAL_ID
- left join OMSTRUCK_ORDER_MATERIAL OOM on OO.ORDER_ID = OOM.ORDER_ID
- where ASM.MATERIAL_ID = #{materialId}
- AND OO.ORDER_ID = #{orderId}
- AND OOM.MATERIAL_ID = #{materialId}
- </select>
- <update id="updateOmsTruckPlanId" parameterType="map">
- update OMSTRUCK_ORDER
- set ORDER_PLAN_ID = #{purchaseOrderId}
- where ORDER_NUMBER = #{orderNumber}
- </update>
- <update id="updateOmsTruckMaterialId" parameterType="map">
- update OMSTRUCK_ORDER_MATERIAL
- set MATERIAL_ID = #{materialId}
- where ORDER_ID = (select ORDER_ID from OMSTRUCK_ORDER where ORDER_NUMBER = #{orderNumber})
- </update>
- <update id="updatePurchaseInwordAPOId" parameterType="map">
- update AMSTRUCK_INWARD_REQUIREMENT AIR
- set AIR.PURCHASE_ORDER_ID = #{purchaseOrderId}
- where AIR.REQUIREMENT_ID = (
- select air.REQUIREMENT_ID
- from OMSTRUCK_ORDER OO
- left join AMSTRUCK_INWARD_PLAN AIP on aip.plan_id = oo.order_plan_id
- LEFT JOIN amstruck_requirement_plan arp ON arp.plan_id = aip.plan_id
- LEFT JOIN amstruck_inward_requirement air ON air.requirement_id = arp.requirement_id
- where OO.ORDER_NUMBER = #{orderNumber}
- )
- </update>
- <update id="updateOrderMaterial" parameterType="map">
- update OMSTRUCK_ORDER_MATERIAL OOM
- SET OOM.ORDER_MATERIAL_NUMBER = #{goodNum}
- <if test="newWeight != null">
- , OOM.ORDER_MATERIAL_WEIGHT = #{newWeight}
- </if>
- WHERE OOM.ORDER_ID = #{orderId}
- and OOM.MATERIAL_ID = #{materialId}
- </update>
- <update id="updateSaleMaterialId">
- update AMS_SALE_MATERIAL
- set MATERIAL_NUMBER = #{materialNum}
- <if test="newWeight != null">
- , MATERIAL_WEIGHT = #{newWeight}
- </if>
- where SALE_MATERIAL_ID = #{saleMaterialId}
- </update>
- </mapper>
|