<?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.project.tr.troubleshootType.mapper.TroubleshootTypeMapper">
|
|
<resultMap type="TroubleshootType" id="TroubleshootTypeResult">
|
<result property="typeId" column="type_id" />
|
<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" />
|
<result property="typeName" column="type_name" />
|
<result property="typeCycleNum" column="type_cycle_num" />
|
<result property="typeCycleType" column="type_cycle_type" />
|
<result property="companyId" column="company_id" />
|
</resultMap>
|
|
<sql id="selectTroubleshootTypeVo">
|
select type_id, create_by, create_time, update_by, update_time, remark, type_name, type_cycle_num, type_cycle_type, company_id from tr_troubleshoot_type
|
</sql>
|
|
<select id="selectTroubleshootTypeList" parameterType="TroubleshootType" resultMap="TroubleshootTypeResult">
|
<include refid="selectTroubleshootTypeVo"/>
|
<where>
|
<if test="typeId != null "> and type_id = #{typeId}</if>
|
<if test="createBy != null and createBy != ''"> and create_by like concat('%', #{createBy}, '%')</if>
|
<if test="beginCreateTime != null "> and create_time >= #{beginCreateTime}</if>
|
<if test="endCreateTime != null "> and create_time <= #{endCreateTime}</if>
|
<if test="typeName != null and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
|
<if test="typeCycleNum != null "> and type_cycle_num = #{typeCycleNum}</if>
|
<if test="typeCycleType != null "> and type_cycle_type = #{typeCycleType}</if>
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
</where>
|
</select>
|
|
<select id="selectTroubleshootTypeById" parameterType="Long" resultMap="TroubleshootTypeResult">
|
<include refid="selectTroubleshootTypeVo"/>
|
where type_id = #{typeId}
|
</select>
|
|
<insert id="insertTroubleshootType" parameterType="TroubleshootType">
|
insert into tr_troubleshoot_type
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="typeId != null ">type_id,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
<if test="typeName != null and typeName != ''">type_name,</if>
|
<if test="typeCycleNum != null ">type_cycle_num,</if>
|
<if test="typeCycleType != null ">type_cycle_type,</if>
|
<if test="companyId != null ">company_id,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="typeId != null ">#{typeId},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="typeName != null and typeName != ''">#{typeName},</if>
|
<if test="typeCycleNum != null ">#{typeCycleNum},</if>
|
<if test="typeCycleType != null ">#{typeCycleType},</if>
|
<if test="companyId != null ">#{companyId},</if>
|
</trim>
|
</insert>
|
|
<update id="updateTroubleshootType" parameterType="TroubleshootType">
|
update tr_troubleshoot_type
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
|
<if test="typeCycleNum != null ">type_cycle_num = #{typeCycleNum},</if>
|
<if test="typeCycleType != null ">type_cycle_type = #{typeCycleType},</if>
|
<if test="companyId != null ">company_id = #{companyId},</if>
|
</trim>
|
where type_id = #{typeId}
|
</update>
|
|
<delete id="deleteTroubleshootTypeById" parameterType="Long">
|
delete from tr_troubleshoot_type where type_id = #{typeId}
|
</delete>
|
|
<delete id="deleteTroubleshootTypeByIds" parameterType="String">
|
delete from tr_troubleshoot_type where type_id in
|
<foreach item="typeId" collection="array" open="(" separator="," close=")">
|
#{typeId}
|
</foreach>
|
</delete>
|
|
</mapper>
|