141 lines
7.4 KiB
XML
141 lines
7.4 KiB
XML
<?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.muyu.server.mapper.SysCarFaultMapper">
|
|
|
|
<resultMap type="com.muyu.common.domain.SysCarFault" id="SysCarFaultResult">
|
|
<result property="id" column="id" />
|
|
<result property="faultCode" column="fault_code" />
|
|
<result property="faultName" column="fault_name" />
|
|
<result property="typeId" column="type_id" />
|
|
<result property="faultLabel" column="fault_label" />
|
|
<result property="faultBit" column="fault_bit" />
|
|
<result property="faultValue" column="fault_value" />
|
|
<result property="faultRank" column="fault_rank" />
|
|
<result property="faultDesc" column="fault_desc" />
|
|
<result property="faultMinThreshold" column="fault_min_threshold" />
|
|
<result property="faultMaxThreshold" column="fault_max_threshold" />
|
|
<result property="status" column="status" />
|
|
<result property="warnStatus" column="warn_status" />
|
|
<result property="remark" column="remark" />
|
|
<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="carTypeId" column="car_type_id"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectSysCarFaultVo">
|
|
select id, fault_code, fault_name, type_id, fault_label, fault_bit, fault_value, fault_rank, fault_desc, fault_min_threshold, fault_max_threshold, status, warn_status, remark, create_by, create_time, update_by, update_time,car_type_id from sys_car_fault
|
|
</sql>
|
|
|
|
<select id="selectSysCarFaultList" parameterType="com.muyu.common.domain.SysCarFault" resultMap="SysCarFaultResult">
|
|
<include refid="selectSysCarFaultVo"/>
|
|
<where>
|
|
<if test="faultCode != null and faultCode != ''"> and fault_code = #{faultCode}</if>
|
|
<if test="faultBit != null and faultBit != ''"> and fault_bit = #{faultBit}</if>
|
|
<if test="faultRank != null "> and fault_rank = #{faultRank}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectSysCarFaultById" parameterType="Long" resultMap="SysCarFaultResult">
|
|
<include refid="selectSysCarFaultVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
<select id="selectSysCarFaultIds" resultMap="SysCarFaultResult">
|
|
<include refid="selectSysCarFaultVo"/>
|
|
where id in
|
|
<foreach collection="array" item="id" index="index" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</select>
|
|
|
|
<insert id="insertSysCarFault" parameterType="com.muyu.common.domain.SysCarFault" useGeneratedKeys="true" keyProperty="id">
|
|
insert into sys_car_fault
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="faultCode != null and faultCode != ''">fault_code,</if>
|
|
<if test="faultName != null">fault_name,</if>
|
|
<if test="typeId != null">type_id,</if>
|
|
<if test="faultLabel != null">fault_label,</if>
|
|
<if test="faultBit != null">fault_bit,</if>
|
|
<if test="faultValue != null">fault_value,</if>
|
|
<if test="faultRank != null">fault_rank,</if>
|
|
<if test="faultDesc != null">fault_desc,</if>
|
|
<if test="faultMinThreshold != null">fault_min_threshold,</if>
|
|
<if test="faultMaxThreshold != null">fault_max_threshold,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="warnStatus != null">warn_status,</if>
|
|
<if test="remark != null">remark,</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="carTypeId !=null">car_type_id</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="faultCode != null and faultCode != ''">#{faultCode},</if>
|
|
<if test="faultName != null">#{faultName},</if>
|
|
<if test="typeId != null">#{typeId},</if>
|
|
<if test="faultLabel != null">#{faultLabel},</if>
|
|
<if test="faultBit != null">#{faultBit},</if>
|
|
<if test="faultValue != null">#{faultValue},</if>
|
|
<if test="faultRank != null">#{faultRank},</if>
|
|
<if test="faultDesc != null">#{faultDesc},</if>
|
|
<if test="faultMinThreshold != null">#{faultMinThreshold},</if>
|
|
<if test="faultMaxThreshold != null">#{faultMaxThreshold},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="warnStatus != null">#{warnStatus},</if>
|
|
<if test="remark != null">#{remark},</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="carTypeId != null">#{catTypeId}</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSysCarFault" parameterType="com.muyu.common.domain.SysCarFault">
|
|
update sys_car_fault
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="faultCode != null and faultCode != ''">fault_code = #{faultCode},</if>
|
|
<if test="faultName != null">fault_name = #{faultName},</if>
|
|
<if test="typeId != null">type_id = #{typeId},</if>
|
|
<if test="faultLabel != null">fault_label = #{faultLabel},</if>
|
|
<if test="faultBit != null">fault_bit = #{faultBit},</if>
|
|
<if test="faultValue != null">fault_value = #{faultValue},</if>
|
|
<if test="faultRank != null">fault_rank = #{faultRank},</if>
|
|
<if test="faultDesc != null">fault_desc = #{faultDesc},</if>
|
|
<if test="faultMinThreshold != null">fault_min_threshold = #{faultMinThreshold},</if>
|
|
<if test="faultMaxThreshold != null">fault_max_threshold = #{faultMaxThreshold},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="warnStatus != null">warn_status = #{warnStatus},</if>
|
|
<if test="remark != null">remark = #{remark},</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="carTypeId !=null">car_type_id=#{catTypeId}</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteSysCarFaultById" parameterType="Long">
|
|
delete from sys_car_fault where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteSysCarFaultByIds" parameterType="String">
|
|
delete from sys_car_fault where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<update id="enableWarningsById" parameterType="Long">
|
|
update sys_car_fault set warn_status = 0 where id = #{id}
|
|
</update>
|
|
<update id="disableWarningsById" parameterType="Long">
|
|
update sys_car_fault set warn_status = 1 where id = #{id}
|
|
</update>
|
|
</mapper>
|