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();

 

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();

 

相关文章:

  • 2021-12-04
  • 2021-08-12
  • 2021-12-05
  • 2021-05-25
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-14
  • 2022-12-23
  • 2021-04-16
  • 2021-07-26
  • 2021-05-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案