|
@@ -237,9 +237,6 @@
|
|
|
<if test="lastReceiveTime != null">
|
|
|
#{lastReceiveTime},
|
|
|
</if>
|
|
|
- <if test="offlineDate != null">
|
|
|
- #{offlineDate},
|
|
|
- </if>
|
|
|
<if test="userName != null">
|
|
|
#{userName},
|
|
|
</if>
|
|
@@ -258,6 +255,9 @@
|
|
|
<if test="lastAlarmDate != null">
|
|
|
#{lastAlarmDate},
|
|
|
</if>
|
|
|
+ <if test="offlineDate != null">
|
|
|
+ #{offlineDate},
|
|
|
+ </if>
|
|
|
<if test="acceptDate != null">
|
|
|
#{acceptDate},
|
|
|
</if>
|
|
@@ -394,6 +394,27 @@
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
+ <insert id="batchInsert" parameterType="map">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into rmcp_device
|
|
|
+ (id, tenant_id, category_id, company_org_id, dept_org_id, product_id, device_no,
|
|
|
+ meter_no, file_no, seal_no, device_status, address, lng, lat, community_id, read_data,
|
|
|
+ valve_status, last_receive_time, user_name, user_phone, id_card, old_end_degree,
|
|
|
+ old_image_url, last_alarm_date, offline_date, accept_date, install_date, is_install,
|
|
|
+ is_accept, `status`, create_by, create_date, update_by, update_date)
|
|
|
+ values
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
+ (#{item.id}, #{item.tenantId}, #{item.categoryId}, #{item.companyOrgId}, #{item.deptOrgId},
|
|
|
+ #{item.productId}, #{item.deviceNo}, #{item.meterNo}, #{item.fileNo}, #{item.sealNo},
|
|
|
+ #{item.deviceStatus}, #{item.address}, #{item.lng}, #{item.lat}, #{item.communityId},
|
|
|
+ #{item.readData}, #{item.valveStatus}, #{item.lastReceiveTime}, #{item.userName},
|
|
|
+ #{item.userPhone}, #{item.idCard}, #{item.oldEndDegree}, #{item.oldImageUrl}, #{item.lastAlarmDate},
|
|
|
+ #{item.offlineDate}, #{item.acceptDate}, #{item.installDate}, #{item.isInstall},
|
|
|
+ #{item.isAccept}, #{item.status}, #{item.createBy}, #{item.createDate}, #{item.updateBy},
|
|
|
+ #{item.updateDate})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
<select id="findById" resultType="com.zcxk.rmcp.core.entity.Device">
|
|
|
select <include refid="Base_Column_List"/> from rmcp_device where status = 1 and id = #{id}
|
|
|
</select>
|
|
@@ -531,6 +552,26 @@
|
|
|
order by rd.create_date desc
|
|
|
</select>
|
|
|
|
|
|
+ <select id="findList_COUNT" resultType="Long">
|
|
|
+ select count(1)
|
|
|
+ from rmcp_device rd
|
|
|
+ <where>
|
|
|
+ rd.status = 1
|
|
|
+ <if test="dto.categoryId != null">and rd.category_id = #{dto.categoryId}</if>
|
|
|
+ <if test="dto.productId != null">and rd.product_id = #{dto.productId}</if>
|
|
|
+ <if test="dto.companyOrgId != null">and rd.company_org_id = #{dto.companyOrgId}</if>
|
|
|
+ <if test="dto.deptOrgId != null">and rd.dept_org_id = #{dto.deptOrgId}</if>
|
|
|
+ <if test="dto.communityId != null">and rd.community_id = #{dto.communityId}</if>
|
|
|
+ <if test="dto.deviceNo != null and dto.deviceNo != ''">and (rd.device_no LIKE concat('%',#{dto.deviceNo},'%') or rd.meter_no LIKE concat('%',#{dto.deviceNo},'%') )</if>
|
|
|
+ <if test="dto.address != null and dto.address != ''">and rd.address LIKE concat('%',#{dto.address},'%') </if>
|
|
|
+ <if test="dto.deviceStatus != null">and rd.device_status = #{dto.deviceStatus}</if>
|
|
|
+ <if test="dto.valveStatus != null">and rd.valve_status = #{dto.deviceStatus}</if>
|
|
|
+ <if test="dto.startDate != null"> and rd.last_receive_time <![CDATA[ >= ]]> #{dto.startDate}</if>
|
|
|
+ <if test="dto.endDate != null"> and rd.last_receive_time <![CDATA[ <= ]]> #{dto.endDate}</if>
|
|
|
+ <include refid="permissionCondition"/>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<update id="delByIds">
|
|
|
update rmcp_device set status = 0,update_date = NOW() where status = 1
|
|
|
and id in <foreach collection="ids" item="item" open="(" separator="," close=")">#{item}</foreach>
|
|
@@ -759,8 +800,8 @@
|
|
|
left join rmcp_community rc on (rc.id = rd.community_id)
|
|
|
<where>
|
|
|
rd.status = 1
|
|
|
- <if test="deviceNo != null and deviceNo != ''"> AND rd.device_no = #{deviceNo}</if>
|
|
|
- <if test="meterNo != null and meterNo != ''"> AND rd.meter_no = #{meterNo}</if>
|
|
|
+ <if test="deviceNo != null and deviceNo != ''"> AND rd.device_no = #{deviceNo}</if>
|
|
|
+ <if test="meterNo != null and meterNo != ''"> AND rd.meter_no = #{meterNo}</if>
|
|
|
<include refid="permissionCondition"/>
|
|
|
</where>
|
|
|
</select>
|