亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么不寫parameterType也可以運行成功

為什么不寫parameterType也可以運行成功?寫別的類型可不會報錯照常執行

command.xml:
? <select id="queryCommandListByPage" resultMap="CommandResult" >
? ?? ?select <include refid="columns"/> from command a left join command_content b
??? on a.id=b.command_id
? ?? ?<where>
? ?? ??? ?<if test="command.name != null and !&quot;&quot;.equals(command.name.trim())">
?? ??? ??? ?and a.name=#{command.name}
?? ???? </if>
?? ???? <if test="command.description != null and !&quot;&quot;.equals(command.description.trim())">
?? ??? ??? ?and a.description like '%' #{command.description} '%'
?? ???? </if>
? ?? ?</where>
? ?? ?<if test="flag==1">
?? ??? ?group by aid
?? ?</if>
? ?? ?order by id
? </select>

? <sql? id="columns">
? ?? ?a.id aid,a.name,a.description,b.content,b.id,b.command_id
? </sql>

接口:

/**
?? ? * 攔截器實現分頁
?? ? */
?? ?public List<command> queryCommandListByPage(Map<String,Object>parameter);

正在回答

1 回答

貌似mybatis能夠識別吧,但返回值類型不能不寫,因為mybatis需要將獲得結果封裝到相應的類中,查詢的字段與類的屬性需要一致(不一致的需要顯示的配置)

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么不寫parameterType也可以運行成功

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號