<select id="list" parameterType="ParamConfigCondition" resultType="ParamConfig">
SELECT
a.PARAM_CODE,
a.VALUE_CODE, a.`NAME`, a.IS_READ_ONLY, a.DESCR FROM TPT_PARAM_CONFIG a WHERE 1 = 1 <if test="paramCode != null and paramCode != ''"> AND a.PARAM_CODE = #{paramCode} </if> <if test="searchParam != null and searchParam != ''"> AND CONCAT(`VALUE_CODE`, `NAME`) LIKE CONCAT('%',#{searchParam},'%') </if> </select>
注:CONCAT(VALUE_CODE
, NAME
) 其中字段如果是关键字是要用”`”来引起来的,不然会报错!