|
|
@@ -0,0 +1,118 @@
|
|
|
+<?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.ktg.iscs.mapper.IsDeviceTechnologyMapper">
|
|
|
+
|
|
|
+
|
|
|
+ <sql id="selectIsDeviceTechnologyVo">
|
|
|
+ select * from is_device_technology
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectIsDeviceTechnologyList" parameterType="IsDeviceTechnology" resultType="IsDeviceTechnology">
|
|
|
+ <include refid="selectIsDeviceTechnologyVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="technologyCode != null and technologyCode != ''"> and technology_code = #{technologyCode}</if>
|
|
|
+ <if test="technologyName != null and technologyName != ''"> and technology_name like concat('%', #{technologyName}, '%')</if>
|
|
|
+ <if test="technologyType != null and technologyType != ''"> and technology_type = #{technologyType}</if>
|
|
|
+ <if test="workstationId != null "> and workstation_id = #{workstationId}</if>
|
|
|
+ <if test="technologyImg != null and technologyImg != ''"> and technology_img = #{technologyImg}</if>
|
|
|
+ <if test="parentId != null "> and parent_id = #{parentId}</if>
|
|
|
+ <if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
|
|
+ <if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectIsDeviceTechnologyByTechnologyId" parameterType="Long" resultType="IsDeviceTechnology">
|
|
|
+ <include refid="selectIsDeviceTechnologyVo"/>
|
|
|
+ where technology_id = #{technologyId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertIsDeviceTechnology" parameterType="IsDeviceTechnology" useGeneratedKeys="true" keyProperty="technologyId">
|
|
|
+ insert into is_device_technology
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="technologyCode != null and technologyCode != ''">technology_code,</if>
|
|
|
+ <if test="technologyName != null and technologyName != ''">technology_name,</if>
|
|
|
+ <if test="technologyType != null">technology_type,</if>
|
|
|
+ <if test="workstationId != null">workstation_id,</if>
|
|
|
+ <if test="technologyImg != null">technology_img,</if>
|
|
|
+ <if test="parentId != null">parent_id,</if>
|
|
|
+ <if test="ancestors != null">ancestors,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="technologyCode != null and technologyCode != ''">#{technologyCode},</if>
|
|
|
+ <if test="technologyName != null and technologyName != ''">#{technologyName},</if>
|
|
|
+ <if test="technologyType != null">#{technologyType},</if>
|
|
|
+ <if test="workstationId != null">#{workstationId},</if>
|
|
|
+ <if test="technologyImg != null">#{technologyImg},</if>
|
|
|
+ <if test="parentId != null">#{parentId},</if>
|
|
|
+ <if test="ancestors != null">#{ancestors},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateIsDeviceTechnology" parameterType="IsDeviceTechnology">
|
|
|
+ update is_device_technology
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="technologyCode != null and technologyCode != ''">technology_code = #{technologyCode},</if>
|
|
|
+ <if test="technologyName != null and technologyName != ''">technology_name = #{technologyName},</if>
|
|
|
+ <if test="technologyType != null">technology_type = #{technologyType},</if>
|
|
|
+ <if test="workstationId != null">workstation_id = #{workstationId},</if>
|
|
|
+ <if test="technologyImg != null">technology_img = #{technologyImg},</if>
|
|
|
+ <if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
+ <if test="ancestors != null">ancestors = #{ancestors},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ </trim>
|
|
|
+ where technology_id = #{technologyId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteIsDeviceTechnologyByTechnologyId" parameterType="Long">
|
|
|
+ delete from is_device_technology where technology_id = #{technologyId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteIsDeviceTechnologyByTechnologyIds" parameterType="String">
|
|
|
+ delete from is_device_technology where technology_id in
|
|
|
+ <foreach item="technologyId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{technologyId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="getIsDeviceTechnologyPage" resultType="com.ktg.iscs.domain.vo.technology.IsDeviceTechnologyVO">
|
|
|
+ SELECT
|
|
|
+ t.*,
|
|
|
+ w.workstation_name
|
|
|
+ FROM
|
|
|
+ is_device_technology t
|
|
|
+ LEFT JOIN is_workstation w ON w.workstation_id = t.workstation_id
|
|
|
+ <where>
|
|
|
+ <if test="isDeviceTechnology.technologyName != null and isDeviceTechnology.technologyName.trim != ''">
|
|
|
+ and t.technology_name like concat('%',#{isDeviceTechnology.technologyName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="isDeviceTechnology.technologyCode != null and isDeviceTechnology.technologyCode.trim != ''">
|
|
|
+ and t.technology_code like concat('%',#{isDeviceTechnology.technologyCode},'%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY
|
|
|
+ t.technology_id DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|