项目管理crud
This commit is contained in:
@ -0,0 +1,143 @@
|
||||
<?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.fastbee.project.mapper.ProjectMapper">
|
||||
|
||||
<resultMap type="Project" id="ProjectResult">
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="project_name" />
|
||||
<result property="sysShowName" column="sys_show_name" />
|
||||
<result property="centralCoordinates" column="central_coordinates" />
|
||||
<result property="scope" column="scope" />
|
||||
<result property="administrativeArea" column="administrative_area" />
|
||||
<result property="owner" column="owner" />
|
||||
<result property="logo" column="logo" />
|
||||
<result property="image" column="image" />
|
||||
<result property="videoIntroduction" column="video_introduction" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="pParams" column="p_params" />
|
||||
<result property="introduce" column="introduce" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remarks" column="remarks" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProjectVo">
|
||||
select project_id, project_name, sys_show_name, central_coordinates, scope, administrative_area, owner, logo, image, video_introduction, remark, p_params, introduce, del_flag, create_time, create_by, update_time, remarks, tenant_id, tenant_name from project
|
||||
</sql>
|
||||
|
||||
<select id="selectProjectList" parameterType="Project" resultMap="ProjectResult">
|
||||
<include refid="selectProjectVo"/>
|
||||
<where>
|
||||
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="sysShowName != null and sysShowName != ''"> and sys_show_name like concat('%', #{sysShowName}, '%')</if>
|
||||
<if test="centralCoordinates != null and centralCoordinates != ''"> and central_coordinates = #{centralCoordinates}</if>
|
||||
<if test="scope != null and scope != ''"> and scope = #{scope}</if>
|
||||
<if test="administrativeArea != null and administrativeArea != ''"> and administrative_area = #{administrativeArea}</if>
|
||||
<if test="owner != null and owner != ''"> and owner = #{owner}</if>
|
||||
<if test="logo != null and logo != ''"> and logo = #{logo}</if>
|
||||
<if test="image != null and image != ''"> and image = #{image}</if>
|
||||
<if test="videoIntroduction != null and videoIntroduction != ''"> and video_introduction = #{videoIntroduction}</if>
|
||||
<if test="pParams != null and pParams != ''"> and p_params = #{pParams}</if>
|
||||
<if test="introduce != null and introduce != ''"> and introduce = #{introduce}</if>
|
||||
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
|
||||
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
|
||||
<if test="tenantName != null and tenantName != ''"> and tenant_name like concat('%', #{tenantName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProjectByProjectId" parameterType="Long" resultMap="ProjectResult">
|
||||
<include refid="selectProjectVo"/>
|
||||
where project_id = #{projectId}
|
||||
</select>
|
||||
|
||||
<insert id="insertProject" parameterType="Project">
|
||||
insert into project
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="projectName != null and projectName != ''">project_name,</if>
|
||||
<if test="sysShowName != null and sysShowName != ''">sys_show_name,</if>
|
||||
<if test="centralCoordinates != null and centralCoordinates != ''">central_coordinates,</if>
|
||||
<if test="scope != null and scope != ''">scope,</if>
|
||||
<if test="administrativeArea != null and administrativeArea != ''">administrative_area,</if>
|
||||
<if test="owner != null and owner != ''">owner,</if>
|
||||
<if test="logo != null and logo != ''">logo,</if>
|
||||
<if test="image != null and image != ''">image,</if>
|
||||
<if test="videoIntroduction != null and videoIntroduction != ''">video_introduction,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="pParams != null and pParams != ''">p_params,</if>
|
||||
<if test="introduce != null">introduce,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remarks != null">remarks,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="tenantName != null">tenant_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="projectName != null and projectName != ''">#{projectName},</if>
|
||||
<if test="sysShowName != null and sysShowName != ''">#{sysShowName},</if>
|
||||
<if test="centralCoordinates != null and centralCoordinates != ''">#{centralCoordinates},</if>
|
||||
<if test="scope != null and scope != ''">#{scope},</if>
|
||||
<if test="administrativeArea != null and administrativeArea != ''">#{administrativeArea},</if>
|
||||
<if test="owner != null and owner != ''">#{owner},</if>
|
||||
<if test="logo != null and logo != ''">#{logo},</if>
|
||||
<if test="image != null and image != ''">#{image},</if>
|
||||
<if test="videoIntroduction != null and videoIntroduction != ''">#{videoIntroduction},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="pParams != null and pParams != ''">#{pParams},</if>
|
||||
<if test="introduce != null">#{introduce},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remarks != null">#{remarks},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="tenantName != null">#{tenantName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProject" parameterType="Project">
|
||||
update project
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="projectName != null and projectName != ''">project_name = #{projectName},</if>
|
||||
<if test="sysShowName != null and sysShowName != ''">sys_show_name = #{sysShowName},</if>
|
||||
<if test="centralCoordinates != null and centralCoordinates != ''">central_coordinates = #{centralCoordinates},</if>
|
||||
<if test="scope != null and scope != ''">scope = #{scope},</if>
|
||||
<if test="administrativeArea != null and administrativeArea != ''">administrative_area = #{administrativeArea},</if>
|
||||
<if test="owner != null and owner != ''">owner = #{owner},</if>
|
||||
<if test="logo != null and logo != ''">logo = #{logo},</if>
|
||||
<if test="image != null and image != ''">image = #{image},</if>
|
||||
<if test="videoIntroduction != null and videoIntroduction != ''">video_introduction = #{videoIntroduction},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="pParams != null and pParams != ''">p_params = #{pParams},</if>
|
||||
<if test="introduce != null">introduce = #{introduce},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remarks != null">remarks = #{remarks},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="tenantName != null">tenant_name = #{tenantName},</if>
|
||||
</trim>
|
||||
where project_id = #{projectId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProjectByProjectId" parameterType="Long">
|
||||
delete from project where project_id = #{projectId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProjectByProjectIds" parameterType="String">
|
||||
delete from project where project_id in
|
||||
<foreach item="projectId" collection="array" open="(" separator="," close=")">
|
||||
#{projectId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Reference in New Issue
Block a user