|
@@ -0,0 +1,163 @@
|
|
|
+<?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">
|
|
|
+<!-- namespace必须指向DAO接口 -->
|
|
|
+<mapper namespace="com.jpsoft.prices.modules.base.dao.StandardDAO">
|
|
|
+ <resultMap id="StandardMap" type="com.jpsoft.prices.modules.base.entity.Standard">
|
|
|
+ <id property="id" column="id_" />
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
+ <result property="destinationId" column="destination_id" />
|
|
|
+ <result property="logicId" column="logic_id" />
|
|
|
+ <result property="name" column="name_" />
|
|
|
+ <result property="firstWeight" column="first_weight" />
|
|
|
+ <result property="unitPrice" column="unit_price" />
|
|
|
+ <result property="unitName" column="unit_name" />
|
|
|
+ <result property="startingPrice" column="starting_price" />
|
|
|
+ <result property="floatingPrice" column="floating_price" />
|
|
|
+ <result property="deliveryFee" column="delivery_fee" />
|
|
|
+ <result property="storageFee" column="storage_fee" />
|
|
|
+ <result property="insureFee" column="insure_fee" />
|
|
|
+ <result property="taxFee" column="tax_fee" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+
|
|
|
+ <result property="companyName" column="company_name" />
|
|
|
+ <result property="destinationName" column="destination_name" />
|
|
|
+ <result property="logicName" column="logic_name" />
|
|
|
+ </resultMap>
|
|
|
+ <insert id="insert" parameterType="com.jpsoft.prices.modules.base.entity.Standard">
|
|
|
+ <!--
|
|
|
+ <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
+ select sys_guid() from dual
|
|
|
+ </selectKey>
|
|
|
+ -->
|
|
|
+ <![CDATA[
|
|
|
+ insert into base_standard
|
|
|
+ (id_,company_id,destination_id,logic_id,name_,first_weight,unit_price,unit_name,starting_price,floating_price,delivery_fee,storage_fee,insure_fee,tax_fee,del_flag,create_time,create_by,update_time,update_by)
|
|
|
+ values
|
|
|
+ (
|
|
|
+#{id,jdbcType=VARCHAR}
|
|
|
+,#{companyId,jdbcType=VARCHAR}
|
|
|
+,#{destinationId,jdbcType=VARCHAR}
|
|
|
+,#{logicId,jdbcType=VARCHAR}
|
|
|
+,#{name,jdbcType=VARCHAR}
|
|
|
+,#{firstWeight,jdbcType= NUMERIC }
|
|
|
+,#{unitPrice,jdbcType= NUMERIC }
|
|
|
+,#{unitName,jdbcType=VARCHAR}
|
|
|
+,#{startingPrice,jdbcType= NUMERIC }
|
|
|
+,#{floatingPrice,jdbcType= NUMERIC }
|
|
|
+,#{deliveryFee,jdbcType= NUMERIC }
|
|
|
+,#{storageFee,jdbcType= NUMERIC }
|
|
|
+,#{insureFee,jdbcType= NUMERIC }
|
|
|
+,#{taxFee,jdbcType= NUMERIC }
|
|
|
+,#{delFlag,jdbcType= NUMERIC }
|
|
|
+,#{createTime,jdbcType= TIMESTAMP }
|
|
|
+,#{createBy,jdbcType=VARCHAR}
|
|
|
+,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
+,#{updateBy,jdbcType=VARCHAR}
|
|
|
+ )
|
|
|
+ ]]>
|
|
|
+ </insert>
|
|
|
+ <delete id="delete" parameterType="string">
|
|
|
+ delete from base_standard where id_=#{id,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <update id="update" parameterType="com.jpsoft.prices.modules.base.entity.Standard">
|
|
|
+ update base_standard
|
|
|
+ <set>
|
|
|
+ <if test="companyId!=null">
|
|
|
+ company_id=#{companyId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="destinationId!=null">
|
|
|
+ destination_id=#{destinationId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="logicId!=null">
|
|
|
+ logic_id=#{logicId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="name!=null">
|
|
|
+ name_=#{name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="firstWeight!=null">
|
|
|
+ first_weight=#{firstWeight,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="unitPrice!=null">
|
|
|
+ unit_price=#{unitPrice,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="unitName!=null">
|
|
|
+ unit_name=#{unitName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="startingPrice!=null">
|
|
|
+ starting_price=#{startingPrice,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="floatingPrice!=null">
|
|
|
+ floating_price=#{floatingPrice,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="deliveryFee!=null">
|
|
|
+ delivery_fee=#{deliveryFee,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="storageFee!=null">
|
|
|
+ storage_fee=#{storageFee,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="insureFee!=null">
|
|
|
+ insure_fee=#{insureFee,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="taxFee!=null">
|
|
|
+ tax_fee=#{taxFee,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!=null">
|
|
|
+ del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
+ </if>
|
|
|
+ <if test="createTime!=null">
|
|
|
+ create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ <if test="createBy!=null">
|
|
|
+ create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime!=null">
|
|
|
+ update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
+ </if>
|
|
|
+ <if test="updateBy!=null">
|
|
|
+ update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_=#{id}
|
|
|
+ </update>
|
|
|
+ <select id="get" parameterType="string" resultMap="StandardMap">
|
|
|
+ select
|
|
|
+id_,company_id,destination_id,logic_id,name_,first_weight,unit_price,unit_name,starting_price,floating_price,delivery_fee,storage_fee,insure_fee,tax_fee,del_flag,create_time,create_by,update_time,update_by from base_standard where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="exist" parameterType="string" resultType="int">
|
|
|
+ select count(*) from base_standard where id_=#{0}
|
|
|
+ </select>
|
|
|
+ <select id="list" resultMap="StandardMap">
|
|
|
+ select * from base_standard
|
|
|
+ </select>
|
|
|
+ <select id="search" parameterType="hashmap" resultMap="StandardMap">
|
|
|
+ <![CDATA[
|
|
|
+ SELECT a.*,b.name_ AS company_name,c.name_ AS destination_name,d.name_ AS logic_name FROM base_standard a
|
|
|
+ LEFT JOIN base_company b ON a.company_id = b.id_
|
|
|
+ LEFT JOIN base_destination c ON a.destination_id = c.id_
|
|
|
+ LEFT JOIN sys_data_dictionary d ON a.logic_id = d.id_
|
|
|
+ ]]>
|
|
|
+ <where>
|
|
|
+ a.del_flag = 0
|
|
|
+ <if test="searchParams.name != null">
|
|
|
+ and a.name_ like #{searchParams.name}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.companyId != null">
|
|
|
+ and a.company_id = #{searchParams.companyId}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.destinationId != null">
|
|
|
+ and a.destination_id = #{searchParams.destinationId}
|
|
|
+ </if>
|
|
|
+ <if test="searchParams.logicId != null">
|
|
|
+ and a.logic_id = #{searchParams.logicId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+</mapper>
|