2026-05-21 21:33:04 +08:00
|
|
|
<?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.generator.mapper.front.FrontProjectMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="FrontProject" id="FrontProjectResult">
|
|
|
|
|
<id property="projectId" column="project_id" />
|
|
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
|
<result property="projectName" column="project_name" />
|
|
|
|
|
<result property="projectFileName" column="project_file_name" />
|
|
|
|
|
<result property="packageName" column="package_name" />
|
|
|
|
|
<result property="version" column="version" />
|
|
|
|
|
<result property="projectDesc" column="project_desc" />
|
|
|
|
|
<result property="industryTemplate" column="industry_template" />
|
|
|
|
|
<result property="frontFramework" column="front_framework" />
|
|
|
|
|
<result property="backFramework" column="back_framework" />
|
|
|
|
|
<result property="generateStatus" column="generate_status" />
|
|
|
|
|
<result property="previewStatus" column="preview_status" />
|
2026-05-23 11:31:38 +08:00
|
|
|
<result property="erDiagram" column="er_diagram" />
|
2026-05-21 21:33:04 +08:00
|
|
|
<result property="status" column="status" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectFrontProjectVo">
|
2026-05-23 11:31:38 +08:00
|
|
|
select project_id, user_id, project_name, project_file_name, package_name, version, project_desc, industry_template, front_framework, back_framework, generate_status, preview_status, er_diagram, status, create_time, update_time, remark from front_project
|
2026-05-21 21:33:04 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectFrontProjectById" parameterType="Long" resultMap="FrontProjectResult">
|
|
|
|
|
<include refid="selectFrontProjectVo"/>
|
|
|
|
|
where project_id = #{projectId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectFrontProjectByUserAndId" resultMap="FrontProjectResult">
|
|
|
|
|
<include refid="selectFrontProjectVo"/>
|
|
|
|
|
where user_id = #{userId} and project_id = #{projectId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectFrontProjectList" parameterType="FrontProject" resultMap="FrontProjectResult">
|
|
|
|
|
<include refid="selectFrontProjectVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="userId != null"> and user_id = #{userId}</if>
|
|
|
|
|
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
|
|
|
|
|
<if test="industryTemplate != null and industryTemplate != ''"> and industry_template = #{industryTemplate}</if>
|
|
|
|
|
<if test="generateStatus != null and generateStatus != ''"> and generate_status = #{generateStatus}</if>
|
|
|
|
|
<if test="previewStatus != null and previewStatus != ''"> and preview_status = #{previewStatus}</if>
|
|
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertFrontProject" parameterType="FrontProject" useGeneratedKeys="true" keyProperty="projectId">
|
|
|
|
|
insert into front_project
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="userId != null">user_id,</if>
|
|
|
|
|
<if test="projectName != null">project_name,</if>
|
|
|
|
|
<if test="projectFileName != null">project_file_name,</if>
|
|
|
|
|
<if test="packageName != null">package_name,</if>
|
|
|
|
|
<if test="version != null">version,</if>
|
|
|
|
|
<if test="projectDesc != null">project_desc,</if>
|
|
|
|
|
<if test="industryTemplate != null">industry_template,</if>
|
|
|
|
|
<if test="frontFramework != null">front_framework,</if>
|
|
|
|
|
<if test="backFramework != null">back_framework,</if>
|
|
|
|
|
<if test="generateStatus != null">generate_status,</if>
|
|
|
|
|
<if test="previewStatus != null">preview_status,</if>
|
2026-05-23 11:31:38 +08:00
|
|
|
<if test="erDiagram != null">er_diagram,</if>
|
2026-05-21 21:33:04 +08:00
|
|
|
<if test="status != null">status,</if>
|
|
|
|
|
create_time,
|
|
|
|
|
<if test="remark != null">remark,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
|
|
<if test="projectName != null">#{projectName},</if>
|
|
|
|
|
<if test="projectFileName != null">#{projectFileName},</if>
|
|
|
|
|
<if test="packageName != null">#{packageName},</if>
|
|
|
|
|
<if test="version != null">#{version},</if>
|
|
|
|
|
<if test="projectDesc != null">#{projectDesc},</if>
|
|
|
|
|
<if test="industryTemplate != null">#{industryTemplate},</if>
|
|
|
|
|
<if test="frontFramework != null">#{frontFramework},</if>
|
|
|
|
|
<if test="backFramework != null">#{backFramework},</if>
|
|
|
|
|
<if test="generateStatus != null">#{generateStatus},</if>
|
|
|
|
|
<if test="previewStatus != null">#{previewStatus},</if>
|
2026-05-23 11:31:38 +08:00
|
|
|
<if test="erDiagram != null">#{erDiagram},</if>
|
2026-05-21 21:33:04 +08:00
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
|
sysdate(),
|
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateFrontProject" parameterType="FrontProject">
|
|
|
|
|
update front_project
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="projectName != null">project_name = #{projectName},</if>
|
|
|
|
|
<if test="projectFileName != null">project_file_name = #{projectFileName},</if>
|
|
|
|
|
<if test="packageName != null">package_name = #{packageName},</if>
|
|
|
|
|
<if test="version != null">version = #{version},</if>
|
|
|
|
|
<if test="projectDesc != null">project_desc = #{projectDesc},</if>
|
|
|
|
|
<if test="industryTemplate != null">industry_template = #{industryTemplate},</if>
|
|
|
|
|
<if test="frontFramework != null">front_framework = #{frontFramework},</if>
|
|
|
|
|
<if test="backFramework != null">back_framework = #{backFramework},</if>
|
|
|
|
|
<if test="generateStatus != null">generate_status = #{generateStatus},</if>
|
|
|
|
|
<if test="previewStatus != null">preview_status = #{previewStatus},</if>
|
2026-05-23 11:31:38 +08:00
|
|
|
<if test="erDiagram != null">er_diagram = #{erDiagram},</if>
|
2026-05-21 21:33:04 +08:00
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
|
|
update_time = sysdate(),
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where project_id = #{projectId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteFrontProjectById" parameterType="Long">
|
|
|
|
|
delete from front_project where project_id = #{projectId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteFrontProjectByUserAndId">
|
|
|
|
|
delete from front_project where user_id = #{userId} and project_id = #{projectId}
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|