|
|
@@ -1,9 +1,9 @@
|
|
|
<?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.ktg.iscs.mapper.IsHardwareMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="IsHardware" id="IsHardwareResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="hardwareCode" column="hardware_code" />
|
|
|
@@ -17,6 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="workshopCode" column="workshop_code" />
|
|
|
<result property="workshopName" column="workshop_name" />
|
|
|
<result property="status" column="status" />
|
|
|
+ <result property="activationTime" column="activation_time" />
|
|
|
+ <result property="availableTimes" column="available_times" />
|
|
|
+ <result property="usedTimes" column="used_times" />
|
|
|
+ <result property="availableLife" column="available_life" />
|
|
|
+ <result property="usedLife" column="used_life" />
|
|
|
<result property="remark" column="remark" />
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
<result property="createBy" column="create_by" />
|
|
|
@@ -26,12 +31,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectIsHardwareVo">
|
|
|
- select id, hardware_code, hardware_name, hardware_brand, hardware_spec, hardware_type_id, hardware_type_code, hardware_type_name, workshop_id, workshop_code, workshop_name, status, remark, del_flag, create_by, create_time, update_time, update_by from is_hardware
|
|
|
+ select id, hardware_code, hardware_name, hardware_brand, hardware_spec, hardware_type_id, hardware_type_code, hardware_type_name, workshop_id, workshop_code, workshop_name, status, activation_time, available_times, used_times, available_life, used_life, remark, del_flag, create_by, create_time, update_time, update_by from is_hardware
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectIsHardwareList" parameterType="IsHardware" resultMap="IsHardwareResult">
|
|
|
<include refid="selectIsHardwareVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="hardwareCode != null and hardwareCode != ''"> and hardware_code = #{hardwareCode}</if>
|
|
|
<if test="hardwareName != null and hardwareName != ''"> and hardware_name like concat('%', #{hardwareName}, '%')</if>
|
|
|
<if test="hardwareBrand != null and hardwareBrand != ''"> and hardware_brand = #{hardwareBrand}</if>
|
|
|
@@ -43,14 +48,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="workshopCode != null and workshopCode != ''"> and workshop_code = #{workshopCode}</if>
|
|
|
<if test="workshopName != null and workshopName != ''"> and workshop_name like concat('%', #{workshopName}, '%')</if>
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
+ <if test="activationTime != null "> and activation_time = #{activationTime}</if>
|
|
|
+ <if test="availableTimes != null "> and available_times = #{availableTimes}</if>
|
|
|
+ <if test="usedTimes != null "> and used_times = #{usedTimes}</if>
|
|
|
+ <if test="availableLife != null "> and available_life = #{availableLife}</if>
|
|
|
+ <if test="usedLife != null "> and used_life = #{usedLife}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectIsHardwareById" parameterType="Long" resultMap="IsHardwareResult">
|
|
|
<include refid="selectIsHardwareVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertIsHardware" parameterType="IsHardware" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into is_hardware
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
@@ -65,13 +75,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="workshopCode != null">workshop_code,</if>
|
|
|
<if test="workshopName != null">workshop_name,</if>
|
|
|
<if test="status != null and status != ''">status,</if>
|
|
|
+ <if test="activationTime != null">activation_time,</if>
|
|
|
+ <if test="availableTimes != null">available_times,</if>
|
|
|
+ <if test="usedTimes != null">used_times,</if>
|
|
|
+ <if test="availableLife != null">available_life,</if>
|
|
|
+ <if test="usedLife != null">used_life,</if>
|
|
|
<if test="remark != null">remark,</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>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="hardwareCode != null and hardwareCode != ''">#{hardwareCode},</if>
|
|
|
<if test="hardwareName != null and hardwareName != ''">#{hardwareName},</if>
|
|
|
@@ -84,13 +99,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="workshopCode != null">#{workshopCode},</if>
|
|
|
<if test="workshopName != null">#{workshopName},</if>
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
|
+ <if test="activationTime != null">#{activationTime},</if>
|
|
|
+ <if test="availableTimes != null">#{availableTimes},</if>
|
|
|
+ <if test="usedTimes != null">#{usedTimes},</if>
|
|
|
+ <if test="availableLife != null">#{availableLife},</if>
|
|
|
+ <if test="usedLife != null">#{usedLife},</if>
|
|
|
<if test="remark != null">#{remark},</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>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateIsHardware" parameterType="IsHardware">
|
|
|
@@ -107,6 +127,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="workshopCode != null">workshop_code = #{workshopCode},</if>
|
|
|
<if test="workshopName != null">workshop_name = #{workshopName},</if>
|
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
|
+ <if test="activationTime != null">activation_time = #{activationTime},</if>
|
|
|
+ <if test="availableTimes != null">available_times = #{availableTimes},</if>
|
|
|
+ <if test="usedTimes != null">used_times = #{usedTimes},</if>
|
|
|
+ <if test="availableLife != null">available_life = #{availableLife},</if>
|
|
|
+ <if test="usedLife != null">used_life = #{usedLife},</if>
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
@@ -122,9 +147,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteIsHardwareByIds" parameterType="String">
|
|
|
- delete from is_hardware where id in
|
|
|
+ delete from is_hardware where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-</mapper>
|
|
|
+</mapper>
|