61,823
社区成员




<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace="Service.BO" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<alias>
<typeAlias alias="CardInfo" type="Service.BO.CardInfo, Service" />//找到实体
</alias>
<resultMaps>
<resultMap id="CardInfoResult" class="CardInfo"> //数据库和实体映射
<result property="CardId" column="CardId" />
<result property="CardPassword" column="CardPassword"/>
<result property="CardType" column="CardType" />
<result property="CardPrice" column="CardPrice" />
</resultMap>
</resultMaps>
<statements> //SQL语句
<select id="SelectCard" parameterClass="string" resultMap="CardInfoResult">
select CardId, CardPassword, CardType,CardPrice
from CardInfo
<dynamic prepend="WHERE">
<isParameterPresent>
CardId = #value#
</isParameterPresent>
</dynamic>
</select>
<select id="SelectAllCard" resultMap="CardInfoResult">
select CardId, CardPassword, CardType,CardPrice
from CardInfo
</select>
<select id="SelectCardCount" parameterClass="Hashtable" resultMap="CardInfoResult">
select CardId, CardPassword, CardType,CardPrice
from CardInfo
where CardId = #CardId# and CardPassword = #CardPassword#
</select>
<insert id="InsertCard" parameterClass="CardInfo" resultMap="CardInfoResult">
insert into CardInfo(CardId, CardPassword, CardType,CardPrice)
values (#CardId#, #CardPassword#, #CardType#,#CardPrice#)
</insert>
<update id="UpdateCard" parameterClass="CardInfo" resultMap="CardInfoResult">
update CardInfo set
CardType = #CardType#
where CardId = #CardId# and CardPassword = #CardPassword#
</update>
</statements>
</sqlMap>