wangmengzhao
2023-11-14 47b6a57b4d41783d1243cea4323865a92fe50783
设备安装的代码编写20231114 wmz
7个文件已修改
110 ■■■■■ 已修改文件
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceOrderController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/mapper/DeviceOrderMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/IDeviceOrderService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceOrderServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceOrderMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-system/src/main/resources/mapper/system/SysUserMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-system/src/main/resources/mapper/system/SysUserRoleMapper.xml 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceOrderController.java
@@ -68,7 +68,11 @@
    @Log(title = "添加安装单信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@Validated @RequestBody DeviceOrder deviceOrder) throws Exception {
        deviceOrder.setState(0);
        if ("未指派".equals(deviceOrder.getErectoName())) {
            deviceOrder.setState(0);
        } else {
            deviceOrder.setState(1);
        }
        return AjaxResult.success(iDeviceOrderService.insertDeviceOrder(deviceOrder));
    }
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/mapper/DeviceOrderMapper.java
@@ -68,6 +68,6 @@
     * @param ids
     * @return
     */
    public int deleteDeviceOrder(Integer[] ids);
    public int deleteDeviceOrder(@Param("idss") Integer[] ids);
}
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/IDeviceOrderService.java
@@ -64,6 +64,6 @@
     * @param ids
     * @return
     */
    public int deleteDeviceOrder(Integer[] ids);
    public int deleteDeviceOrder(Integer[] ids)throws Exception;
}
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceOrderServiceImpl.java
@@ -56,7 +56,7 @@
    }
    @Override
    public int deleteDeviceOrder(Integer[] ids) {
    public int deleteDeviceOrder(Integer[] ids)throws Exception {
        return deviceOrderMapper.deleteDeviceOrder(ids);
    }
}
wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceOrderMapper.xml
@@ -117,7 +117,7 @@
    <insert id="insertDeviceOrder" parameterType="DeviceOrder" useGeneratedKeys="true" keyProperty="id">
        insert into iot_device_order(
        <if test="id != null and id != 0">id,</if>
        <if test="erectoId != null and erectoId != 0">erecto_id,</if>
        <if test="erectoId != null">erecto_id,</if>
        <if test="deviceId != null and deviceId != 0">device_id,</if>
        <if test="userId != null and userId != 0">user_id,</if>
        <if test="erectoName != null and erectoName != ''">erecto_name,</if>
@@ -135,7 +135,7 @@
        create_time)
        values (
        <if test="id != null and id != ''">#{id},</if>
        <if test="erectoId != null and erectoId != ''">#{erectoId},</if>
        <if test="erectoId != null">#{erectoId},</if>
        <if test="deviceId != null and deviceId != ''">#{deviceId},</if>
        <if test="userId != null">#{userId},</if>
        <if test="erectoName!=null">#{erectoName},</if>
@@ -159,7 +159,7 @@
            <if test=" erectoId!= null and erectoId != 0">erecto_id = #{erectoId},</if>
            <if test="deviceId != null and deviceId != 0">device_id = #{deviceId},</if>
            <if test="userId != null and userId != 0">user_id = #{userId},</if>
            <if test="erectoName!=null and erectoName != ''">erectoName = #{erectoName},</if>
            <if test="erectoName!=null and erectoName != ''">erecto_name = #{erectoName},</if>
            <if test="userName != null and userName != ''">user_name = #{userName},</if>
            <if test="userPhone != null and userPhone != ''">user_phone = #{userPhone},</if>
            <if test="address != null and address != ''">address = #{address},</if>
@@ -180,9 +180,9 @@
        where id = #{id}
    </delete>
    <delete id="deleteDeviceOrder">
        update iot_device_order set state = '3' where erecto_id in
        <foreach collection="array" item="erectoId" open="(" separator="," close=")">
            #{erectoId}
        delete iot_device_order where id in
        <foreach collection="idss" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
wumei-smart-master/springboot/wumei-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -113,6 +113,9 @@
        <if test="status != null and status != ''">
            AND u.status = #{status}
        </if>
        <if test="isAuthentication != null">
            AND u.is_authentication = #{isAuthentication}
        </if>
        <if test="phonenumber != null and phonenumber != ''">
            AND u.phonenumber like concat('%', #{phonenumber}, '%')
        </if>
wumei-smart-master/springboot/wumei-system/src/main/resources/mapper/system/SysUserRoleMapper.xml
@@ -1,44 +1,51 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysUserRoleMapper">
    <resultMap type="SysUserRole" id="SysUserRoleResult">
        <result property="userId"     column="user_id"      />
        <result property="roleId"     column="role_id"      />
    </resultMap>
    <resultMap type="SysUserRole" id="SysUserRoleResult">
        <result property="userId" column="user_id"/>
        <result property="roleId" column="role_id"/>
    </resultMap>
    <delete id="deleteUserRoleByUserId" parameterType="Long">
        delete from sys_user_role where user_id=#{userId}
    </delete>
    <select id="countUserRoleByRoleId" resultType="Integer">
        select count(1) from sys_user_role where role_id=#{roleId}
    </select>
    <delete id="deleteUserRole" parameterType="Long">
         delete from sys_user_role where user_id in
         <foreach collection="array" item="userId" open="(" separator="," close=")">
             #{userId}
        </foreach>
     </delete>
    <insert id="batchUserRole">
        insert into sys_user_role(user_id, role_id) values
        <foreach item="item" index="index" collection="list" separator=",">
            (#{item.userId},#{item.roleId})
        </foreach>
    </insert>
    <delete id="deleteUserRoleInfo" parameterType="SysUserRole">
        delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
    </delete>
    <delete id="deleteUserRoleInfos">
        delete from sys_user_role where role_id=#{roleId} and user_id in
         <foreach collection="userIds" item="userId" open="(" separator="," close=")">
             #{userId}
            </foreach>
    </delete>
    <delete id="deleteUserRoleByUserId" parameterType="Long">
        delete
        from sys_user_role
        where user_id = #{userId}
    </delete>
    <select id="countUserRoleByRoleId" resultType="Integer">
        select count(1)
        from sys_user_role
        where role_id = #{roleId}
    </select>
    <delete id="deleteUserRole" parameterType="Long">
        delete from sys_user_role where user_id in
        <foreach collection="array" item="userId" open="(" separator="," close=")">
            #{userId}
        </foreach>
    </delete>
    <insert id="batchUserRole">
        insert into sys_user_role(user_id, role_id) values
        <foreach item="item" index="index" collection="list" separator=",">
            (#{item.userId},#{item.roleId})
        </foreach>
    </insert>
    <delete id="deleteUserRoleInfo" parameterType="SysUserRole">
        delete
        from sys_user_role
        where user_id = #{userId}
          and role_id = #{roleId}
    </delete>
    <delete id="deleteUserRoleInfos">
        delete from sys_user_role where role_id=#{roleId} and user_id in
        <foreach collection="userIds" item="userId" open="(" separator="," close=")">
            #{userId}
        </foreach>
    </delete>
</mapper>