Expand EasyCode front workbench features
This commit is contained in:
@@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="backFramework" column="back_framework" />
|
||||
<result property="generateStatus" column="generate_status" />
|
||||
<result property="previewStatus" column="preview_status" />
|
||||
<result property="erDiagram" column="er_diagram" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
@@ -24,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFrontProjectVo">
|
||||
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, status, create_time, update_time, remark from front_project
|
||||
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
|
||||
</sql>
|
||||
|
||||
<select id="selectFrontProjectById" parameterType="Long" resultMap="FrontProjectResult">
|
||||
@@ -64,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="backFramework != null">back_framework,</if>
|
||||
<if test="generateStatus != null">generate_status,</if>
|
||||
<if test="previewStatus != null">preview_status,</if>
|
||||
<if test="erDiagram != null">er_diagram,</if>
|
||||
<if test="status != null">status,</if>
|
||||
create_time,
|
||||
<if test="remark != null">remark,</if>
|
||||
@@ -80,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="backFramework != null">#{backFramework},</if>
|
||||
<if test="generateStatus != null">#{generateStatus},</if>
|
||||
<if test="previewStatus != null">#{previewStatus},</if>
|
||||
<if test="erDiagram != null">#{erDiagram},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
sysdate(),
|
||||
<if test="remark != null">#{remark},</if>
|
||||
@@ -99,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="backFramework != null">back_framework = #{backFramework},</if>
|
||||
<if test="generateStatus != null">generate_status = #{generateStatus},</if>
|
||||
<if test="previewStatus != null">preview_status = #{previewStatus},</if>
|
||||
<if test="erDiagram != null">er_diagram = #{erDiagram},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
update_time = sysdate(),
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
<?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.SourceProjectMapper">
|
||||
|
||||
<resultMap type="SourceProject" id="SourceProjectResult">
|
||||
<id property="projectId" column="project_id" />
|
||||
<result property="slug" column="slug" />
|
||||
<result property="projectName" column="project_name" />
|
||||
<result property="category" column="category" />
|
||||
<result property="coverText" column="cover_text" />
|
||||
<result property="summary" column="summary" />
|
||||
<result property="descriptionMd" column="description_md" />
|
||||
<result property="price" column="price" />
|
||||
<result property="viewCount" column="view_count" />
|
||||
<result property="tags" column="tags" />
|
||||
<result property="modules" column="modules" />
|
||||
<result property="scenes" column="scenes" />
|
||||
<result property="resourceName" column="resource_name" />
|
||||
<result property="resourceUrl" column="resource_url" />
|
||||
<result property="resourceVersion" column="resource_version" />
|
||||
<result property="resourceSize" column="resource_size" />
|
||||
<result property="sort" column="sort" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSourceProjectVo">
|
||||
select project_id, slug, project_name, category, cover_text, summary, description_md, price, view_count,
|
||||
tags, modules, scenes, resource_name, resource_url, resource_version, resource_size, sort, status,
|
||||
del_flag, create_by, create_time, update_by, update_time, remark
|
||||
from source_project
|
||||
</sql>
|
||||
|
||||
<select id="selectSourceProjectByProjectId" parameterType="Long" resultMap="SourceProjectResult">
|
||||
<include refid="selectSourceProjectVo"/>
|
||||
where project_id = #{projectId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectSourceProjectBySlug" parameterType="String" resultMap="SourceProjectResult">
|
||||
<include refid="selectSourceProjectVo"/>
|
||||
where slug = #{slug} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectSourceProjectList" parameterType="SourceProject" resultMap="SourceProjectResult">
|
||||
<include refid="selectSourceProjectVo"/>
|
||||
<where>
|
||||
and del_flag = '0'
|
||||
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="slug != null and slug != ''"> and slug like concat('%', #{slug}, '%')</if>
|
||||
<if test="category != null and category != '' and category != 'all'"> and category = #{category}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
and (
|
||||
project_name like concat('%', #{keyword}, '%')
|
||||
or summary like concat('%', #{keyword}, '%')
|
||||
or tags like concat('%', #{keyword}, '%')
|
||||
or modules like concat('%', #{keyword}, '%')
|
||||
or scenes like concat('%', #{keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by sort asc, update_time desc, create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectPublicSourceProjectList" parameterType="SourceProject" resultMap="SourceProjectResult">
|
||||
<include refid="selectSourceProjectVo"/>
|
||||
<where>
|
||||
and del_flag = '0'
|
||||
and status = '0'
|
||||
<if test="category != null and category != '' and category != 'all'"> and category = #{category}</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
and (
|
||||
project_name like concat('%', #{keyword}, '%')
|
||||
or summary like concat('%', #{keyword}, '%')
|
||||
or tags like concat('%', #{keyword}, '%')
|
||||
or modules like concat('%', #{keyword}, '%')
|
||||
or scenes like concat('%', #{keyword}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by sort asc, update_time desc, create_time desc
|
||||
</select>
|
||||
|
||||
<insert id="insertSourceProject" parameterType="SourceProject" useGeneratedKeys="true" keyProperty="projectId">
|
||||
insert into source_project
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
slug,
|
||||
project_name,
|
||||
<if test="category != null">category,</if>
|
||||
<if test="coverText != null">cover_text,</if>
|
||||
<if test="summary != null">summary,</if>
|
||||
<if test="descriptionMd != null">description_md,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="viewCount != null">view_count,</if>
|
||||
<if test="tags != null">tags,</if>
|
||||
<if test="modules != null">modules,</if>
|
||||
<if test="scenes != null">scenes,</if>
|
||||
<if test="resourceName != null">resource_name,</if>
|
||||
<if test="resourceUrl != null">resource_url,</if>
|
||||
<if test="resourceVersion != null">resource_version,</if>
|
||||
<if test="resourceSize != null">resource_size,</if>
|
||||
<if test="sort != null">sort,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{slug},
|
||||
#{projectName},
|
||||
<if test="category != null">#{category},</if>
|
||||
<if test="coverText != null">#{coverText},</if>
|
||||
<if test="summary != null">#{summary},</if>
|
||||
<if test="descriptionMd != null">#{descriptionMd},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="viewCount != null">#{viewCount},</if>
|
||||
<if test="tags != null">#{tags},</if>
|
||||
<if test="modules != null">#{modules},</if>
|
||||
<if test="scenes != null">#{scenes},</if>
|
||||
<if test="resourceName != null">#{resourceName},</if>
|
||||
<if test="resourceUrl != null">#{resourceUrl},</if>
|
||||
<if test="resourceVersion != null">#{resourceVersion},</if>
|
||||
<if test="resourceSize != null">#{resourceSize},</if>
|
||||
<if test="sort != null">#{sort},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSourceProject" parameterType="SourceProject">
|
||||
update source_project
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="slug != null">slug = #{slug},</if>
|
||||
<if test="projectName != null">project_name = #{projectName},</if>
|
||||
<if test="category != null">category = #{category},</if>
|
||||
<if test="coverText != null">cover_text = #{coverText},</if>
|
||||
<if test="summary != null">summary = #{summary},</if>
|
||||
<if test="descriptionMd != null">description_md = #{descriptionMd},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="viewCount != null">view_count = #{viewCount},</if>
|
||||
<if test="tags != null">tags = #{tags},</if>
|
||||
<if test="modules != null">modules = #{modules},</if>
|
||||
<if test="scenes != null">scenes = #{scenes},</if>
|
||||
<if test="resourceName != null">resource_name = #{resourceName},</if>
|
||||
<if test="resourceUrl != null">resource_url = #{resourceUrl},</if>
|
||||
<if test="resourceVersion != null">resource_version = #{resourceVersion},</if>
|
||||
<if test="resourceSize != null">resource_size = #{resourceSize},</if>
|
||||
<if test="sort != null">sort = #{sort},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where project_id = #{projectId}
|
||||
</update>
|
||||
|
||||
<update id="deleteSourceProjectByProjectIds" parameterType="Long">
|
||||
update source_project set del_flag = '2', update_time = sysdate()
|
||||
where project_id in
|
||||
<foreach item="projectId" collection="array" open="(" separator="," close=")">
|
||||
#{projectId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="changeSourceProjectStatus" parameterType="SourceProject">
|
||||
update source_project
|
||||
set status = #{status}, update_time = #{updateTime}
|
||||
where project_id = #{projectId}
|
||||
</update>
|
||||
|
||||
<update id="increaseViewCount" parameterType="Long">
|
||||
update source_project set view_count = ifnull(view_count, 0) + 1 where project_id = #{projectId}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,107 @@
|
||||
<?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.SourcePurchaseMapper">
|
||||
|
||||
<resultMap type="SourcePurchase" id="SourcePurchaseResult">
|
||||
<id property="purchaseId" column="purchase_id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="orderNo" column="order_no" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="payStatus" column="pay_status" />
|
||||
<result property="resourceStatus" column="resource_status" />
|
||||
<result property="purchaseTime" column="purchase_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="projectName" column="project_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSourcePurchaseVo">
|
||||
select p.purchase_id, p.project_id, p.user_id, p.order_no, p.amount, p.pay_status, p.resource_status,
|
||||
p.purchase_time, p.create_by, p.create_time, p.update_by, p.update_time, p.remark,
|
||||
sp.project_name
|
||||
from source_purchase p
|
||||
left join source_project sp on sp.project_id = p.project_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSourcePurchaseByPurchaseId" parameterType="Long" resultMap="SourcePurchaseResult">
|
||||
<include refid="selectSourcePurchaseVo"/>
|
||||
where p.purchase_id = #{purchaseId}
|
||||
</select>
|
||||
|
||||
<select id="selectPaidPurchase" resultMap="SourcePurchaseResult">
|
||||
<include refid="selectSourcePurchaseVo"/>
|
||||
where p.user_id = #{userId} and p.project_id = #{projectId} and p.pay_status = '1'
|
||||
order by p.purchase_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectSourcePurchaseList" parameterType="SourcePurchase" resultMap="SourcePurchaseResult">
|
||||
<include refid="selectSourcePurchaseVo"/>
|
||||
<where>
|
||||
<if test="projectId != null"> and p.project_id = #{projectId}</if>
|
||||
<if test="userId != null"> and p.user_id = #{userId}</if>
|
||||
<if test="orderNo != null and orderNo != ''"> and p.order_no like concat('%', #{orderNo}, '%')</if>
|
||||
<if test="payStatus != null and payStatus != ''"> and p.pay_status = #{payStatus}</if>
|
||||
<if test="resourceStatus != null and resourceStatus != ''"> and p.resource_status = #{resourceStatus}</if>
|
||||
<if test="projectName != null and projectName != ''"> and sp.project_name like concat('%', #{projectName}, '%')</if>
|
||||
</where>
|
||||
order by p.purchase_time desc, p.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectSourcePurchasesByUserId" parameterType="Long" resultMap="SourcePurchaseResult">
|
||||
<include refid="selectSourcePurchaseVo"/>
|
||||
where p.user_id = #{userId}
|
||||
order by p.purchase_time desc, p.create_time desc
|
||||
</select>
|
||||
|
||||
<insert id="insertSourcePurchase" parameterType="SourcePurchase" useGeneratedKeys="true" keyProperty="purchaseId">
|
||||
insert into source_purchase
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
project_id,
|
||||
user_id,
|
||||
order_no,
|
||||
amount,
|
||||
pay_status,
|
||||
resource_status,
|
||||
purchase_time,
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{projectId},
|
||||
#{userId},
|
||||
#{orderNo},
|
||||
#{amount},
|
||||
#{payStatus},
|
||||
#{resourceStatus},
|
||||
#{purchaseTime},
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSourcePurchase" parameterType="SourcePurchase">
|
||||
update source_purchase
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="payStatus != null">pay_status = #{payStatus},</if>
|
||||
<if test="resourceStatus != null">resource_status = #{resourceStatus},</if>
|
||||
<if test="purchaseTime != null">purchase_time = #{purchaseTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where purchase_id = #{purchaseId}
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user