SqlBuilder sql = SqlBuilder.builder()
.init("""
SELECT
ims_card_info.id,
ims_card_info.iccid,
ims_card_info.msisdn,
ims_card_info.imei,
ims_card_info.imsi,
ims_card_info.`status`,
ims_card_info.operator_account_id,
ims_card_info.first_active_time,
ims_card_info.account_open_time,
ims_card_info.silent_end_time,
ims_card_apn.apn_status
FROM
ims_card_info
LEFT JOIN ims_card_apn ON ims_card_apn.iccid = ims_card_info.iccid
WHERE 1=1
""")
.append("and ims_card_info.id > {id}", cardSearchDTO.getId() != null)
.append("and ims_card_info.operator_account_id = {operatorAccountId}", cardSearchDTO.getOperatorAccountId() != null)
.append("and ims_card_info.status = {status}", cardSearchDTO.getStatus() != null && cardSearchDTO.getStatus().compareTo(-1) > 0)
.append("and (ims_card_info.silent_end_time <= {silentEndTime} or ims_card_info.silent_end_time is null)", cardSearchDTO.getSilentEndTime() != null)
.append("and ims_card_apn.apn_status = {apnStatus}", cardSearchDTO.getApnStatus() != null)
.append("order by ims_card_info.id asc", true)
.append("limit 2000", true);
MagicDBUtils.get(jdbcTemplate).selectList(sql.toString(), cardSearchDTO, CardInfoDTO.class);
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.