阅读背景:

ajax回调函数没反应----条件分页查询sql

来源:互联网 
<!-- 查询满足条件的集合 -->
	<select id="queryMarketActivityForPageByCondition" resultType="MarketActivity">
		select
		   ac.id,
		   ac. name,
		   tab_1.text as type,
		   tab_2.text as state,
		   ac.startDate,
		   ac.endDate,
		   tab_3. name as owner,
		   ac.budgetCost,
		   ac.actualCost,
		   tab_4. name as createBy,
		   ac.createTime,
		   tab_5. name as editBy,
		   ac.editTime,
		   ac.description
		from
		   tbl_marketing_activities ac
		left join tbl_dictionary_value tab_1 on tab_1.id = ac.type
		left join tbl_dictionary_value tab_2 on tab_2.id = ac.state
		join tbl_user tab_3 on tab_3.id = ac. owner
		join tbl_user tab_4 on tab_4.id = ac.createBy
		left join tbl_user tab_5 on tab_5.id = ac.editBy	
		
		<where>
			<if test="name != null and name.trim != ''">
				and ac.name like '%' #{name} '%'
			</if>
			<if test="owner != null and owner.trim != ''">
				and ac.owner = #{owner}
			</if>
			<if test="type != null and type.trim != ''">
				and ac.type = #{type}
			</if>
			<if test="state != null and state.trim != ''">
				and ac.state = #{state}
			</if>
			<if test="startDate != null and startDate.trim != ''">
				and ac.startDate > #{startDate}
			</if>
			<if test="endDate != null and endDate.trim != ''">
				and ac.endDate < #{endDate}
			</if>
			
		</where>
		
		order by ac.createTime desc
		limit #{skipNum},#{pageCount}
		
	</select><!-- 查询满足条件的集合 -->
	<select id="queryMarketActi



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: