📄 contactinfo.xml
字号:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap>
<typeAlias alias="ContactInfo"
type="cn.com.tarena.ecport.pojo.ContactInfo" />
<resultMap id="contactInfo_base"
class="cn.com.tarena.ecport.pojo.ContactInfo">
<result property="contactid" column="contactid" />
<result property="street1" column="street1" />
<result property="street2" column="street2" />
<result property="city" column="city" />
<result property="zip" column="zip" />
<result property="email" column="email" />
<result property="homephone" column="homephone" />
<result property="cellphone" column="cellphone" />
<result property="officephone" column="officephone" />
<result property="userid" column="userid" />
<result property="countryid" column="countryid" />
<result property="provinceid" column="provinceid" />
</resultMap>
<resultMap id="contactInfo_result" class="ContactInfo"
extends="contactInfo_base">
<result property="users" column="userid"
select="User.findUserById" />
<result property="province" column="provinceid"
select="Province.findProvinceById" />
<result property="country" column="countryid"
select="Country.findCountryById" />
</resultMap>
<select id="findAllContactInfo" resultMap="contactInfo_base">
select * from ContactInfo
</select>
<insert id="saveContactInfo" parameterClass="ContactInfo">
<selectKey resultClass="Long" keyProperty="contactid">
select studentPKSequence.nextVal from dual
</selectKey>
insert into ContactInfo (contactid,userid,street1,street2,city,provinceid,countryid,zip,email,homephone,cellphone,officephone)
values
(#contactid#,#userid#,#street1#,#street2#,#city#,#provinceid#,#countryid#,#zip#,#email#,#homephone#,#cellphone#,#officephone#)
</insert>
<select id="findContactInfoById" parameterClass="Long"
resultMap="contactInfo_base">
select * from ContactInfo where contactid=#contactid#
</select>
<update id="saveorUpdateContactInfo" parameterClass="ContactInfo">
update
ContactInfo
set
userid=#userid# ,
street1=#street1#,
street2=#street2# ,
city=#city# ,
provinceid=#provinceid#,
countryid=#countryid# ,
zip=#zip#,
email=#email#,
homephone=#homephone# ,
cellphone=#cellphone#,
officephone=#officephone#
where contactid=#contactid#
</update>
<delete id="deleteContactInfo" parameterClass="ContactInfo">
delete from ContactInfo where contactid=#contactid#
</delete>
</sqlMap>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -