具体文档代码如下:
<?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.hzcominfo.voucher.Otarea">
<cache-ref namespace="com.hzcominfo.dataggr.cloud" />
<select id="selectOtarea" parameterType="String"
resultType="com.hzcominfo.voucher.mapper.Otarea">
SELECT * FROM OTAREA where id = #{id}
</select>
<select id="selectOtareaByCriteria" parameterType="net.butfly.albacore.dbo.criteria.Criteria"
resultType="String">
SELECT id FROM OTAREA <include refid="where" />
</select>
<select id="countOtareaByCriteria" parameterType="net.butfly.albacore.dbo.criteria.Criteria"
resultType="long">
SELECT count(id) FROM OTAREA <include refid="where" />
</select>
<select id="selectOtareas" parameterType="com.hzcominfo.voucher.mapper.zsh.Otarea"
resultType="com.hzcominfo.voucher.mapper.zsh.Otarea">
SELECT * FROM OTAREA <include refid="where" />
</select>
<sql id="where">
<where>
1=1
<if test="uuid != null">AND UUID=#{uuid}</if>
<if test="name != null">AND NAME=#{name}</if>
<if test="code != null">AND CODE=#{code}</if>
<if test="branchs != null and branchs.length>0">
AND BRANCH in
<foreach collection="branchs" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</sql>
</mapper>