MyBatis多条件查询
程序员文章站
2022-03-01 17:24:26
...
DAO:
List<LimitApply> selectInformationByOptions(Map<String, Object> map );
MAPPER:
<select id="selectInformationByOptions" resultMap="BaseResultMap" parameterType="java.util.HashMap">
select
<include refid="Base_Column_List" />
from TB_LIMIT_APPLY
where DEPARTMENT_ID = #{did}
and STATE =#{state}
<if test="startTime!=null">
and APPLY_TIME >= #{startTime}
</if>
<if test="endTime!=null">
and APPLY_TIME <=#{endTime}
</if>
ORDER BY APPLY_TIME DESC
</select>
注意的是”>”和“<”在MAPPER文件中要用>
和<
代替
上一篇: MyBatis多条件查询
下一篇: centos7 下常用命令