因项目需要最近使用ibatis,在使用查询语句的时候,想着通用性所以没有在配置文件里用N多的and 语句,而是如下:

<select >
        select user_id userId,user_no
        userNo,user_name userName, pass
        pass,area_no areaNo,phone phone, mail
        mail,is_admin
        isAdmin,'status' 'status',create_date createDate,
        last_login_date
        lastLoginDate, last_login_ip lastLoginIp from
        p_sys_user
    
    <isParameterPresent>
        <isNotNull property="conditional">
            where  #conditional#
          </isNotNull>
          <isNotNull property="orderByClause">
            order by #orderByClause#
          </isNotNull>
          <isNotNull property="pageStart">
            limit #pageStart#, #pageEnd#
          </isNotNull>
    </isParameterPresent>
                       
        
    </select>
View Code

相关文章:

  • 2022-01-14
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2021-09-17
  • 2021-12-25
相关资源
相似解决方案