<select id="findList" resultType="ZdrgkBkyj" > SELECT <include refid="zdrgkBkyjColumns"/> FROM zdrgk_zdrgj a left join zdryk_bkgl b on a.zdrgj_xm = b.bkgl_zdrxm and b.del_flag = #{DEL_FLAG_NORMAL} <where> a.del_flag = #{DEL_FLAG_NORMAL} ${dataScope} <if test="zdrgjXm != null and zdrgjXm != ''"> AND a.zdrgj_xm = #{zdrgjXm} </if> <if test="zdrgjSfzhm != null and zdrgjSfzhm != ''"> AND a.zdrgj_sfzhm = #{zdrgjSfzhm} </if> <if test="zdrgjXsd != null and zdrgjXsd != ''"> AND a.zdrgj_xsd = #{zdrgjXsd} </if> <if test="bkglZdrxm != null and bkglZdrxm != ''"> AND b.bkgl_zdrxm = #{bkglZdrxm} </if> </where> <choose> <when test="page !=null and page.orderBy != null and page.orderBy != ''"> ORDER BY ${page.orderBy} </when> <otherwise> ORDER BY a.update_date DESC </otherwise> </choose> </select>为zdrgkbkyj的xml文件 bkglZdrxm只作为查询没有显示在列表数据中如何在jeeplus中 queryParams : function(params) { var searchParam = $("#searchForm").serializeJSON(); searchParam.zdrgjXm = $("#zdrgjXm").val(); searchParam.bkglZdrxm = $("#bkglZdrxm").val(); if (searchParam.zdrgjXm && searchParam.bkglZdrxm && searchParam.zdrgjXm === searchParam.bkglZdrxm) { searchParam.matchedValue = searchParam.zdrgjXm; } else { searchParam.matchedValue = null; } searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1; searchParam.pageSize = params.limit === undefined? -1 : params.limit; if(params.sort && params.order){ searchParam.orderBy = params.sort+ " "+ params.order; } return searchParam; }中添加一个查询条件 当前的zdrgjXm字段要和bkglZdrxm字段有一样的值才能显示
时间: 2024-03-11 18:49:50 浏览: 73
MyBatis-Flex 一个优雅的 MyBatis 增强框架.zip
你想要在Jeeplus中添加一个查询条件,使得只有当zdrgjXm字段与bkglZdrxm字段具有相同的值时,该记录才能被显示。那么你可以在queryParams函数中添加以下代码:
```javascript
if (searchParam.zdrgjXm && searchParam.bkglZdrxm && searchParam.zdrgjXm === searchParam.bkglZdrxm) {
searchParam.matchedValue = searchParam.zdrgjXm;
} else {
searchParam.matchedValue = null;
}
```
这段代码会判断zdrgjXm和bkglZdrxm是否都有值,如果都有值且相同,则将matchedValue设为zdrgjXm的值,否则将matchedValue设为null。接着你可以在你的SQL语句中使用matchedValue来作为查询条件,例如:
```xml
<if test="matchedValue != null">
AND (a.zdrgj_xm = #{matchedValue} OR b.bkgl_zdrxm = #{matchedValue})
</if>
```
这段代码将检查是否存在matchedValue,如果有,则将其作为查询条件,匹配a表中的zdrgj_xm或b表中的bkgl_zdrxm。这样一来,只有当zdrgjXm和bkglZdrxm的值相同时,才能匹配到该记录。
阅读全文