首页 > 代码库 > 对象mapper

对象mapper

<?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.gxa.bj.dao.imp.VoucherMapper">
<insert id="addItem" parameterType="com.gxa.bj.model.Voucher">
insert into voucher (belum,indata,page,jaccount,daccount,debit,credit,digest,manager,staff,state)
values (vouchernext.nextval,#{indata},#{page},#{jaccount},#{daccount},#{debit},#{credit},#{digest},#{manager},#{staff},#{state})
</insert>
<update id="updateItem" parameterType="com.gxa.bj.model.Voucher">
update voucher set manager=#{manager},state=#{state} where belum=#{belum}
</update>
<select id="getList" parameterType="com.gxa.bj.model.Voucher" resultType="com.gxa.bj.model.Voucher">
Select * From voucher
<where>
1=1
<if test="belum>0">
and belum=#{belum}
</if>
<if test="state">
and state like #{state}
</if>
<if test="jaccount">
and jaccount like %#{jaccount}%
</if>
<if test="daccount">
and daccount like %#{daccount}%
</if>
</where>
</select>
</mapper>

对象mapper