spring+springMVC+mybatis
客户服务一体化(oracle)
Mapper:
参数:class
字段类型: class.name=name1,name2,name3
查询结果: class.name1;name2;name3
Dao: getRoleOrganCodes(OrganIzation organzation)
select id,
to_char(create_date,'yyyy-mm-dd hh24:mi:ss') createDate,
case process_status when '1' then '处理中'
when '2' then '待处理'
when '3' then '已完成' end (as) processStatus
from tableName
<where>
<if test="createDate != null and createDate !=''">
and create_date=#{createDate}
</if>
<if test="organizationCode != null and organizationCode !=''">
<if test="organizationCode !='0101'.toString() >"
and organization_code in
<foreach item ="item" index="index" collection="organizationCode.split(',') open="(" separator="," colse=")">
#{item}
</foreach>
</if>
</if>
</where>
order by create_date
Mapper:
参数:List< class >
字段类型: class.name=name1,name2,name3
查询结果: 每个class.name1;name2;name3及他们的所有子name
Dao: getRoleSubOrganCodes(List< OrganIzation > organzation)
<seLect id="getRoleSubOrganCodes" parameterType= "java.util.List" resultType="Organization">
seLect u.organ_code as organizationCode,
case u.organ._name when "街头原宿店" then "总公司" eLse u.organ_ name end as organizationName from organTable u
start with u.organ_code in
<foreach item= " OrganizationCode" index= " index" collection="list" open="(" separator=", " close=") ">
<foreach item= "item" index= "index" collection=" OrganizationCode.organizationCode.split(', ')">
#{item}
</foreach>
</foreach>
connect by prior u.organ_code = u.upLevenOrgan
</seLect>
其他模糊查询 可见: https://blog.csdn.net/better_12_14/article/details/81104446