@Component
public class JoinQueryRepoImpl {
@Autowired
private EntityManager entityManager;
/**
* 客户和账户级联查询
*/
public Page findAcctPopup(AcctVo condition, Pageable pageable) {
StringBuilder countSelectSql = new StringBuilder();
countSelectSql.append(" SELECT count(1) ");
countSelectSql.append(" FROM ");
countSelectSql.append(" t_biz_acct m, ");
countSelectSql.append(" t_biz_customer_info n ");
countSelectSql.append(" WHERE ");
countSelectSql.append(" m.cust_no = n.id ");
StringBuilder selectSql = new StringBuilder();
selectSql.append(" SELECT ");
selectSql.append(" m.*, ");
selectSql.append(" n.cert_no AS cust_cert_no, ");
selectSql.append(" n.cert_type AS cust_cert_type, ");
selectSql.append(" n.NAME AS cust_name, ");
selectSql.append(" n.sex AS cust_sex, ");
selectSql.append(" n.mobile AS cust_mobile, ");
selectSql.append(" n.phone AS cust_phone, ");
selectSql.append(" n.email AS cust_email, ");
selectSql.append(" n.type AS cust_type, ");
selectSql.append(" n.STATUS AS cust_