zoukankan      html  css  js  c++  java
  • tk-mybatis的方法记录

    转自:https://www.cnblogs.com/tsing0520/p/11932864.html

    tk-mybatis的方法记录

     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    @Data
    @EqualsAndHashCode(callSuper = true)
    @Entity
    @Table(name = "t_invoice_verify_record")
    public class InvoiceVerifyRecordPO extends BasePO {
     
        private Integer invoiceKeyInformationId;
     
        private String verifyParam;
     
        private Integer verifyResultCode;
     
        private String verifyResultMessage;
     
        private Date verifyDate;
     
        private Short status;
     
        private Short type;
     
        private String verifyResultJson;
     
    }

      

    1
    2
    3
    Example example = new Example(InvoiceVerifyRecordPO.class);
             
    example.selectProperties("verifyParam","verifyResultJson");

      

    输出信息:

    SELECT verify_param , verify_result_json FROM t_invoice_verify_record ;

     

     

     

    1
    2
    3
    4
    5
    Example example = new Example(InvoiceVerifyRecordPO.class);
         
    example.selectProperties("verifyParam","verifyResultJson")
        .and()
        .andEqualTo("status",0);

      

    输出信息:

    ==>  Preparing: SELECT verify_param , verify_result_json FROM t_invoice_verify_record WHERE ( status = ? )  

    ==>  Parameters: 0(Integer) 

     

     

    1
    2
    3
    4
    5
    6
    Example example = new Example(InvoiceVerifyRecordPO.class);
         
    example.selectProperties("verifyParam","verifyResultJson")
        .and()
        .andEqualTo("status",0)
        .andLike("verifyParam","%d%");

      

    输出信息:

    ==>  Preparing: SELECT verify_param , verify_result_json FROM t_invoice_verify_record WHERE ( status = ? and verify_param like ? )  

    ==>  Parameters: 0(Integer), %d%(String) 

     

     

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    Example example = new Example(InvoiceVerifyRecordPO.class);
         
    example.selectProperties("verifyParam","verifyResultJson")
        .and()
        .andEqualTo("status",0)
        .andLike("verifyParam","%d%");
     
        // 排序
        example.orderBy("status").asc()
               .orderBy("type").desc();

      

    输出信息:

    SELECT verify_param , verify_result_json FROM t_invoice_verify_record WHERE ( status = ? and verify_param like ? ) order by status ASC,type DESC ;

     

     

     

     

     

     

     

    1
    2
    3
    4
    5
    6
    7
    Example example = new Example(InvoiceVerifyRecordPO.class);
         
    Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("status"0)
                .andLike("verifyParam""%d%");
        example.orderBy("status").asc()
                .orderBy("verifyParam").desc();

      

     

    Example example = Example.builder(InvoiceVerifyRecordPO.class)
    .select("verifyParam","verifyResultJson")
    .where(Sqls.custom().andEqualTo("status", 0)
    .andLike("verifyParam", "%d%"))
    .orderByDesc("status","type")
    .build();

  • 相关阅读:
    asp 后台批量管理程序
    面经
    单例模式(singleton)解析例子
    互联网产品经理必读书籍
    Struts2中的OGNL表达式
    阿里巴巴面经
    Servlet/JSP如何控制页面缓存于squid中
    Java陷阱一箩筐面试题集及解答
    阿里巴巴笔经http://bbs.yingjiesheng.com/forum.php?mod=viewthread&tid=696098&extra=page%3D1%26filter%3Dtypeid%26typeid%3D6356%26typeid%3D6356
    阿里巴巴java笔试
  • 原文地址:https://www.cnblogs.com/wanjun-top/p/13431853.html
Copyright © 2011-2022 走看看