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

本文介绍了一段MyBatis SQL映射文件用于查询市场活动的实现细节,包括使用左连接来获取活动类型和状态的描述,以及如何通过条件筛选查询结果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<!-- 查询满足条件的集合 -->
	<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>

===============================================================================================

错误原因是jquery的id选取符写成了$,导致报错

以后不能犯这种低级错误

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值