<?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.javaweb.platform.mapper.ProjectApplyMapper">
|
|
<resultMap type="ProjectApply" id="ProjectApplyResult">
|
<result property="id" column="id" />
|
<result property="projectName" column="project_name" />
|
<result property="contacts" column="contacts" />
|
<result property="tel" column="tel" />
|
<result property="email" column="email" />
|
<result property="remark" column="remark" />
|
<result property="applyType" column="apply_type" />
|
<result property="resource" column="resource" />
|
<result property="createTime" column="create_time" />
|
<result property="createBy" column="create_by" />
|
<result property="status" column="status" />
|
<result property="url" column="url" />
|
<result property="onProjectName" column="on_project_name" />
|
<result property="onProjectAddr" column="on_project_addr" />
|
<result property="onProjectDept" column="on_project_dept" />
|
<result property="files" column="files" />
|
</resultMap>
|
|
<sql id="selectProjectApplyVo">
|
select id, project_name, contacts, tel, email, remark, apply_type, resource, create_time, create_by,
|
status, url,on_project_name ,on_project_addr,on_project_dept,files from js_project_apply
|
</sql>
|
|
<select id="selectProjectApplyList" parameterType="ProjectApply" resultMap="ProjectApplyResult">
|
<include refid="selectProjectApplyVo"/>
|
<where>
|
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
|
<if test="contacts != null and contacts != ''"> and contacts = #{contacts}</if>
|
<if test="tel != null and tel != ''"> and tel = #{tel}</if>
|
<if test="email != null and email != ''"> and email = #{email}</if>
|
<if test="applyType != null and applyType != ''"> and apply_type = #{applyType}</if>
|
<if test="resource != null and resource != ''"> and resource = #{resource}</if>
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="url != null and url != ''"> and url = #{url}</if>
|
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
|
<if test="onProjectName != null and onProjectName != ''"> and on_project_name like concat('%', #{onProjectName}, '%')</if>
|
</where>
|
</select>
|
|
<select id="selectProjectApplyById" parameterType="String" resultMap="ProjectApplyResult">
|
<include refid="selectProjectApplyVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertProjectApply" parameterType="ProjectApply">
|
insert into js_project_apply
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null and id != ''">id,</if>
|
<if test="projectName != null and projectName != ''">project_name,</if>
|
<if test="contacts != null and contacts != ''">contacts,</if>
|
<if test="tel != null and tel != ''">tel,</if>
|
<if test="email != null and email != ''">email,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
<if test="applyType != null and applyType != ''">apply_type,</if>
|
<if test="resource != null and resource != ''">resource,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="status != null and status != ''">status,</if>
|
<if test="url != null and url != ''">url,</if>
|
<if test="onProjectName != null and onProjectName != ''">on_project_name,</if>
|
<if test="onProjectAddr != null and onProjectAddr != ''">on_project_addr,</if>
|
<if test="onProjectDept != null and onProjectDept != ''">on_project_dept,</if>
|
<if test="files != null and files != ''">files,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null and id != ''">#{id},</if>
|
<if test="projectName != null and projectName != ''">#{projectName},</if>
|
<if test="contacts != null and contacts != ''">#{contacts},</if>
|
<if test="tel != null and tel != ''">#{tel},</if>
|
<if test="email != null and email != ''">#{email},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="applyType != null and applyType != ''">#{applyType},</if>
|
<if test="resource != null and resource != ''">#{resource},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
<if test="url != null and url != ''">#{url},</if>
|
<if test="onProjectName != null and onProjectName != ''">#{onProjectName},</if>
|
<if test="onProjectAddr != null and onProjectAddr != ''">#{onProjectAddr},</if>
|
<if test="onProjectDept != null and onProjectDept != ''">#{onProjectDept},</if>
|
<if test="files != null and files != ''">#{files},</if>
|
</trim>
|
</insert>
|
|
<update id="updateProjectApply" parameterType="ProjectApply">
|
update js_project_apply
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="projectName != null and projectName != ''">project_name = #{projectName},</if>
|
<if test="contacts != null and contacts != ''">contacts = #{contacts},</if>
|
<if test="tel != null and tel != ''">tel = #{tel},</if>
|
<if test="email != null and email != ''">email = #{email},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="applyType != null and applyType != ''">apply_type = #{applyType},</if>
|
<if test="resource != null and resource != ''">resource = #{resource},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="url != null and url != ''">url = #{url},</if>
|
<if test="onProjectName != null and onProjectName != ''">on_project_name = #{onProjectName},</if>
|
<if test="onProjectAddr != null and onProjectAddr != ''">on_project_addr = #{onProjectAddr},</if>
|
<if test="onProjectDept != null and onProjectDept != ''">on_project_dept = #{onProjectDept},</if>
|
<if test="files != null and files != ''">files = #{files},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteProjectApplyById" parameterType="String">
|
delete from js_project_apply where id = #{id}
|
</delete>
|
|
<delete id="deleteProjectApplyByIds" parameterType="String">
|
delete from js_project_apply where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|