南昌市物联网技防平台-后台
zengh
2021-03-26 318ec1c79b9f73cf96dbf85027c335c8a2749837
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/equipment/mapper/EquipmentMapper.xml
@@ -117,6 +117,62 @@
    </select>
    <select id="selectDeptPages" resultMap="equipmentResultMap">
        select equipment.id,equipment.deviceName,equipment.deviceNumber,equipment.deviceType,equipment.ownership
        ,equipment.ownerId,equipment.devicestate,equipment.stime,equipment.dtype,equipment.heartbeat,equipment.expireTime,
        equipment.parent_id,equipment.district,equipment.province,equipment.city,equipment.serialNumber,equipment.channelNumber,
        equipment.jd ,
        equipment.wd ,
        equipment.state,equipment.reason,
        equipment.street,catalog.pid,
        equipment.oneContacts,equipment.onePhone,equipment.oneId,
        equipment.twoContacts,equipment.twoPhone,equipment.twoId,
        equipment.ThreeContacts,equipment.ThreePhone,equipment.threeId,
        equipment.deptId,
        equipment.addvcd,equipment.pay,equipment.expireTime from sys_equipment equipment
        left join sys_catalog catalog on catalog.eqid = equipment.deviceNumber
        where 1=1
        <if test="equipment.deviceName!=null">
            and (deviceName like concat('%',#{equipment.deviceName},'%') or deviceNumber like
            concat('%',#{equipment.deviceName},'%'))
        </if>
        <if test="equipment.beginTime!=null and equipment.beginTime!=''">
            and expireTime&gt;=#{equipment.beginTime}
        </if>
        <if test="equipment.endTime!=null and equipment.endTime!=''">
            and expireTime&lt;=#{equipment.endTime}
        </if>
        <if test="equipment.district!=null">
            and district like concat('%',#{equipment.district},'%')
        </if>
        <if test="equipment.province!=null">
            and province like concat('%',#{equipment.province},'%')
        </if>
        <if test="equipment.city!=null">
            and city like concat('%',#{equipment.city},'%')
        </if>
        <if test="equipment.devicestate!=null">
            and devicestate =#{equipment.devicestate}
        </if>
        <if test="equipment.dtype!=null">
            and dtype=#{equipment.dtype}
        </if>
        <if test="childList!=null and childList.size>0">
            and deptId in
            <foreach collection="childList" index="index" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
    </select>
    <!--新增-->
    <insert id="s" parameterType="org.springblade.jfpt.equipment.entity.Equipment">
       INSERT INTO sys_equipment (deviceName,deviceNumber,deviceType,ownership,ownerId,devicestate,stime,coordinate,parent_id,jd,wd,addvcd,street,dtype) VALUES (#{deviceName},#{deviceNumber},#{deviceType},#{ownership},#{yname},#{devicestate},#{stime},POINT(#{jd},#{wd}),#{parentId},#{jd},#{wd},#{addvcd},#{streeName},#{dtype})