<?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.thhy.pm.modules.biz.projectinfo.mapper.ProInfoFileMapper">
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
t.id as id,
|
t.pro_info_id as proInfoId,
|
t.pro_info_file as proInfoFile
|
</sql>
|
|
<sql id="condition_query">
|
<where>
|
<trim suffixOverrides=" AND ">
|
<if test="proInfoId!=null and proInfoId!=''">
|
t.pro_info_id = #{proInfoId} AND
|
</if>
|
<if test="proInfoFile!=null and proInfoFile!=''">
|
t.pro_info_file = #{proInfoFile} AND
|
</if>
|
</trim>
|
</where>
|
</sql>
|
|
<select id="queryById" resultType="com.thhy.pm.modules.biz.projectinfo.entity.ProInfoFile">
|
select <include refid="Base_Column_List" />
|
from sys_pro_info_file t
|
where t.id=#{id}
|
</select>
|
|
<select id="queryVersionById" resultType="integer">
|
select version from sys_pro_info_file
|
where id=#{id}
|
</select>
|
|
<!--查询列表-->
|
<select id="findList" resultType="com.thhy.pm.modules.biz.projectinfo.entity.ProInfoFileListVo">
|
SELECT
|
<include refid="Base_Column_List" />
|
from sys_pro_info_file t
|
where t.pro_info_id = #{proInfoId}
|
</select>
|
|
<!--查询列表-->
|
<select id="findAll" resultType="com.thhy.pm.modules.biz.projectinfo.entity.ProInfoFile">
|
SELECT
|
<include refid="Base_Column_List" />
|
from sys_pro_info_file t
|
</select>
|
|
<!--插入操作-->
|
<insert id="insert">
|
insert into sys_pro_info_file
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null">
|
id,
|
</if>
|
<if test="proInfoId != null">
|
pro_info_id,
|
</if>
|
<if test="proInfoFile != null">
|
pro_info_file,
|
</if>
|
<if test="proInfoFileName != null">
|
pro_info_file_name,
|
</if>
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null">
|
#{id},
|
</if>
|
<if test="proInfoId != null">
|
#{proInfoId},
|
</if>
|
<if test="proInfoFile != null">
|
#{proInfoFile},
|
</if>
|
<if test="proInfoFileName != null">
|
#{proInfoFileName},
|
</if>
|
</trim>
|
</insert>
|
|
|
<!--更新操作-->
|
<update id="update">
|
update sys_pro_info_file
|
<set>
|
<if test="proInfoId != null">
|
pro_info_id=#{proInfoId},
|
</if>
|
<if test="proInfoFile != null">
|
pro_info_file=#{proInfoFile},
|
</if>
|
</set>
|
where id=#{id}
|
</update>
|
|
<!--逻辑删除-->
|
<update id="deletelogic">
|
update sys_pro_info_file
|
SET is_use = 0
|
where id=#{id}
|
</update>
|
|
<!--根据ID删除-->
|
<delete id="deleteById">
|
delete from sys_pro_info_file
|
where id=#{id}
|
</delete>
|
|
<delete id="deleteByProId">
|
delete from sys_pro_info_file
|
where pro_info_id=#{proInfoId}
|
</delete>
|
|
</mapper>
|