123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- <?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.RmsCargodepMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsCargodep">
- <id column="CARGO_CARRIER_ID" jdbcType="DECIMAL" property="cargoCarrierId" />
- <result column="CARGO_CARRIER_NAME" jdbcType="VARCHAR" property="cargoCarrierName" />
- <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
- <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
- <result column="UPDATE_NAME" jdbcType="VARCHAR" property="updateName" />
- <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="CARGO_CARRIER_TYPE" jdbcType="VARCHAR" property="cargoCarrierType" />
- <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
- <result column="DELETED_NAME" jdbcType="VARCHAR" property="deletedName" />
- </resultMap>
- <sql id="columns">
- CARGO_CARRIER_ID, CARGO_CARRIER_NAME, INSERT_USERNAME, INSERT_TIME, UPDATE_NAME,
- UPDATE_TIME, CARGO_CARRIER_TYPE, DELETED, DELETED_NAME
- </sql>
- <sql id="columns_alias">
- t.CARGO_CARRIER_ID, t.CARGO_CARRIER_NAME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_NAME,
- t.UPDATE_TIME, t.CARGO_CARRIER_TYPE, t.DELETED, t.DELETED_NAME
- </sql>
- <sql id="select">
- SELECT <include refid="columns" /> FROM RMS_CARGODEP
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias" /> FROM RMS_CARGODEP t
- </sql>
- <sql id="where">
- <where>
- <if test="cargoCarrierId != null">
- and CARGO_CARRIER_ID = #{cargoCarrierId}
- </if>
- <if test="cargoCarrierName != null and cargoCarrierName != ''">
- and CARGO_CARRIER_NAME = #{cargoCarrierName}
- </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="updateName != null and updateName != ''">
- and UPDATE_NAME = #{updateName}
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="cargoCarrierType != null and cargoCarrierType != ''">
- and CARGO_CARRIER_TYPE = #{cargoCarrierType}
- </if>
- <if test="deleted != null">
- and DELETED = #{deleted}
- </if>
- <if test="deletedName != null and deletedName != ''">
- and DELETED_NAME = #{deletedName}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="cargoCarrierId != null">
- and CARGO_CARRIER_ID = #{cargoCarrierId}
- </if>
- <if test="cargoCarrierName != null and cargoCarrierName != ''">
- and CARGO_CARRIER_NAME LIKE '%${cargoCarrierName}%'
- </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="updateName != null and updateName != ''">
- and UPDATE_NAME LIKE '%${updateName}%'
- </if>
- <if test="updateTime != null">
- and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
- </if>
- <if test="cargoCarrierType != null and cargoCarrierType != ''">
- and CARGO_CARRIER_TYPE LIKE '%${cargoCarrierType}%'
- </if>
- <if test="deleted != null">
- and DELETED = #{deleted}
- </if>
- <if test="deletedName != null and deletedName != ''">
- and DELETED_NAME LIKE '%${deletedName}%'
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
- delete from RMS_CARGODEP
- where CARGO_CARRIER_ID = #{cargoCarrierId,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from RMS_CARGODEP
- where 1!=1
- <if test="cargoCarrierName != null and cargoCarrierName != ''">
- or CARGO_CARRIER_NAME = #{cargoCarrierName}
- </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="updateName != null and updateName != ''">
- or UPDATE_NAME = #{updateName}
- </if>
- <if test="updateTime != null">
- or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
- </if>
- <if test="cargoCarrierType != null and cargoCarrierType != ''">
- or CARGO_CARRIER_TYPE = #{cargoCarrierType}
- </if>
- <if test="deleted != null">
- or DELETED = #{deleted}
- </if>
- <if test="deletedName != null and deletedName != ''">
- or DELETED_NAME = #{deletedName}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.dil.model.RmsCargodep">
- insert into RMS_CARGODEP (CARGO_CARRIER_ID, CARGO_CARRIER_NAME,
- INSERT_USERNAME, INSERT_TIME, UPDATE_NAME,
- UPDATE_TIME, CARGO_CARRIER_TYPE, DELETED,
- DELETED_NAME)
- values (#{cargoCarrierId,jdbcType=DECIMAL}, #{cargoCarrierName,jdbcType=VARCHAR},
- #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateName,jdbcType=VARCHAR},
- #{updateTime,jdbcType=TIMESTAMP}, #{cargoCarrierType,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
- #{deletedName,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsCargodep">
- insert into RMS_CARGODEP
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="cargoCarrierId != null">
- CARGO_CARRIER_ID,
- </if>
- <if test="cargoCarrierName != null">
- CARGO_CARRIER_NAME,
- </if>
- <if test="insertUsername != null">
- INSERT_USERNAME,
- </if>
- <if test="insertTime != null">
- INSERT_TIME,
- </if>
- <if test="updateName != null">
- UPDATE_NAME,
- </if>
- <if test="updateTime != null">
- UPDATE_TIME,
- </if>
- <if test="cargoCarrierType != null">
- CARGO_CARRIER_TYPE,
- </if>
- <if test="deleted != null">
- DELETED,
- </if>
- <if test="deletedName != null">
- DELETED_NAME,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="cargoCarrierId != null">
- #{cargoCarrierId,jdbcType=DECIMAL},
- </if>
- <if test="cargoCarrierName != null">
- #{cargoCarrierName,jdbcType=VARCHAR},
- </if>
- <if test="insertUsername != null">
- #{insertUsername,jdbcType=VARCHAR},
- </if>
- <if test="insertTime != null">
- #{insertTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateName != null">
- #{updateName,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="cargoCarrierType != null">
- #{cargoCarrierType,jdbcType=VARCHAR},
- </if>
- <if test="deleted != null">
- #{deleted,jdbcType=DECIMAL},
- </if>
- <if test="deletedName != null">
- #{deletedName,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsCargodep">
- update RMS_CARGODEP
- set CARGO_CARRIER_NAME = #{cargoCarrierName,jdbcType=VARCHAR},
- INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
- INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
- UPDATE_NAME = #{updateName,jdbcType=VARCHAR},
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- CARGO_CARRIER_TYPE = #{cargoCarrierType,jdbcType=VARCHAR},
- DELETED = #{deleted,jdbcType=DECIMAL},
- DELETED_NAME = #{deletedName,jdbcType=VARCHAR}
- where CARGO_CARRIER_ID = #{cargoCarrierId,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsCargodep">
- update RMS_CARGODEP
- <set>
- <if test="cargoCarrierName != null">
- CARGO_CARRIER_NAME = #{cargoCarrierName,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="updateName != null">
- UPDATE_NAME = #{updateName,jdbcType=VARCHAR},
- </if>
- <if test="updateTime != null">
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="cargoCarrierType != null">
- CARGO_CARRIER_TYPE = #{cargoCarrierType,jdbcType=VARCHAR},
- </if>
- <if test="deleted != null">
- DELETED = #{deleted,jdbcType=DECIMAL},
- </if>
- <if test="deletedName != null">
- DELETED_NAME = #{deletedName,jdbcType=VARCHAR},
- </if>
- </set>
- where CARGO_CARRIER_ID = #{cargoCarrierId,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
- <include refid="select" />
- where CARGO_CARRIER_ID = #{cargoCarrierId,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 RMS_CARGODEP
- (CARGO_CARRIER_ID,
- CARGO_CARRIER_NAME, INSERT_USERNAME,
- INSERT_TIME, UPDATE_NAME, UPDATE_TIME,
- CARGO_CARRIER_TYPE, DELETED, DELETED_NAME
- )
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.cargoCarrierId,jdbcType=DECIMAL},
- #{item.cargoCarrierName,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
- #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateName,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
- #{item.cargoCarrierType,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL}, #{item.deletedName,jdbcType=VARCHAR}
- from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update RMS_CARGODEP
- set
- CARGO_CARRIER_ID=
- <foreach close="end" collection="list" index="index" item="item" open="case CARGO_CARRIER_ID" separator=" ">
- when #{item.cargoCarrierId,jdbcType=DECIMAL} then #{item.cargoCarrierId,jdbcType=DECIMAL}
- </foreach>
- ,CARGO_CARRIER_NAME=
- <foreach close="end" collection="list" index="index" item="item" open="case CARGO_CARRIER_ID" separator=" ">
- when #{item.cargoCarrierId,jdbcType=DECIMAL} then #{item.cargoCarrierName,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_USERNAME=
- <foreach close="end" collection="list" index="index" item="item" open="case CARGO_CARRIER_ID" separator=" ">
- when #{item.cargoCarrierId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
- </foreach>
- ,INSERT_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case CARGO_CARRIER_ID" separator=" ">
- when #{item.cargoCarrierId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
- </foreach>
- ,UPDATE_NAME=
- <foreach close="end" collection="list" index="index" item="item" open="case CARGO_CARRIER_ID" separator=" ">
- when #{item.cargoCarrierId,jdbcType=DECIMAL} then #{item.updateName,jdbcType=VARCHAR}
- </foreach>
- ,UPDATE_TIME=
- <foreach close="end" collection="list" index="index" item="item" open="case CARGO_CARRIER_ID" separator=" ">
- when #{item.cargoCarrierId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
- </foreach>
- ,CARGO_CARRIER_TYPE=
- <foreach close="end" collection="list" index="index" item="item" open="case CARGO_CARRIER_ID" separator=" ">
- when #{item.cargoCarrierId,jdbcType=DECIMAL} then #{item.cargoCarrierType,jdbcType=VARCHAR}
- </foreach>
- ,DELETED=
- <foreach close="end" collection="list" index="index" item="item" open="case CARGO_CARRIER_ID" separator=" ">
- when #{item.cargoCarrierId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
- </foreach>
- ,DELETED_NAME=
- <foreach close="end" collection="list" index="index" item="item" open="case CARGO_CARRIER_ID" separator=" ">
- when #{item.cargoCarrierId,jdbcType=DECIMAL} then #{item.deletedName,jdbcType=VARCHAR}
- </foreach>
- where CARGO_CARRIER_ID in
- <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
- #{item.cargoCarrierId,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from RMS_CARGODEP
- where CARGO_CARRIER_ID in
- <foreach close=")" collection="list" item="id" open="(" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <!-- 根据货权转移送达单位查找是否存在-->
- <select id="searchNumberForCagoName" parameterType="java.util.Map" resultType="java.math.BigDecimal">
- select count(CARGO_CARRIER_ID)
- from RMS_CARGODEP rc
- where rc.CARGO_CARRIER_NAME = #{cargoName} and rc.CARGO_CARRIER_TYPE=#{cargoType}
- </select>
- <!-- 获取货权转移送达单位列表-->
- <select id="getCargoDepList" resultType="java.util.Map" parameterType="java.util.Map">
- select * from
- (select
- RC.CARGO_CARRIER_NAME "cargoCarrierName",
- RC.CARGO_CARRIER_ID "cargoCarrierId"
- from RMS_CARGODEP RC
- where RC.DELETED = 0
- <if test="con!=null">
- and instr(RC.CARGO_CARRIER_NAME, #{con}) > 0
- </if>
- )
- </select>
- <select id="getCargoDepById" resultType="java.util.Map" parameterType="java.util.Map">
- select RC.CARGO_CARRIER_NAME "cargoName",
- RC.CARGO_CARRIER_TYPE "cargoType"
- from RMS_CARGODEP RC
- WHERE CARGO_CARRIER_ID=#{id}
- </select>
- </mapper>
|