123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.asset.mapper.TbFaultReportMapper">
-
- <resultMap type="TbFaultReport" id="TbFaultReportResult">
- <result property="id" column="id" />
- <result property="assetBarCode" column="asset_bar_code" />
- <result property="userId" column="user_id" />
- <result property="reportDate" column="report_date" />
- <result property="faultPhenomenon" column="fault_phenomenon" />
- <result property="tel" column="tel" />
- <result property="processState" column="process_state" />
- <result property="processResult" column="process_result" />
- </resultMap>
- <sql id="selectTbFaultReportVo">
- select id, asset_bar_code, user_id, report_date, fault_phenomenon, tel, process_state, process_result from tb_fault_report
- </sql>
- <select id="selectTbFaultReportList" parameterType="TbFaultReport" resultMap="TbFaultReportResult">
- <include refid="selectTbFaultReportVo"/>
- <where>
- <if test="assetBarCode != null and assetBarCode != ''"> and asset_bar_code = #{assetBarCode}</if>
- <if test="userId != null "> and user_id = #{userId}</if>
- <if test="reportDate != null "> and report_date = #{reportDate}</if>
- <if test="faultPhenomenon != null and faultPhenomenon != ''"> and fault_phenomenon = #{faultPhenomenon}</if>
- <if test="processState != null "> and process_state = #{processState}</if>
- </where>
- </select>
-
- <select id="selectTbFaultReportById" parameterType="Long" resultMap="TbFaultReportResult">
- <include refid="selectTbFaultReportVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertTbFaultReport" parameterType="TbFaultReport" useGeneratedKeys="true" keyProperty="id">
- insert into tb_fault_report
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="assetBarCode != null and assetBarCode != ''">asset_bar_code,</if>
- <if test="userId != null">user_id,</if>
- <if test="reportDate != null">report_date,</if>
- <if test="faultPhenomenon != null and faultPhenomenon != ''">fault_phenomenon,</if>
- <if test="tel != null and tel != ''">tel,</if>
- <if test="processState != null">process_state,</if>
- <if test="processResult != null">process_result,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="assetBarCode != null and assetBarCode != ''">#{assetBarCode},</if>
- <if test="userId != null">#{userId},</if>
- <if test="reportDate != null">#{reportDate},</if>
- <if test="faultPhenomenon != null and faultPhenomenon != ''">#{faultPhenomenon},</if>
- <if test="tel != null and tel != ''">#{tel},</if>
- <if test="processState != null">#{processState},</if>
- <if test="processResult != null">#{processResult},</if>
- </trim>
- </insert>
- <update id="updateTbFaultReport" parameterType="TbFaultReport">
- update tb_fault_report
- <trim prefix="SET" suffixOverrides=",">
- <if test="assetBarCode != null and assetBarCode != ''">asset_bar_code = #{assetBarCode},</if>
- <if test="userId != null">user_id = #{userId},</if>
- <if test="reportDate != null">report_date = #{reportDate},</if>
- <if test="faultPhenomenon != null and faultPhenomenon != ''">fault_phenomenon = #{faultPhenomenon},</if>
- <if test="tel != null and tel != ''">tel = #{tel},</if>
- <if test="processState != null">process_state = #{processState},</if>
- <if test="processResult != null">process_result = #{processResult},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteTbFaultReportById" parameterType="Long">
- delete from tb_fault_report where id = #{id}
- </delete>
- <delete id="deleteTbFaultReportByIds" parameterType="String">
- delete from tb_fault_report where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|