<?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.dc.emergencyExpert.mapper.EmergencyExpertMapper">
|
|
<resultMap type="com.ruoyi.project.dc.emergencyExpert.domain.EmergencyExpert" id="EmergencyExpertResult">
|
<result property="emergencyExpertId" column="emergency_expert_id" />
|
<result property="companyId" column="company_id"/>
|
<result property="createBy" column="create_by" />
|
<result property="createUserId" column="create_user_id" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateUserId" column="update_user_id" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
<result property="expertUnit" column="expert_unit" />
|
<result property="expertName" column="expert_name" />
|
<result property="expertPhone" column="expert_phone" />
|
<result property="expertExpertise" column="expert_expertise" />
|
</resultMap>
|
|
<sql id="selectEmergencyExpertVo">
|
select emergency_expert_id, company_id, create_by, create_user_id, create_time, update_by, update_user_id, update_time, remark, expert_unit, expert_name, expert_phone, expert_expertise from dc_emergency_expert
|
</sql>
|
|
<select id="selectEmergencyExpertList" parameterType="EmergencyExpert" resultMap="EmergencyExpertResult">
|
<include refid="selectEmergencyExpertVo"/>
|
<where>
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
<if test="createUserId != null "> and create_user_id = #{createUserId}</if>
|
<if test="updateUserId != null "> and update_user_id = #{updateUserId}</if>
|
<if test="expertUnit != null and expertUnit != ''"> and expert_unit = #{expertUnit}</if>
|
<if test="expertName != null and expertName != ''"> and expert_name like concat('%', #{expertName}, '%')</if>
|
<if test="expertPhone != null and expertPhone != ''"> and expert_phone = #{expertPhone}</if>
|
<if test="expertExpertise != null and expertExpertise != ''"> and expert_expertise = #{expertExpertise}</if>
|
</where>
|
</select>
|
|
<select id="selectEmergencyExpertById" parameterType="Long" resultMap="EmergencyExpertResult">
|
<include refid="selectEmergencyExpertVo"/>
|
where emergency_expert_id = #{emergencyExpertId}
|
</select>
|
|
<insert id="insertEmergencyExpert" parameterType="EmergencyExpert" useGeneratedKeys="true" keyProperty="emergencyExpertId">
|
insert into dc_emergency_expert
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="companyId != null ">company_id,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createUserId != null ">create_user_id,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
<if test="updateUserId != null ">update_user_id,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
<if test="expertUnit != null and expertUnit != ''">expert_unit,</if>
|
<if test="expertName != null and expertName != ''">expert_name,</if>
|
<if test="expertPhone != null and expertPhone != ''">expert_phone,</if>
|
<if test="expertExpertise != null and expertExpertise != ''">expert_expertise,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="companyId != null ">#{companyId},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createUserId != null ">#{createUserId},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
<if test="updateUserId != null ">#{updateUserId},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="expertUnit != null and expertUnit != ''">#{expertUnit},</if>
|
<if test="expertName != null and expertName != ''">#{expertName},</if>
|
<if test="expertPhone != null and expertPhone != ''">#{expertPhone},</if>
|
<if test="expertExpertise != null and expertExpertise != ''">#{expertExpertise},</if>
|
</trim>
|
</insert>
|
|
<update id="updateEmergencyExpert" parameterType="EmergencyExpert">
|
update dc_emergency_expert
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="companyId != null ">company_id = #{companyId},</if>
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="createUserId != null ">create_user_id = #{createUserId},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateUserId != null ">update_user_id = #{updateUserId},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="expertUnit != null and expertUnit != ''">expert_unit = #{expertUnit},</if>
|
<if test="expertName != null and expertName != ''">expert_name = #{expertName},</if>
|
<if test="expertPhone != null and expertPhone != ''">expert_phone = #{expertPhone},</if>
|
<if test="expertExpertise != null and expertExpertise != ''">expert_expertise = #{expertExpertise},</if>
|
</trim>
|
where emergency_expert_id = #{emergencyExpertId}
|
</update>
|
|
<delete id="deleteEmergencyExpertById" parameterType="Long">
|
delete from dc_emergency_expert where emergency_expert_id = #{emergencyExpertId}
|
</delete>
|
|
<delete id="deleteEmergencyExpertByIds" parameterType="String">
|
delete from dc_emergency_expert where emergency_expert_id in
|
<foreach item="emergencyExpertId" collection="array" open="(" separator="," close=")">
|
#{emergencyExpertId}
|
</foreach>
|
</delete>
|
|
</mapper>
|