mx_datav_gs/mxdata_v-system/target/classes/mybatis/engine/MxPagesMapper.xml

148 lines
7.3 KiB
XML

<?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.alonginfo.project.engine.mapper.MxPagesMapper">
<resultMap type="MxPages" id="MxPagesResult">
<id property="pageId" column="page_id" />
<result property="pageName" column="page_name" />
<result property="proId" column="pro_id" />
<result property="pagePath" column="page_path" />
<result property="pageComponent" column="page_component" />
<result property="pageDevelopCanvas" column="page_developCanvas" />
<result property="pageLayout" column="page_layout" />
<result property="isOwnChartTheme" column="is_own_chartTheme" />
<result property="themeId" column="theme_id" />
<result property="pagePublish" column="page_publish" />
<result property="isEncrypt" column="is_encrypt" />
<result property="password" column="password" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="remark" column="remark" />
<result property="appCtrl" column="app_ctrl" />
</resultMap>
<sql id="selectmxPagesVo">
select page_id, page_name, pro_id, page_path, page_component, page_developCanvas, page_layout, is_own_chartTheme,
theme_id, page_publish,is_encrypt,password,create_time,create_by,remark
from mx_pages
</sql>
<!-- 查询工程页面信息 -->
<select id="getPages" parameterType="MxPages" resultMap="MxPagesResult">
select ma.page_id, ma.page_name, ma.pro_id, ma.page_path, ma.page_component, ma.page_developCanvas ,ma.page_layout , ma.is_own_chartTheme
,ma.theme_id , ma.page_publish, ma.is_encrypt, ma.password, ma.create_time, ma.create_by, ma.remark, ma.app_ctrl
from mx_pages ma
<where>
<if test="pageId != null and pageId != '' ">
AND ma.page_id = #{pageId}
</if>
<if test="proId != null and proId != ''">
AND ma.pro_id = #{proId}
</if>
</where>
</select>
<!-- 检测页面名称是否唯一 -->
<select id="selectPageForName" parameterType="MxPages" resultMap="MxPagesResult">
<include refid="selectmxPagesVo"/>
<where>
page_name = #{pageName}
</where>
</select>
<!-- 根据id获取页面信息 -->
<select id="getPageInfo" parameterType="MxPages" resultMap="MxPagesResult">
<include refid="selectmxPagesVo"/>
<where>
page_id = #{pageId}
</where>
</select>
<!-- 新增主题页面信息 -->
<insert id="insertPages" parameterType="MxPages">
insert into mx_pages (
<if test="pageId != null and pageId != '' ">page_id,</if>
<if test="pageName != null and pageName != '' ">page_name,</if>
<if test="proId != null and proId != '' ">pro_id,</if>
<if test="pagePath != null and pagePath != '' ">page_path,</if>
<if test="pageComponent != null and pageComponent != '' ">page_component,</if>
<if test="pageDevelopCanvas != null and pageDevelopCanvas != '' ">page_developCanvas,</if>
<if test="pageLayout != null and pageLayout != '' ">page_layout,</if>
<if test="isOwnChartTheme != null and isOwnChartTheme != '' ">is_own_chartTheme,</if>
<if test="themeId != null and themeId != '' ">theme_id,</if>
<if test="pagePublish != null and pagePublish != '' ">page_publish,</if>
<if test="isEncrypt != null and isEncrypt != '' ">is_encrypt,</if>
<if test="password != null and password != '' ">password,</if>
<if test="remark != null and remark != '' ">remark,</if>
<if test="createBy != null and createBy != '' ">create_by,</if>
create_time
) values (
<if test="pageId != null and pageId != '' ">#{pageId},</if>
<if test="pageName != null and pageName != '' ">#{pageName},</if>
<if test="proId != null and proId != '' ">#{proId},</if>
<if test="pagePath != null and pagePath != '' ">#{pagePath},</if>
<if test="pageComponent != null and pageComponent != '' ">#{pageComponent},</if>
<if test="pageDevelopCanvas != null and pageDevelopCanvas != '' ">#{pageDevelopCanvas},</if>
<if test="pageLayout != null and pageLayout != '' ">#{pageLayout},</if>
<if test="isOwnChartTheme != null and isOwnChartTheme != '' ">#{isOwnChartTheme},</if>
<if test="themeId != null and themeId != '' ">#{themeId},</if>
<if test="pagePublish != null and pagePublish != '' ">#{pagePublish},</if>
<if test="isEncrypt != null and isEncrypt != '' ">#{isEncrypt},</if>
<if test="password != null and password != '' ">#{password},</if>
<if test="remark != null and remark != '' ">#{remark},</if>
<if test="createBy != null and createBy != '' ">#{createBy},</if>
sysdate()
)
</insert>
<!-- 更新页面信息 -->
<update id="updatePages" parameterType="MxPages">
update mx_pages
<set>
<if test="pageName != null and pageName != '' ">page_name = #{pageName},</if>
<if test="pagePath != null and pagePath != '' ">page_path = #{pagePath},</if>
<if test="pageComponent != null and pageComponent != '' ">page_component = #{pageComponent},</if>
<if test="pageDevelopCanvas != null and pageDevelopCanvas != '' ">page_developCanvas = #{pageDevelopCanvas},</if>
<if test="pageLayout != null and pageLayout != '' ">page_layout = #{pageLayout},</if>
<if test="isOwnChartTheme != null and isOwnChartTheme != '' ">is_own_chartTheme = #{isOwnChartTheme},</if>
<if test="themeId != null and themeId != '' ">theme_id = #{themeId},</if>
<if test="pagePublish != null and pagePublish != '' ">page_publish = #{pagePublish},</if>
<if test="isEncrypt != null and isEncrypt != '' ">is_encrypt = #{isEncrypt},</if>
<if test="password != null and password != '' ">password = #{password},</if>
<if test="remark != null and remark != '' ">remark = #{remark},</if>
<if test="appCtrl != null and appCtrl != '' ">app_ctrl = #{appCtrl},</if>
</set>
where page_id = #{pageId}
</update>
<!-- 主题发布-->
<update id="releasePage" parameterType="MxPages">
update mx_pages
<set>
<if test="pagePublish != null and pagePublish != '' ">page_publish = #{pagePublish},</if>
<if test="isEncrypt != null and isEncrypt != '' ">is_encrypt = #{isEncrypt},</if>
<if test="password != null and password != '' ">password = #{password},</if>
</set>
where page_id = #{pageId}
</update>
<!-- 删除主题页面 -->
<delete id="mxDeletePage" parameterType="String">
delete from mx_pages where page_id = #{pageId}
</delete>
<!-- 根据工程id删除 页面信息-->
<delete id="deletePagesForProId" parameterType="String">
delete from mx_pages where pro_id in
<foreach item="proId" collection="array" open="(" separator="," close=")">
#{proId}
</foreach>
</delete>
</mapper>