<?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.mapper.AutomobileEnterpriseMapper"> <resultMap type="com.ruoyi.domain.AutomobileEnterprise" id="AutomobileEnterpriseResult"> <result property="id" column="id"/> <result property="enterpriseName" column="enterprise_name"/> <result property="address" column="address"/> <result property="postcode" column="postcode"/> <result property="enterpriseContact" column="enterprise_contact"/> <result property="contactNumber" column="contact_number"/> <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="deleted" column="deleted"/> </resultMap> <sql id="selectAutomobileEnterpriseVo"> select id, enterprise_name, address, postcode, enterprise_contact, contact_number, create_by, create_time, update_by, update_time, deleted from t_automobile_enterprise </sql> <select id="selectAutomobileEnterpriseList" parameterType="com.ruoyi.domain.AutomobileEnterprise" resultMap="AutomobileEnterpriseResult"> <include refid="selectAutomobileEnterpriseVo"/> <where> deleted = 0 <if test="enterpriseName != null and enterpriseName != ''">and enterprise_name like concat('%', #{enterpriseName}, '%') </if> <if test="address != null and address != ''">and address like concat('%', #{address}, '%')</if> <if test="postcode != null and postcode != ''">and postcode like concat('%', #{postcode}, '%')</if> <if test="enterpriseContact != null and enterpriseContact != ''"> and enterprise_contact like concat('%', #{enterpriseContact}, '%') </if> <if test="contactNumber != null and contactNumber != ''">and contact_number like concat('%', #{contactNumber}, '%')</if> </where> </select> <select id="selectAutomobileEnterpriseById" parameterType="Long" resultMap="AutomobileEnterpriseResult"> <include refid="selectAutomobileEnterpriseVo"/> where id = #{id} </select> <insert id="insertAutomobileEnterprise" parameterType="com.ruoyi.domain.AutomobileEnterprise"> insert into t_automobile_enterprise <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> <if test="enterpriseName != null">enterprise_name,</if> <if test="address != null">address,</if> <if test="postcode != null">postcode,</if> <if test="enterpriseContact != null">enterprise_contact,</if> <if test="contactNumber != null">contact_number,</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> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if> <if test="enterpriseName != null">#{enterpriseName},</if> <if test="address != null">#{address},</if> <if test="postcode != null">#{postcode},</if> <if test="enterpriseContact != null">#{enterpriseContact},</if> <if test="contactNumber != null">#{contactNumber},</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> </trim> </insert> <update id="updateAutomobileEnterprise" parameterType="com.ruoyi.domain.AutomobileEnterprise"> update t_automobile_enterprise <trim prefix="SET" suffixOverrides=","> <if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if> <if test="address != null">address = #{address},</if> <if test="postcode != null">postcode = #{postcode},</if> <if test="enterpriseContact != null">enterprise_contact = #{enterpriseContact},</if> <if test="contactNumber != null">contact_number = #{contactNumber},</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> </trim> where id = #{id} </update> </mapper>