|
|
<?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.gaotao.modules.app.dao.SupplierMapper"> <resultMap id="BaseResultMap" type="com.gaotao.modules.app.entity.Supplier"> <!--@mbg.generated--> <!--@Table Supplier--> <id column="SupplierID" jdbcType="VARCHAR" property="supplierid" /> <id column="Site" jdbcType="VARCHAR" property="site" /> <result column="SupplierName" jdbcType="VARCHAR" property="suppliername" /> <result column="TaxCode" jdbcType="VARCHAR" property="taxcode" /> <result column="FaxNo" jdbcType="VARCHAR" property="faxno" /> <result column="PhoneNo" jdbcType="VARCHAR" property="phoneno" /> <result column="Contact" jdbcType="VARCHAR" property="contact" /> <result column="Address" jdbcType="VARCHAR" property="address" /> <result column="PaymentTerm" jdbcType="VARCHAR" property="paymentterm" /> <result column="DeliveryTerm" jdbcType="VARCHAR" property="deliveryterm" /> <result column="Buyer" jdbcType="VARCHAR" property="buyer" /> <result column="Currency" jdbcType="VARCHAR" property="currency" /> <result column="SupplierGroup" jdbcType="VARCHAR" property="suppliergroup" /> <result column="ABC" jdbcType="CHAR" property="abc" /> <result column="Active" jdbcType="CHAR" property="active" /> <result column="CreateDate" jdbcType="TIMESTAMP" property="createdate" /> <result column="BankName" jdbcType="VARCHAR" property="bankname" /> <result column="BankAccount" jdbcType="VARCHAR" property="bankaccount" /> <result column="TaxNo" jdbcType="VARCHAR" property="taxno" /> <result column="Email" jdbcType="VARCHAR" property="email" /> <result column="Memo" jdbcType="VARCHAR" property="memo" /> </resultMap> <sql id="Base_Column_List"> <!--@mbg.generated--> SupplierID, Site, SupplierName, TaxCode, FaxNo, PhoneNo, Contact, Address, PaymentTerm, DeliveryTerm, Buyer, Currency, SupplierGroup, ABC, Active, CreateDate, BankName, BankAccount, TaxNo, Email, Memo </sql> <select id="getSupplierList" resultMap="BaseResultMap"> <!--@mbg.generated--> select A.SupplierID,A.Site,A.SupplierName,A.TaxCode,A.FaxNo,A.PhoneNo,A.Contact,A.Address,A.PaymentTerm,A.DeliveryTerm,A.Buyer,A.Currency,A.SupplierGroup,A.ABC,A.Active,A.CreateDate,A.BankName,A.BankAccount,A.TaxNo,A.Email,A.Memo from Supplier A <where> <if test="site != null and site != ''"> and A.Site=#{site,jdbcType=VARCHAR} </if> <if test="supplierid != null and supplierid != ''"> and A.SupplierID=#{supplierid,jdbcType=VARCHAR} </if> <if test="active != null and active != ''"> and A.Active = #{active,jdbcType=VARCHAR} </if> </where> </select> <insert id="insertSelective"> <!--@mbg.generated--> INSERT INTO Supplier <trim prefix="(" suffix=")" suffixOverrides=","> <if test="supplierid!=null">SupplierID,</if> <if test="site!=null">Site,</if> <if test="suppliername!=null">SupplierName,</if> <if test="taxcode!=null">TaxCode,</if> <if test="faxno!=null">FaxNo,</if> <if test="phoneno!=null">PhoneNo,</if> <if test="contact!=null">Contact,</if> <if test="address!=null">Address,</if> <if test="paymentterm!=null">PaymentTerm,</if> <if test="deliveryterm!=null">DeliveryTerm,</if> <if test="buyer!=null">Buyer,</if> <if test="currency!=null">Currency,</if> <if test="suppliergroup!=null">SupplierGroup,</if> <if test="abc!=null">ABC,</if> <if test="active!=null">Active,</if> <if test="createdate!=null">CreateDate,</if> <if test="bankname!=null">BankName,</if> <if test="bankaccount!=null">BankAccount,</if> <if test="taxno!=null">TaxNo,</if> <if test="email!=null">Email,</if> <if test="memo!=null">Memo</if> </trim> VALUES <trim prefix="(" suffix=")" suffixOverrides=","> <if test="supplierid!=null">#{supplierid,jdbcType=VARCHAR},</if> <if test="site!=null">#{site,jdbcType=VARCHAR},</if> <if test="suppliername!=null">#{suppliername,jdbcType=VARCHAR},</if> <if test="taxcode!=null">#{taxcode,jdbcType=VARCHAR},</if> <if test="faxno!=null">#{faxno,jdbcType=VARCHAR},</if> <if test="phoneno!=null">#{phoneno,jdbcType=VARCHAR},</if> <if test="contact!=null">#{contact,jdbcType=VARCHAR},</if> <if test="address!=null">#{address,jdbcType=VARCHAR},</if> <if test="paymentterm!=null">#{paymentterm,jdbcType=VARCHAR},</if> <if test="deliveryterm!=null">#{deliveryterm,jdbcType=VARCHAR},</if> <if test="buyer!=null">#{buyer,jdbcType=VARCHAR},</if> <if test="currency!=null">#{currency,jdbcType=VARCHAR},</if> <if test="suppliergroup!=null">#{suppliergroup,jdbcType=VARCHAR},</if> <if test="abc!=null">#{abc,jdbcType=CHAR},</if> <if test="active!=null">#{active,jdbcType=CHAR},</if> <if test="createdate!=null">#{createdate,jdbcType=TIMESTAMP},</if> <if test="bankname!=null">#{bankname,jdbcType=VARCHAR},</if> <if test="bankaccount!=null">#{bankaccount,jdbcType=VARCHAR},</if> <if test="taxno!=null">#{taxno,jdbcType=VARCHAR},</if> <if test="email!=null">#{email,jdbcType=VARCHAR},</if> <if test="memo!=null">#{memo,jdbcType=VARCHAR}</if> </trim> </insert> <delete id="deleteSupplier"> <!--@mbg.generated--> delete from Supplier <where> <if test="site != null"> and Site=#{site,jdbcType=VARCHAR} </if> <if test="supplierid != null"> and SupplierID=#{supplierid,jdbcType=VARCHAR} </if> </where> </delete> <update id="updateSupplier"> <!--@mbg.generated--> update Supplier <set> <if test="suppliername != null"> SupplierName = #{suppliername,jdbcType=VARCHAR}, </if> <if test="taxcode != null"> TaxCode = #{taxcode,jdbcType=VARCHAR}, </if> <if test="faxno != null"> FaxNo = #{faxno,jdbcType=VARCHAR}, </if> <if test="phoneno != null"> PhoneNo = #{phoneno,jdbcType=VARCHAR}, </if> <if test="contact != null"> Contact = #{contact,jdbcType=VARCHAR}, </if> <if test="address != null"> Address = #{address,jdbcType=VARCHAR}, </if> <if test="paymentterm != null"> PaymentTerm = #{paymentterm,jdbcType=VARCHAR}, </if> <if test="deliveryterm != null"> DeliveryTerm = #{deliveryterm,jdbcType=VARCHAR}, </if> <if test="buyer != null"> Buyer = #{buyer,jdbcType=VARCHAR}, </if> <if test="currency != null"> Currency = #{currency,jdbcType=VARCHAR}, </if> <if test="suppliergroup != null"> SupplierGroup = #{suppliergroup,jdbcType=VARCHAR}, </if> <if test="abc != null"> ABC = #{abc,jdbcType=CHAR}, </if> <if test="active != null"> Active = #{active,jdbcType=CHAR}, </if> <if test="createdate != null"> CreateDate = #{createdate,jdbcType=TIMESTAMP}, </if> <if test="bankname != null"> BankName = #{bankname,jdbcType=VARCHAR}, </if> <if test="bankaccount != null"> BankAccount = #{bankaccount,jdbcType=VARCHAR}, </if> <if test="taxno != null"> TaxNo = #{taxno,jdbcType=VARCHAR}, </if> <if test="email != null"> Email = #{email,jdbcType=VARCHAR}, </if> <if test="memo != null"> Memo = #{memo,jdbcType=VARCHAR}, </if> </set> <where> <if test="site != null"> and Site=#{site,jdbcType=VARCHAR} </if> <if test="supplierid != null"> and SupplierID=#{supplierid,jdbcType=VARCHAR} </if> </where> </update>
<select id="getViewSupplierList" resultMap="BaseResultMap"> select * from view_supplier </select> <select id="getSupplier" resultType="com.gaotao.modules.base.entity.SupplierData"> Select SupplierID,SupplierName,Active,Site from Supplier Where site = #{site} and SupplierID = #{supplierId} </select></mapper>
|