
文章目录概要整体流程技术细节概要部门需求要求检索可以实现自选检索字段、检索条件、参数。并且在页面不要冗余显示。整体流程1.前端效果前端部分通过组件实现下拉选项 由字典提供。2.后端这一部分由mybatis拼接后进行sql查询技术细节2.1检索条件的映射!--字段映射片段--sql idsearchConditionchoosewhen test${searchKey} code//此处就是对应的字段include refidbuildConditionproperty namecolumnvaluecode/property namesearchTypevalue${searchType}///选择的参数property nameinputAvalue${inputA}///检索的数值property nameinputBvalue${inputB}///检索的数值多选/include/when/choose/sql2.2 可复用的条件构建片段!--可复用的条件构建片段--sql idbuildConditionchoosewhen test${searchType} dayuand ${column}gt;#{${inputA}}/whenwhen test${searchType} dayudengyuand ${column}gt;#{${inputA}}/whenwhen test${searchType} isnulland ${column}isnull/whenwhen test${searchType} isnotnulland ${column}is notnull/when/choose/sql2.3检索语句的使用select idselectListparameterTypelistParameterresultMaplistParameterResultselect*fromwhereinclude refidsearchCondition//有多个就对应创建多个property namesearchKeyvalueparams.searchKey1///我是用数字区分property namesearchTypevalueparams.searchType1/property nameinputAvalueparams.searchInputA1/property nameinputBvalueparams.searchInputB1//include/where/select