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

94 lines
4.0 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.ThemeManagerMapper">
<resultMap type="ThemeManager" id="ThemeManagerResult">
<id property="themeId" column="theme_id" />
<result property="themeName" column="theme_name" />
<result property="jsonText" column="json_text" />
<result property="remark" column="remark" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="createDate" column="create_date" />
</resultMap>
<!-- 查询主题列表 -->
<select id="selectThemeManagerList" parameterType="ThemeManager" resultMap="ThemeManagerResult">
select ma.theme_id, ma.theme_name, ma.json_text, ma.remark, ma.user_id, us.user_name, ma.create_date
from mx_theme_manager ma , sys_user us
<where>
ma.user_id = us.user_id
<if test="userId != null and userId != 1 ">
AND ma.user_id = #{userId}
</if>
<if test="themeName != null and themeName != ''">
AND theme_name = like concat('%', #{themeName}, '%')
</if>
</where>
order by create_date desc
</select>
<!-- 根据主题名称查询 -->
<select id="selectThemeManagerForName" parameterType="ThemeManager" resultMap="ThemeManagerResult">
select ma.theme_id, ma.theme_name, ma.json_text, ma.remark, ma.user_id, ma.create_date
from mx_theme_manager ma
<where>
<if test="themeName != null and themeName != ''">
AND theme_name = #{themeName}
</if>
</where>
</select>
<!-- 新增图表主题 -->
<insert id="insertThemeManager" parameterType="ThemeManager">
insert into mx_theme_manager (
<if test="themeId != null and themeId != '' ">theme_id,</if>
<if test="themeName != null and themeName != '' ">theme_name,</if>
<if test="jsonText != null and jsonText != '' ">json_text,</if>
<if test="remark != null and remark != '' ">remark,</if>
<if test="userId != null and userId != '' ">user_id,</if>
create_date
) values (
<if test="themeId != null and themeId != '' ">#{themeId},</if>
<if test="themeName != null and themeName != '' ">#{themeName},</if>
<if test="jsonText != null and jsonText != '' ">#{jsonText},</if>
<if test="remark != null and remark != '' ">#{remark},</if>
<if test="userId != null and userId != '' ">#{userId},</if>
sysdate()
)
</insert>
<!-- 根据id获取信息-->
<select id="getInfoChartThemeId" parameterType="ThemeManager" resultMap="ThemeManagerResult">
select ma.theme_id, ma.theme_name, ma.json_text, ma.remark, ma.user_id, ma.create_date
from mx_theme_manager ma
<where>
<if test="themeId != null and themeId != ''">
AND theme_id = #{themeId}
</if>
</where>
</select>
<!-- 修改图表主题 -->
<update id="updateThemeManager" parameterType="ThemeManager">
update mx_theme_manager
<set>
<if test="themeName != null and themeName != ''">theme_name = #{themeName},</if>
<if test="jsonText != null and jsonText != ''">json_text = #{jsonText},</if>
<if test="remark != null and remark != ''">remark = #{remark}</if>
</set>
where theme_id = #{themeId}
</update>
<!-- 删除图表主题-->
<delete id="delChartTheme" parameterType="String">
delete from mx_theme_manager where theme_id in
<foreach item="themeId" collection="array" open="(" separator="," close=")">
#{themeId}
</foreach>
</delete>
</mapper>