<select id="Client_Search" resultMap="Client_AllColumns_search" parameterClass="Client">
SELECT
Client.*,
<!--要查询的字段,如果一级行业为空则不查询-->
<isNotNull prepend="" property="FirstIndustry">
Industry.[Industry_Name],
Industry.[Industry_Id],
</isNotNull>
Users.[UserName],
Users.[UserRealName],
Users.[UserId]
FROM Client,Users
<!--判断是否要连接表-->
<isNotNull prepend="," property="FirstIndustry">Industry</isNotNull>
<isEmpty prepend="" property="BethroughItemArray" >
<isNotEmpty prepend="," property="ItemArray">BusinessModel,Business_Note,Project</isNotEmpty>
</isEmpty>
<isEmpty prepend="" property="ItemArray" >
<isNotEmpty prepend="," property="BethroughItemArray">BusinessModel,Business_Note,Project</isNotEmpty>
</isEmpty>
<isNotEmpty prepend="," property="BethroughItemArray" >
<isNotEmpty prepend="" property="ItemArray">BusinessModel,Business_Note,Project</isNotEmpty>
</isNotEmpty>
where Users.[UserId]=Client.[Import_User_Id] and Client.[Client_Sign]=0
<!--一级行业-->
<isNotNull prepend="AND" property="FirstIndustry">
Client.First_Industry=#FirstIndustry#
and Client.First_Industry=Industry.Industry_Id
</isNotNull>
<!--二级行业-->
<isNotNull prepend="AND" property="SecondIndustry">
Client.Second_Industry=#SecondIndustry#
</isNotNull>
<!--客户名称 模糊查询-->
<isNotEmpty prepend="AND" property="ClientName">Client.Client_Name like '%$ClientName$%'</isNotEmpty>
<!--查询代码-->
<isNotEmpty prepend="AND" property="ClientCode">Client.Client_Code like '%$ClientCode$%'</isNotEmpty>
<!--其他录入人-->
<isNotEmpty prepend="AND" property="IsUser">Client.Import_User_Id!=#ImportUserId#</isNotEmpty>
<!--所在省-->
<isNotNull prepend="AND" property="ProvinceID">Client.provinceID=#ProvinceID#</isNotNull>
<!--客户编号-->
<isNotEmpty prepend="AND" property="ClientId">Client.Client_Id like '%$ClientId$%'</isNotEmpty>
<!--做过的项目 在类里传一个ArrayList-->
<isNotEmpty prepend="AND" property="BethroughItemArray">
<iterate prepend="" property="BethroughItemArray" open="(" close=")" conjunction="and" >
Client.Id in (select BusinessModel.Client_Auto_Id from BusinessModel,Business_Note where Business_Note.Business_Id=BusinessModel.Business_Id
and Business_Note.Project_Id=#BethroughItemArray[].Value#)
</iterate>
</isNotEmpty>
</select>
分享到:
相关推荐
IBatisNet和NHibernate模版
IBatisNet-执行存储过程详细实例 IBatisNet-执行存储过程详细实例 IBatisNet-执行存储过程详细实例 IBatisNet-执行存储过程详细实例 IBatisNet-执行存储过程详细实例
iBATISNet Database Layer!这个框架将让你能够更好的在dotnet应用中设计和实现实体层。这个框架有两个主要的组成部分,一个是SQL Maps,另一个是Data Access Objects。下面是一个简单的iBATISNet应用架构。 项目中...
Ibatisnet介绍和使用
IBatisNet 框架 项目实例
对于IBatisNet的新手还是很有帮助的
理解ibatisnet机制,从入门到会只要几天时间,ORM模式很大程度上改善了代码的质量,效率更高,代码更少。
完整的iBatisNet配置SQLlite例子,有完整实体类和一个简单的查询测试方法。希望帮助各位快速构建项目
IBatisNet C# .net 入门 配置 使用的例子 有入门到精通 请用word2007打开
C#开发 MonoRail+IBatisNet +Velocity+vs2010的项目实例,初学者配置起来比较繁琐,配置好使用起来发现IBatisNet 还是很强大的!
C# winform ibatisnet datagridview数据库分页。 使用前先在数据库中创建sys_user表。字段看配置文件。
IBatisNet+Castle项目实例
ibatisnet的dll和相关操作配置文档,很全面
利用IBatisNet所建的开发框架。有利于程序员的快速开发。减少常用操作数据库的工作量
C#开发 ibatisnet+monorail+vs2010的项目实例
IBatisNet在.NET中的使用总结
Ibatisnet大合集整理的...IbatisnetIbatisnetIbatisnet....
IBatisNet源代码 反编译出来的。。编译通过,最新版本。
详细IbatisNet配置,以及使用其调用存储过程
IBatisnet 三层架构,通俗易懂,对初学者很有帮助!