public AbFmcar findByMobileAndUserId(String userId, String mobile) { StringBuffer sql = new StringBuffer("select b.* from ( "); sql.append(" select * from ab_fmcar_user where user_id = ? "); sql.append(" ) a"); sql.append(" right join ( select * from ab_fmcar where mobile = ? ) b"); sql.append(" on b.id=a.car_id"); AbFmcar car = dao.findFirst(sql.toString(), userId, mobile); return car; }
public AbFmcar findByMobile(String mobile) { StringBuffer sql = new StringBuffer(" select * from ab_fmcar where mobile = ? "); AbFmcar car = dao.findFirst(sql.toString(), mobile); return car; }