最近在工做中常常遇到一個狀況:經過mybatis的
<insert id="insertSettlement" parameterType="com.entity.system.settlement.Settlement"> insert into B2B_SETTLEMENT ( ID, Deptid, Statement_Date, Billamount, Ticketidlist, Billinterest, Totalbill, Operatetype, Billstatus, Creatorid, Create_Date, Auditstatus, Isonline ) values ( #{id}, #{deptId}, #{statementDate}, #{billAmount}, #{ticketIdList}, #{billInterest}, #{totalbill}, #{operateType}, #{billStatus}, #{creatorId}, sysdate, #{auditStatus}, #{isOnline} ) </insert>
<insert id="insert" parameterType="com.entity.tcwechat.otms.BaseBinding"> INSERT INTO BASE_BINDING <trim prefix="(" suffix=")" suffixOverrides=","> <if test="hc != null"> HC, </if> <if test="cfcity != null"> CFCITY, </if> <if test="ddcity != null"> DDCITY, </if> <if test="hbh != null"> HBH, </if> <if test="cw != null"> CW, </if> <if test="cfdate != null"> CFDATE, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="hc != null"> #{hc}, </if> <if test="cfcity != null"> #{cfcity}, </if> <if test="ddcity != null"> #{ddcity}, </if> <if test="hbh != null"> #{hbh}, </if> <if test="cw != null"> #{cw}, </if> <if test="cfdate != null"> #{cfdate}, </if> </trim> </insert>
工做記錄,下次遇到能夠用!ide