|
@@ -6,6 +6,8 @@
|
|
|
<result property="cardId" column="card_id"/>
|
|
<result property="cardId" column="card_id"/>
|
|
|
<result property="portId" column="port_id"/>
|
|
<result property="portId" column="port_id"/>
|
|
|
<result property="tenantId" column="tenant_id"/>
|
|
<result property="tenantId" column="tenant_id"/>
|
|
|
|
|
+ <result property="deviceId" column="device_id"/>
|
|
|
|
|
+ <result property="slotIndex" column="slot_index"/>
|
|
|
<result property="imei" column="imei"/>
|
|
<result property="imei" column="imei"/>
|
|
|
<result property="deviceName" column="device_name"/>
|
|
<result property="deviceName" column="device_name"/>
|
|
|
<result property="simCount" column="sim_count"/>
|
|
<result property="simCount" column="sim_count"/>
|
|
@@ -38,7 +40,7 @@
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectCardVo">
|
|
<sql id="selectCardVo">
|
|
|
- SELECT c.card_id, c.port_id, c.tenant_id, c.imei, c.device_name, c.sim_count,
|
|
|
|
|
|
|
+ SELECT c.card_id, c.port_id, c.tenant_id, c.device_id, c.slot_index, c.imei, c.device_name, c.sim_count,
|
|
|
c.phone_1, c.phone_2, c.last_heartbeat, c.status, c.app_version,
|
|
c.phone_1, c.phone_2, c.last_heartbeat, c.status, c.app_version,
|
|
|
c.sms_sent_today, c.sms_sent_date, c.sms_sent_hour, c.sms_sent_hour_num,
|
|
c.sms_sent_today, c.sms_sent_date, c.sms_sent_hour, c.sms_sent_hour_num,
|
|
|
c.sms_hourly_limit, c.sms_daily_limit, c.sms_balance,
|
|
c.sms_hourly_limit, c.sms_daily_limit, c.sms_balance,
|
|
@@ -51,12 +53,14 @@
|
|
|
FROM company_sms_card c
|
|
FROM company_sms_card c
|
|
|
LEFT JOIN company_sms_api_port p ON c.port_id = p.port_id
|
|
LEFT JOIN company_sms_api_port p ON c.port_id = p.port_id
|
|
|
LEFT JOIN tenant_info ti ON c.tenant_id = ti.id
|
|
LEFT JOIN tenant_info ti ON c.tenant_id = ti.id
|
|
|
|
|
+ LEFT JOIN company_sms_device d ON c.device_id = d.device_id
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectCardList" resultMap="CardResult">
|
|
<select id="selectCardList" resultMap="CardResult">
|
|
|
<include refid="selectCardVo"/>
|
|
<include refid="selectCardVo"/>
|
|
|
<where>
|
|
<where>
|
|
|
<if test="tenantId != null">AND c.tenant_id = #{tenantId}</if>
|
|
<if test="tenantId != null">AND c.tenant_id = #{tenantId}</if>
|
|
|
|
|
+ <if test="deviceId != null">AND c.device_id = #{deviceId}</if>
|
|
|
<if test="imei != null and imei != ''">AND c.imei = #{imei}</if>
|
|
<if test="imei != null and imei != ''">AND c.imei = #{imei}</if>
|
|
|
<if test="status != null">AND c.status = #{status}</if>
|
|
<if test="status != null">AND c.status = #{status}</if>
|
|
|
<if test="phone1 != null and phone1 != ''">AND c.phone_1 = #{phone1}</if>
|
|
<if test="phone1 != null and phone1 != ''">AND c.phone_1 = #{phone1}</if>
|
|
@@ -82,13 +86,13 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertCard" useGeneratedKeys="true" keyProperty="cardId">
|
|
<insert id="insertCard" useGeneratedKeys="true" keyProperty="cardId">
|
|
|
- INSERT INTO company_sms_card (port_id, tenant_id, imei, device_name, sim_count,
|
|
|
|
|
|
|
+ INSERT INTO company_sms_card (port_id, tenant_id, device_id, slot_index, imei, device_name, sim_count,
|
|
|
phone_1, phone_2, last_heartbeat, status, app_version,
|
|
phone_1, phone_2, last_heartbeat, status, app_version,
|
|
|
sms_hourly_limit, sms_daily_limit, sms_balance,
|
|
sms_hourly_limit, sms_daily_limit, sms_balance,
|
|
|
call_interval_seconds, call_minutes_balance, phone_bill_balance,
|
|
call_interval_seconds, call_minutes_balance, phone_bill_balance,
|
|
|
allow_call_forward, forward_phone,
|
|
allow_call_forward, forward_phone,
|
|
|
remark, create_time)
|
|
remark, create_time)
|
|
|
- VALUES (#{portId}, #{tenantId}, #{imei}, #{deviceName}, #{simCount},
|
|
|
|
|
|
|
+ VALUES (#{portId}, #{tenantId}, #{deviceId}, #{slotIndex}, #{imei}, #{deviceName}, #{simCount},
|
|
|
#{phone1}, #{phone2}, #{lastHeartbeat}, #{status}, #{appVersion},
|
|
#{phone1}, #{phone2}, #{lastHeartbeat}, #{status}, #{appVersion},
|
|
|
#{smsHourlyLimit}, #{smsDailyLimit}, #{smsBalance},
|
|
#{smsHourlyLimit}, #{smsDailyLimit}, #{smsBalance},
|
|
|
#{callIntervalSeconds}, #{callMinutesBalance}, #{phoneBillBalance},
|
|
#{callIntervalSeconds}, #{callMinutesBalance}, #{phoneBillBalance},
|
|
@@ -101,6 +105,8 @@
|
|
|
<set>
|
|
<set>
|
|
|
<if test="portId != null">port_id = #{portId},</if>
|
|
<if test="portId != null">port_id = #{portId},</if>
|
|
|
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
|
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
|
|
|
|
+ <if test="deviceId != null">device_id = #{deviceId},</if>
|
|
|
|
|
+ <if test="slotIndex != null">slot_index = #{slotIndex},</if>
|
|
|
<if test="deviceName != null">device_name = #{deviceName},</if>
|
|
<if test="deviceName != null">device_name = #{deviceName},</if>
|
|
|
<if test="simCount != null">sim_count = #{simCount},</if>
|
|
<if test="simCount != null">sim_count = #{simCount},</if>
|
|
|
<if test="phone1 != null">phone_1 = #{phone1},</if>
|
|
<if test="phone1 != null">phone_1 = #{phone1},</if>
|