码迷,mamicode.com
首页 > 其他好文 > 详细

mybatis左连接需要输出左表的指定内容与筛选

时间:2017-09-26 19:44:14      阅读:306      评论:0      收藏:0      [点我收藏+]

标签:use   info   logs   sele   _id   trade   mob   sel   user   

  SELECT
      rpl.ID, rpl.DID, rpl.TRADE_TYPE, rpl.TRADE_TIME, rpl.CALL_TIME, rpl.TRADE_ADDR, rpl.RECEIVE_PHONE, rpl.CALL_TYPE, rpl.CREATE_DATE, rpl.CREATE_BY,
      rpl.STATE, rpl.REMARK, umci.contact_name
    FROM
           R360_Phonedetaillist rpl
           Left join User_Mobile_Contact_Info umci ON rpl.receive_phone = umci.contact_mobile_no
          <if test="userId != ‘‘ and userId != null">
            and umci.user_id = #{userId}
          </if>
    WHERE
           rpl.did = #{did}
    <if test="orderField != ‘‘ and orderField != null and orderDirection != ‘‘ and orderDirection != null">
      ORDER by ${orderField} ${orderDirection}
    </if>

 

mybatis左连接需要输出左表的指定内容与筛选

标签:use   info   logs   sele   _id   trade   mob   sel   user   

原文地址:http://www.cnblogs.com/aigeileshei/p/7598135.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!