<?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.dingzhuo.energy.basic.data.energy.mapper.EnergyProjectAnnexMapper">
|
|
<resultMap type="EnergyProjectAnnex" id="EnergyProjectAnnexResult">
|
<result property="id" column="id" />
|
<result property="projectId" column="project_id" />
|
<result property="fileName" column="file_name" />
|
<result property="fileSuffix" column="file_suffix" />
|
<result property="filePath" column="file_path" />
|
<result property="delFlage" column="del_flage" />
|
<result property="createTime" column="create_time" />
|
<result property="createOperator" column="create_operator" />
|
<result property="updateTime" column="update_time" />
|
<result property="updateOperator" column="update_operator" />
|
</resultMap>
|
|
<sql id="selectEnergyProjectAnnexVo">
|
select id, project_id, file_name, file_suffix, file_path, del_flage, create_time, create_operator, update_time, update_operator from energy_project_annex
|
</sql>
|
|
<select id="selectEnergyProjectAnnexList" parameterType="EnergyProjectAnnex" resultMap="EnergyProjectAnnexResult">
|
<include refid="selectEnergyProjectAnnexVo"/>
|
<where>
|
<if test="projectId != null and projectId != ''"> and project_id=#{projectId}</if>
|
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
<if test="fileSuffix != null and fileSuffix != ''"> and file_suffix like concat('%', #{fileSuffix}, '%')</if>
|
<if test="filePath != null and filePath != ''"> and file_path like concat('%', #{filePath}, '%')</if>
|
<if test="delFlage != null and delFlage != ''"> and del_flage like concat('%', #{delFlage}, '%')</if>
|
<if test="createOperator != null and createOperator != ''"> and create_operator like concat('%', #{createOperator}, '%')</if>
|
<if test="updateOperator != null and updateOperator != ''"> and update_operator like concat('%', #{updateOperator}, '%')</if>
|
</where>
|
</select>
|
|
<select id="selectEnergyProjectAnnexById" parameterType="String" resultMap="EnergyProjectAnnexResult">
|
<include refid="selectEnergyProjectAnnexVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertEnergyProjectAnnex" parameterType="EnergyProjectAnnex">
|
insert into energy_project_annex
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null and id != ''">id,</if>
|
<if test="projectId != null and projectId != ''">project_id,</if>
|
<if test="fileName != null and fileName != ''">file_name,</if>
|
<if test="fileSuffix != null and fileSuffix != ''">file_suffix,</if>
|
<if test="filePath != null and filePath != ''">file_path,</if>
|
<if test="delFlage != null and delFlage != ''">del_flage,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="createOperator != null and createOperator != ''">create_operator,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="updateOperator != null and updateOperator != ''">update_operator,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null and id != ''">#{id},</if>
|
<if test="projectId != null and projectId != ''">#{projectId},</if>
|
<if test="fileName != null and fileName != ''">#{fileName},</if>
|
<if test="fileSuffix != null and fileSuffix != ''">#{fileSuffix},</if>
|
<if test="filePath != null and filePath != ''">#{filePath},</if>
|
<if test="delFlage != null and delFlage != ''">#{delFlage},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="createOperator != null and createOperator != ''">#{createOperator},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="updateOperator != null and updateOperator != ''">#{updateOperator},</if>
|
</trim>
|
</insert>
|
|
<update id="updateEnergyProjectAnnex" parameterType="EnergyProjectAnnex">
|
update energy_project_annex
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="projectId != null and projectId != ''">project_id = #{projectId},</if>
|
<if test="fileName != null and fileName != ''">file_name = #{fileName},</if>
|
<if test="fileSuffix != null and fileSuffix != ''">file_suffix = #{fileSuffix},</if>
|
<if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
|
<if test="delFlage != null and delFlage != ''">del_flage = #{delFlage},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="createOperator != null and createOperator != ''">create_operator = #{createOperator},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="updateOperator != null and updateOperator != ''">update_operator = #{updateOperator},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteEnergyProjectAnnexById" parameterType="String">
|
delete from energy_project_annex where id = #{id}
|
</delete>
|
|
<delete id="deleteEnergyProjectAnnexByIds" parameterType="String">
|
delete from energy_project_annex where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|