123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?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.jjt.rz.mapper.TwinDeviceRzMapper">
- <resultMap type="TwinDeviceRz" id="TwinDeviceRzResult">
- <result property="deviceId" column="DEVICE_ID" />
- <result property="wsName" column="WS_NAME" />
- <result property="line" column="LINE" />
- <result property="typeId" column="TYPE_ID" />
- <result property="typeName" column="TYPE_NAME" />
- <result property="deviceCode" column="DEVICE_CODE" />
- <result property="deviceName" column="DEVICE_NAME" />
- <result property="devicePath" column="DEVICE_PATH" />
- <result property="createdBy" column="CREATED_BY" />
- <result property="createdTime" column="CREATED_TIME" />
- <result property="updatedBy" column="UPDATED_BY" />
- <result property="updatedTime" column="UPDATED_TIME" />
- <result property="remark" column="REMARK" />
- </resultMap>
- <sql id="selectTwinDeviceRzVo">
- select DEVICE_ID, WS_NAME, LINE, TYPE_ID, TYPE_NAME, DEVICE_CODE, DEVICE_NAME, DEVICE_PATH, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK from TWIN_DEVICE_RZ
- </sql>
- <select id="selectTwinDeviceRzList" parameterType="TwinDeviceRz" resultMap="TwinDeviceRzResult">
- <include refid="selectTwinDeviceRzVo"/>
- <where>
- <if test="wsName != null and wsName != ''"> and WS_NAME like concat('%', #{wsName}, '%')</if>
- <if test="line != null and line != ''"> and LINE = #{line}</if>
- <if test="typeId != null "> and TYPE_ID = #{typeId}</if>
- <if test="typeName != null and typeName != ''"> and TYPE_NAME = #{typeName}</if>
- <if test="deviceCode != null and deviceCode != ''"> and DEVICE_CODE = #{deviceCode}</if>
- <if test="deviceName != null and deviceName != ''"> and DEVICE_NAME like concat('%', #{deviceName}, '%')</if>
- <if test="devicePath != null and devicePath != ''"> and DEVICE_PATH = #{devicePath}</if>
- <if test="createdBy != null and createdBy != ''"> and CREATED_BY = #{createdBy}</if>
- <if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
- <if test="updatedBy != null and updatedBy != ''"> and UPDATED_BY = #{updatedBy}</if>
- <if test="updatedTime != null "> and UPDATED_TIME = #{updatedTime}</if>
- <if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
- </where>
- </select>
- <select id="selectTwinDeviceRzByDeviceId" parameterType="Long" resultMap="TwinDeviceRzResult">
- <include refid="selectTwinDeviceRzVo"/>
- where DEVICE_ID = #{deviceId}
- </select>
- <insert id="insertTwinDeviceRz" parameterType="TwinDeviceRz" useGeneratedKeys="true" keyProperty="deviceId">
- insert into TWIN_DEVICE_RZ
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="wsName != null">WS_NAME,</if>
- <if test="line != null">LINE,</if>
- <if test="typeId != null">TYPE_ID,</if>
- <if test="typeName != null">TYPE_NAME,</if>
- <if test="deviceCode != null">DEVICE_CODE,</if>
- <if test="deviceName != null">DEVICE_NAME,</if>
- <if test="devicePath != null">DEVICE_PATH,</if>
- <if test="createdBy != null">CREATED_BY,</if>
- <if test="createdTime != null">CREATED_TIME,</if>
- <if test="updatedBy != null">UPDATED_BY,</if>
- <if test="updatedTime != null">UPDATED_TIME,</if>
- <if test="remark != null">REMARK,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="wsName != null">#{wsName},</if>
- <if test="line != null">#{line},</if>
- <if test="typeId != null">#{typeId},</if>
- <if test="typeName != null">#{typeName},</if>
- <if test="deviceCode != null">#{deviceCode},</if>
- <if test="deviceName != null">#{deviceName},</if>
- <if test="devicePath != null">#{devicePath},</if>
- <if test="createdBy != null">#{createdBy},</if>
- <if test="createdTime != null">#{createdTime},</if>
- <if test="updatedBy != null">#{updatedBy},</if>
- <if test="updatedTime != null">#{updatedTime},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateTwinDeviceRz" parameterType="TwinDeviceRz">
- update TWIN_DEVICE_RZ
- <trim prefix="SET" suffixOverrides=",">
- <if test="wsName != null">WS_NAME = #{wsName},</if>
- <if test="line != null">LINE = #{line},</if>
- <if test="typeId != null">TYPE_ID = #{typeId},</if>
- <if test="typeName != null">TYPE_NAME = #{typeName},</if>
- <if test="deviceCode != null">DEVICE_CODE = #{deviceCode},</if>
- <if test="deviceName != null">DEVICE_NAME = #{deviceName},</if>
- <if test="devicePath != null">DEVICE_PATH = #{devicePath},</if>
- <if test="createdBy != null">CREATED_BY = #{createdBy},</if>
- <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
- <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
- <if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
- <if test="remark != null">REMARK = #{remark},</if>
- </trim>
- where DEVICE_ID = #{deviceId}
- </update>
- <delete id="deleteTwinDeviceRzByDeviceId" parameterType="Long">
- delete from TWIN_DEVICE_RZ where DEVICE_ID = #{deviceId}
- </delete>
- <delete id="deleteTwinDeviceRzByDeviceIds" parameterType="String">
- delete from TWIN_DEVICE_RZ where DEVICE_ID in
- <foreach item="deviceId" collection="array" open="(" separator="," close=")">
- #{deviceId}
- </foreach>
- </delete>
- </mapper>
|