//可直接定义数组为字符串类型
private string citys
/**
* 定义查询的参数
* @param page
* @param PageQuery
* @return
*/
Page<CustomerModel> getPageCustomerModel(Page page, @Param("pageQuery") PageQuery PageQuery);
<if test="pageQuery.citys != null and pageQuery.citys != ">
<bind name="cts" value="pageQuery.citys.split(;)"/>
and city in
<foreach collection="cts" open="(" close=")" item="ct" separator=",">
#{
ct}
</foreach>
</if>
//多条件查询
<if test="pageQuery.citys!= null and pageQuery.citys!= ">
<choose>
<when test="pageQuery.citys.indexOf(ancen) >= 0">
and citys in
<bind name="citys" value="pageQuery.citys.split(,)"/>
<foreach collection="citys" open="(" close=")" item="city" separator=",">
#{
city}
</foreach>
</when>
<otherwise>
and citys in
<bind name="citys" value="pageQuery.citys .split(,)"/>
<foreach collection="citys" open="(" close=")" item="city" separator=",">
CAST((#{
city}), Int256)
</foreach>
</otherwise>
</choose>
</if>
//多条件参数
<select id="getPageBranchReport" resultType="com.pasig.bi.report.vo.resp.BranchReportPageResp">
select a.id,a.name,b.value from a
left join b
on a.id=b.id
<include refid="commonSql">
<property name="num" value="11"/>
<property name="tablename" value="t_stu1"/>
<property name="columnname" value="col1"/>
</include>
<include refid="commonSql">
<property name="num" value="12"/>
<property name="tablename" value="t_stu2"/>
<property name="columnname" value="col2"/>
</include>
<sql id="branchCommonSql">
LEFT JOIN
(select
col1 as ${
columnname}
where num=${
num}
from ${
tablename})
</sql>