<mapper?namespace="Message">
??<resultMap?type="com.ljm.java.entity.Message"?id="MessageResult">
????<id?column="ID"?jdbcType="INTEGER"?property="id"/>
????<result?column="COMMAND"?jdbcType="VARCHAR"?property="command"/>
????<result?column="DESCRIPTION"?jdbcType="VARCHAR"?property="description"/>
????<result?column="CONTENT"?jdbcType="VARCHAR"?property="content"/>
??</resultMap>
??<select?id="queryMessageList"?parameterType="com.ljm.java.entity.Message"?resultMap="MessageResult">
????select?ID,COMMAND,DESCRIPTION,CONTENT?from?MESSAGE
????<where>
???? <if?test="command?!=?null?and?!"".equals(command.trim())">
???? and?COMMAND?like?'%'?#{command}'%'
????</if>
????<if?test="description?!=?null?and?!"".equals(description.trim())">
???? and?DESCRIPTION?like?'%'?#{description}?'%'?
????</if>
????</where>
??</select>
1 回答

qq_飄隨風(fēng)_0
TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超1個(gè)贊
你的sql寫(xiě)錯(cuò)了 ? like ?‘% ?#{command} %' ?你那里多了兩個(gè)分號(hào)
添加回答
舉報(bào)
0/150
提交
取消