|
@@ -1,120 +0,0 @@
|
|
|
-<?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">
|
|
|
-<mapper namespace="com.ruoyi.business.mapper.TDeviceMapper">
|
|
|
-
|
|
|
- <resultMap type="TDevice" id="TDeviceResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="name" column="name" />
|
|
|
- <result property="sn" column="sn" />
|
|
|
- <result property="model" column="model" />
|
|
|
- <result property="organizationId" column="organization_id" />
|
|
|
- <result property="usage" column="usage" />
|
|
|
- <result property="status" column="status" />
|
|
|
- <result property="maintainer" column="maintainer" />
|
|
|
- <result property="maintainerPhone" column="maintainer_phone" />
|
|
|
- <result property="delFlag" column="del_flag" />
|
|
|
- <result property="revision" column="revision" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="remark" column="remark" />
|
|
|
- </resultMap>
|
|
|
-
|
|
|
- <sql id="selectTDeviceVo">
|
|
|
- select id, name, sn, model, organization_id, usage, status, maintainer, maintainer_phone, del_flag, revision, create_by, create_time, update_by, update_time, remark from t_device
|
|
|
- </sql>
|
|
|
-
|
|
|
- <select id="selectTDeviceList" parameterType="TDevice" resultMap="TDeviceResult">
|
|
|
- <include refid="selectTDeviceVo"/>
|
|
|
- <where>
|
|
|
- <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
- <if test="sn != null and sn != ''"> and sn like concat('%', #{sn}, '%')</if>
|
|
|
- <if test="model != null and model != ''"> and model = #{model}</if>
|
|
|
- <if test="organizationId != null "> and organization_id = #{organizationId}</if>
|
|
|
- <if test="usage != null "> and usage = #{usage}</if>
|
|
|
- <if test="status != null "> and status = #{status}</if>
|
|
|
- <if test="maintainer != null and maintainer != ''"> and maintainer = #{maintainer}</if>
|
|
|
- <if test="maintainerPhone != null and maintainerPhone != ''"> and maintainer_phone = #{maintainerPhone}</if>
|
|
|
- <if test="revision != null "> and revision = #{revision}</if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="selectTDeviceById" parameterType="Long" resultMap="TDeviceResult">
|
|
|
- <include refid="selectTDeviceVo"/>
|
|
|
- where id = #{id}
|
|
|
- </select>
|
|
|
-
|
|
|
- <insert id="insertTDevice" parameterType="TDevice" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into t_device
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="name != null">name,</if>
|
|
|
- <if test="sn != null">sn,</if>
|
|
|
- <if test="model != null">model,</if>
|
|
|
- <if test="organizationId != null">organization_id,</if>
|
|
|
- <if test="usage != null">usage,</if>
|
|
|
- <if test="status != null">status,</if>
|
|
|
- <if test="maintainer != null">maintainer,</if>
|
|
|
- <if test="maintainerPhone != null">maintainer_phone,</if>
|
|
|
- <if test="delFlag != null">del_flag,</if>
|
|
|
- <if test="revision != null">revision,</if>
|
|
|
- <if test="createBy != null">create_by,</if>
|
|
|
- <if test="createTime != null">create_time,</if>
|
|
|
- <if test="updateBy != null">update_by,</if>
|
|
|
- <if test="updateTime != null">update_time,</if>
|
|
|
- <if test="remark != null">remark,</if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="name != null">#{name},</if>
|
|
|
- <if test="sn != null">#{sn},</if>
|
|
|
- <if test="model != null">#{model},</if>
|
|
|
- <if test="organizationId != null">#{organizationId},</if>
|
|
|
- <if test="usage != null">#{usage},</if>
|
|
|
- <if test="status != null">#{status},</if>
|
|
|
- <if test="maintainer != null">#{maintainer},</if>
|
|
|
- <if test="maintainerPhone != null">#{maintainerPhone},</if>
|
|
|
- <if test="delFlag != null">#{delFlag},</if>
|
|
|
- <if test="revision != null">#{revision},</if>
|
|
|
- <if test="createBy != null">#{createBy},</if>
|
|
|
- <if test="createTime != null">#{createTime},</if>
|
|
|
- <if test="updateBy != null">#{updateBy},</if>
|
|
|
- <if test="updateTime != null">#{updateTime},</if>
|
|
|
- <if test="remark != null">#{remark},</if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
-
|
|
|
- <update id="updateTDevice" parameterType="TDevice">
|
|
|
- update t_device
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="name != null">name = #{name},</if>
|
|
|
- <if test="sn != null">sn = #{sn},</if>
|
|
|
- <if test="model != null">model = #{model},</if>
|
|
|
- <if test="organizationId != null">organization_id = #{organizationId},</if>
|
|
|
- <if test="usage != null">usage = #{usage},</if>
|
|
|
- <if test="status != null">status = #{status},</if>
|
|
|
- <if test="maintainer != null">maintainer = #{maintainer},</if>
|
|
|
- <if test="maintainerPhone != null">maintainer_phone = #{maintainerPhone},</if>
|
|
|
- <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
- <if test="revision != null">revision = #{revision},</if>
|
|
|
- <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
- <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
- <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
- <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
- <if test="remark != null">remark = #{remark},</if>
|
|
|
- </trim>
|
|
|
- where id = #{id}
|
|
|
- </update>
|
|
|
-
|
|
|
- <delete id="deleteTDeviceById" parameterType="Long">
|
|
|
- delete from t_device where id = #{id}
|
|
|
- </delete>
|
|
|
-
|
|
|
- <delete id="deleteTDeviceByIds" parameterType="String">
|
|
|
- delete from t_device where id in
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-</mapper>
|