first commit
This commit is contained in:
@@ -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.alonginfo.project.business.mapper.MxBusinessDataMapper">
|
||||
|
||||
<!-- MxTableInfo 映射关系-->
|
||||
<resultMap type="com.alonginfo.project.business.domain.MxTableInfo" id="MxTableInfo">
|
||||
<result property="tableName" column="TABLE_NAME" />
|
||||
<result property="tableComment" column="TABLE_COMMENT" />
|
||||
</resultMap>
|
||||
|
||||
<!-- MxTableInfo 映射关系-->
|
||||
<resultMap type="com.alonginfo.project.business.domain.MxTableColumn" id="MxTableColumn">
|
||||
<result property="columnName" column="COLUMN_NAME" />
|
||||
<result property="columnType" column="COLUMN_TYPE" />
|
||||
<result property="columnComment" column="COLUMN_COMMENT" />
|
||||
<result property="columnKey" column="COLUMN_KEY" />
|
||||
<result property="isNullable" column="IS_NULLABLE" />
|
||||
</resultMap>
|
||||
|
||||
<!--根据业务表开头关键字集合 查询所有的表名字和备注 TABLE_NAME,TABLE_COMENT -->
|
||||
<select id="getTableInfos" resultMap="MxTableInfo">
|
||||
SELECT
|
||||
TABLE_NAME,
|
||||
TABLE_COMMENT
|
||||
FROM
|
||||
information_schema.TABLES
|
||||
WHERE
|
||||
TABLE_SCHEMA = (SELECT database())
|
||||
<foreach collection="list" item="item" open="AND (" close=")" separator="OR " index="index">
|
||||
<if test="item.dictValue != null and item.dictValue != ''">
|
||||
TABLE_NAME LIKE CONCAT(#{item.dictValue},'%')
|
||||
</if>
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<!--根据表名称获取表的字段信息 -->
|
||||
<select id="getColumnByTableName" resultMap="MxTableColumn">
|
||||
SELECT
|
||||
COLUMN_NAME, COLUMN_TYPE, COLUMN_COMMENT, IS_NULLABLE, COLUMN_KEY
|
||||
FROM
|
||||
information_schema.COLUMNS
|
||||
WHERE
|
||||
TABLE_SCHEMA = (select database())
|
||||
AND
|
||||
table_name = #{tableName}
|
||||
</select>
|
||||
|
||||
<!--根据表名查找表数据 -->
|
||||
<select id="getTableDataByTableName" resultType="map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
${tableName}
|
||||
</select>
|
||||
|
||||
<!-- 根据表名 表主键 主键值删除表数据 -->
|
||||
<delete id="removeDataByKey" parameterType="map">
|
||||
DELETE
|
||||
FROM
|
||||
${params.tableName}
|
||||
WHERE
|
||||
${params.tableKey} = #{params.keyValue}
|
||||
</delete>
|
||||
|
||||
<!-- 根据表名 主键名 主键值 数据MAP 更新数据 -->
|
||||
<update id="updateDataByKey" parameterType="map">
|
||||
UPDATE
|
||||
${params.tableName}
|
||||
SET
|
||||
<foreach collection="params.dataMap" index="key" item="value" separator=",">
|
||||
${key} = #{value}
|
||||
</foreach>
|
||||
WHERE
|
||||
${params.tableKey} = #{params.keyValue}
|
||||
</update>
|
||||
|
||||
<!-- 据表名 数据MAP 插入数据 -->
|
||||
<insert id="insertData" parameterType="map">
|
||||
INSERT
|
||||
INTO
|
||||
${params.tableName}
|
||||
<foreach collection="params.dataMap" index="key" separator="," open="(" close=")">
|
||||
${key}
|
||||
</foreach>
|
||||
VALUES
|
||||
<foreach collection="params.dataMap" item="value" separator="," open="(" close=")">
|
||||
#{value}
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 根据表名获取表注释名称 -->
|
||||
<select id="getTableCNName" resultType="java.lang.String">
|
||||
SELECT TABLE_COMMENT
|
||||
FROM
|
||||
information_schema.TABLES
|
||||
WHERE
|
||||
TABLE_SCHEMA = (SELECT database())
|
||||
AND
|
||||
TABLE_NAME = #{tableName}
|
||||
</select>
|
||||
|
||||
<delete id="delDataByTableName">
|
||||
DELETE FROM ${tableName}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,145 @@
|
||||
<?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.business.mapper.MxComponentsMapper">
|
||||
<!--映射关系-->
|
||||
<resultMap type="MxComponentsType" id="MxComponentsTypeResult">
|
||||
<result property="comTypeId" column="com_type_id" />
|
||||
<result property="comTypeName" column="com_type_name" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createDate" column="create_date" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap type="MxComponents" id="MxComponentsResult">
|
||||
<result property="comId" column="com_id" />
|
||||
<result property="comTypeId" column="com_type_id" />
|
||||
<result property="comName" column="com_name" />
|
||||
<result property="comAliasName" column="com_alias_name" />
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="enabled" column="enabled" />
|
||||
<result property="comPngUrl" column="com_png_url" />
|
||||
<result property="createDate" column="create_date" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMxComponentsTypeVo">
|
||||
select com_type_id,com_type_name,remark,create_date
|
||||
from mx_components_type
|
||||
</sql>
|
||||
<sql id="selectMxComponentsVo">
|
||||
select com_id,com_type_id,com_name,com_alias_name,remark,enabled,com_png_url,create_date
|
||||
from mx_components
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 新增 组件类型 -->
|
||||
<insert id="insertMxComponentsType" parameterType="MxComponentsType" >
|
||||
insert into mx_components_type(
|
||||
<if test="comTypeId != null and comTypeId != ''">com_type_id,</if>
|
||||
<if test="comTypeName != null and comTypeName != ''">com_type_name,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
create_date
|
||||
)
|
||||
values(
|
||||
<if test="comTypeId != null and comTypeId != ''">#{comTypeId},</if>
|
||||
<if test="comTypeName != null and comTypeName != ''">#{comTypeName},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 删除 组件类型 -->
|
||||
<delete id="deleteMxComponentsType" >
|
||||
delete from mx_components_type where com_type_id = #{comTypeId}
|
||||
</delete>
|
||||
|
||||
|
||||
<!--修改 组件类型 -->
|
||||
<update id="editMxComponentsType" parameterType="MxComponentsType">
|
||||
update mx_components_type
|
||||
<set>
|
||||
<if test="comTypeName != null and comTypeName != ''">com_type_name = #{comTypeName},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
create_date = sysdate()
|
||||
</set>
|
||||
where com_type_id = #{comTypeId}
|
||||
</update>
|
||||
|
||||
<!--查询 组件类型 -->
|
||||
<select id="getMxComponentsType" resultMap="MxComponentsTypeResult">
|
||||
<include refid="selectMxComponentsTypeVo"/>
|
||||
where com_type_id = #{comTypeId}
|
||||
</select>
|
||||
|
||||
<!--查询 组件类型list -->
|
||||
<select id="listMxComponentsType" resultMap="MxComponentsTypeResult">
|
||||
<include refid="selectMxComponentsTypeVo"/>
|
||||
order by create_date
|
||||
</select>
|
||||
|
||||
<!-- 新增 组件 -->
|
||||
<insert id="insertMxComponents" parameterType="MxComponents" >
|
||||
insert into mx_components(
|
||||
<if test="comId != null and comId != ''">com_id,</if>
|
||||
<if test="comTypeId != null and comTypeId != ''">com_type_id,</if>
|
||||
<if test="comName != null and comName != ''">com_name,</if>
|
||||
<if test="comAliasName != null and comAliasName != ''">com_alias_name,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="enabled != null and enabled != ''">enabled,</if>
|
||||
<if test="comPngUrl != null and comPngUrl != ''">com_png_url,</if>
|
||||
create_date
|
||||
)
|
||||
values(
|
||||
<if test="comId != null and comId != ''">#{comId},</if>
|
||||
<if test="comTypeId != null and comTypeId != ''">#{comTypeId},</if>
|
||||
<if test="comName != null and comName != ''">#{comName},</if>
|
||||
<if test="comAliasName != null and comAliasName != ''">#{comAliasName},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="enabled != null and enabled != ''">#{enabled},</if>
|
||||
<if test="comPngUrl != null and comPngUrl != ''">#{comPngUrl},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
<!-- 删除 组件类型 -->
|
||||
<delete id="deleteMxComponents" >
|
||||
delete from mx_components where com_id = #{comId}
|
||||
</delete>
|
||||
<!-- 删除 组件类型 根据组件类型 -->
|
||||
<delete id="deleteMxComponentsByComTypeId" >
|
||||
delete from mx_components where com_type_id = #{comTypeId}
|
||||
</delete>
|
||||
<!--修改 组件 -->
|
||||
<update id="editMxComponents" parameterType="MxComponents">
|
||||
update mx_components
|
||||
<set>
|
||||
<if test="comTypeId != null and comTypeId != ''">com_type_id = #{comTypeId},</if>
|
||||
<if test="comName != null and comName != ''">com_name = #{comName},</if>
|
||||
<if test="comAliasName != null and comAliasName != ''">com_alias_name = #{comAliasName},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="enabled != null and enabled != ''">enabled = #{enabled},</if>
|
||||
<if test="comPngUrl != null and comPngUrl != ''">com_png_url = #{comPngUrl},</if>
|
||||
create_date = sysdate()
|
||||
</set>
|
||||
where com_id = #{comId}
|
||||
</update>
|
||||
<!--查询 组件 根据id -->
|
||||
<select id="getMxComponents" resultMap="MxComponentsResult">
|
||||
<include refid="selectMxComponentsVo"/>
|
||||
where com_id = #{comId}
|
||||
</select>
|
||||
<!--查询 组件list 根据组件类型id -->
|
||||
<select id="getMxComponentsBycomId" resultMap="MxComponentsResult">
|
||||
<include refid="selectMxComponentsVo"/>
|
||||
where com_type_id = #{comTypeId} and enabled = '1'
|
||||
order by create_date
|
||||
</select>
|
||||
|
||||
<!-- 查询所有有效的组件-->
|
||||
<select id="getAllCompinfo" resultMap="MxComponentsResult">
|
||||
<include refid="selectMxComponentsVo"/>
|
||||
where enabled = '1'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,157 @@
|
||||
<?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.business.mapper.MxDataSetMapper">
|
||||
|
||||
<!--映射关系-->
|
||||
<!--MxDataGroup-->
|
||||
<resultMap type="MxDataGroup" id="MxDataGroupResult">
|
||||
<result property="dGroupId" column="d_group_id" />
|
||||
<result property="dGroupName" column="d_group_name" />
|
||||
<result property="dGroupSort" column="d_group_sort" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
<!--MxDataSet-->
|
||||
<resultMap type="MxDataSet" id="MxDataSetResult">
|
||||
<result property="dsId" column="DS_ID" />
|
||||
<result property="dsName" column="DS_NAME" />
|
||||
<result property="databaseId" column="DATABASE_ID" />
|
||||
<result property="dataSql" column="DATA_SQL" />
|
||||
<result property="hasParam" column="has_param" />
|
||||
<result property="ajaxId" column="code_get_id" />
|
||||
<result property="typeId" column="TYPE_ID" />
|
||||
<!-- 设置信息 -->
|
||||
<association property="dataSetKeys" column="b" resultMap="MxDataSetKeyResult"/>
|
||||
</resultMap>
|
||||
<!--MxDataSetKeyResult -->
|
||||
<resultMap type="MxDataSetKey" id="MxDataSetKeyResult">
|
||||
<result property="keyId" column="key_id" />
|
||||
<result property="keyName" column="key_name" />
|
||||
</resultMap>
|
||||
<sql id="selectMxDataGroupVo">
|
||||
select d_group_id, d_group_name,d_group_sort, create_time from mx_data_group order by d_group_sort
|
||||
</sql>
|
||||
<sql id="selectMxDataSetVo">
|
||||
select DS_ID,DS_NAME,DATABASE_ID,DATA_SQL,d_group_id,has_param,code_get_id from mx_data_set
|
||||
</sql>
|
||||
|
||||
<!-- 查询 数据集分组-->
|
||||
<select id="selectMxDataGroupList" parameterType="MxDataGroup" resultMap="MxDataGroupResult">
|
||||
<include refid="selectMxDataGroupVo"/>
|
||||
</select>
|
||||
|
||||
<!-- 添加 数据集分组 -->
|
||||
<insert id="addMxDataGroup" parameterType="MxDataGroup">
|
||||
insert into mx_data_group(
|
||||
<if test="dGroupId != null and dGroupId != ''">d_group_id,</if>
|
||||
<if test="dGroupName != null and dGroupName != ''">d_group_name,</if>
|
||||
<if test="dGroupSort != null and dGroupSort != ''">d_group_sort,</if>
|
||||
create_time
|
||||
)
|
||||
values(
|
||||
<if test="dGroupId != null and dGroupId != ''">#{dGroupId},</if>
|
||||
<if test="dGroupName != null and dGroupName != ''">#{dGroupName},</if>
|
||||
<if test="dGroupSort != null and dGroupSort != ''">#{dGroupSort},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除数据集分组 -->
|
||||
<delete id="deleteMxDataGroup">
|
||||
delete from mx_data_group where d_group_id = #{dGroupId}
|
||||
</delete>
|
||||
|
||||
<!-- 修改数据集分组 -->
|
||||
<update id="editMxDataGroup" parameterType="MxDataGroup">
|
||||
update mx_data_group
|
||||
<set>
|
||||
<if test="dGroupName != null and dGroupName != ''">d_group_name = #{dGroupName},</if>
|
||||
<if test="dGroupSort != null and dGroupSort != ''">d_group_sort = #{dGroupSort},</if>
|
||||
create_time = sysdate()
|
||||
</set>
|
||||
where d_group_id = #{dGroupId}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--数据集 ====================================-->
|
||||
<!-- 根据数据集分类id获取数据集 -->
|
||||
<select id="getDataSetListByDGroupId" resultMap="MxDataSetResult">
|
||||
<include refid="selectMxDataSetVo"/>
|
||||
where d_Group_Id = #{dGroupId}
|
||||
</select>
|
||||
|
||||
<!-- 根据数据查询别名获取数据集 -->
|
||||
<select id="getDataSetListByAjaxId" resultMap="MxDataSetResult">
|
||||
<include refid="selectMxDataSetVo"/>
|
||||
where code_get_id = #{ajaxId}
|
||||
</select>
|
||||
|
||||
<!-- 添加数据集 -->
|
||||
<insert id="addDataSet">
|
||||
insert into mx_data_set(
|
||||
<if test="dsId != null and dsId != ''">ds_id,</if>
|
||||
<if test="dsName != null and dsName != ''">ds_name,</if>
|
||||
<if test="databaseId != null and databaseId != ''">database_id,</if>
|
||||
<if test="dataSql != null and dataSql != ''">data_sql,</if>
|
||||
<if test="dGroupId != null and dGroupId != ''">d_group_id,</if>
|
||||
<if test="hasParam != null and hasParam != ''">has_param,</if>
|
||||
<if test="ajaxId != null and ajaxId != ''">code_get_id,</if>
|
||||
create_time
|
||||
)
|
||||
values(
|
||||
<if test="dsId != null and dsId != ''">#{dsId},</if>
|
||||
<if test="dsName != null and dsName != ''">#{dsName},</if>
|
||||
<if test="databaseId != null and databaseId != ''">#{databaseId},</if>
|
||||
<if test="dataSql != null and dataSql != ''">#{dataSql},</if>
|
||||
<if test="dGroupId != null and dGroupId != ''">#{dGroupId},</if>
|
||||
<if test="hasParam != null and hasParam != ''">#{hasParam},</if>
|
||||
<if test="ajaxId != null and ajaxId != ''">#{ajaxId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 添加数据集相关key -->
|
||||
<insert id="addMxDtaSetKey" parameterType="MxDataSetKey" >
|
||||
insert into mx_data_set_key(KEY_ID,KEY_NAME,DS_ID) values(#{keyId},#{keyName},#{dsId})
|
||||
</insert>
|
||||
|
||||
<!--删除数据集 -->
|
||||
<delete id="deleteMxDataSetById">
|
||||
delete from mx_data_set where ds_id =#{dsId}
|
||||
</delete>
|
||||
<!-- 根据数据集id 删除数据集相关id -->
|
||||
<delete id="deleteMxDataSetKeyByDsId">
|
||||
delete from mx_data_set_key where ds_id =#{dsId}
|
||||
</delete>
|
||||
|
||||
<select id="getMxDataSet" resultMap="MxDataSetResult" >
|
||||
<include refid="selectMxDataSetVo"/>
|
||||
where ds_id = #{dsId}
|
||||
</select>
|
||||
<!-- 执行动态sql -->
|
||||
<select id="executeSql" parameterType="map" resultType="map">
|
||||
${dataSql}
|
||||
</select>
|
||||
<!-- 查询所有mx_data_set_key-->
|
||||
<select id="listMxDataSetKey" resultMap="MxDataSetKeyResult">
|
||||
select key_id ,key_name from mx_data_set_key
|
||||
</select>
|
||||
|
||||
<!--根据分组id 查询所有数据集 及 数据集key -->
|
||||
<select id="mxDataqueryDataSetBydGroupId" resultMap="MxDataSetResult">
|
||||
SELECT
|
||||
a.DS_ID,
|
||||
a.DS_NAME,
|
||||
b.KEY_ID,
|
||||
b.KEY_NAME
|
||||
FROM
|
||||
mx_data_set a
|
||||
left join mx_data_set_key b on a.ds_ID = b.DS_ID
|
||||
where a.d_group_id = #{dGroupId}
|
||||
and a.has_param != '1'
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?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.business.mapper.MxDatabaseMapper">
|
||||
<!--映射关系-->
|
||||
<resultMap type="MxDatabase" id="MxDatabaseResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="aliasName" column="alias_name" />
|
||||
<result property="configName" column="config_name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="driverClass" column="driver_class"/>
|
||||
<result property="username" column="username" />
|
||||
<result property="password" column="password" />
|
||||
<result property="url" column="url" />
|
||||
<result property="createDate" column="create_date" />
|
||||
<result property="isOpen" column="is_open" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMxDatabaseVo">
|
||||
select id,alias_name,config_name,type,driver_class,username,password,url,create_date,is_open
|
||||
from mx_database
|
||||
</sql>
|
||||
<!-- 查询 -->
|
||||
<select id="selectMxDatabaseList" parameterType="MxDatabase" resultMap="MxDatabaseResult">
|
||||
<include refid="selectMxDatabaseVo"/>
|
||||
</select>
|
||||
<!-- 新增 -->
|
||||
<insert id="insertMxDatabase" parameterType="MxDatabase" >
|
||||
insert into mx_database(
|
||||
<if test="id != null and id != ''">id,</if>
|
||||
<if test="aliasName != null and aliasName != ''">alias_name,</if>
|
||||
<if test="configName != null and configName != ''">config_name,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="driverClass != null and driverClass != ''">driver_class,</if>
|
||||
<if test="username != null and username != ''">username,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="url != null and url != ''">url,</if>
|
||||
<if test="isOpen != null and isOpen != ''">is_open,</if>
|
||||
create_date
|
||||
)
|
||||
values(
|
||||
<if test="id != null and id != ''">#{id},</if>
|
||||
<if test="aliasName != null and aliasName != ''">#{aliasName},</if>
|
||||
<if test="configName != null and configName != ''">#{configName},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="driverClass != null and driverClass != ''">#{driverClass},</if>
|
||||
<if test="username != null and username != ''">#{username},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="url != null and url != ''">#{url},</if>
|
||||
<if test="isOpen != null and isOpen != ''">#{isOpen},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
<!-- 删除数据 -->
|
||||
<delete id="deleteMxDatabase" >
|
||||
delete from mx_database where id = #{id}
|
||||
</delete>
|
||||
|
||||
<!--修改数据-->
|
||||
<update id="editMxDatabase" parameterType="MxDatabase">
|
||||
update mx_database
|
||||
<set>
|
||||
<if test="aliasName != null and aliasName != ''">alias_name = #{aliasName},</if>
|
||||
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="driverClass != null and driverClass != ''">driver_class = #{driverClass},</if>
|
||||
<if test="username != null and username != ''">username = #{username},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="url != null and url != ''">url = #{url},</if>
|
||||
<if test="isOpen != null and isOpen != ''">is_open = #{isOpen},</if>
|
||||
create_date = sysdate()
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<!--根据id获取对象-->
|
||||
<select id="getMxDatabase" resultMap="MxDatabaseResult">
|
||||
<include refid="selectMxDatabaseVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,75 @@
|
||||
<?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.business.mapper.MxGroupSettingMapper">
|
||||
|
||||
<resultMap type="MxGroupSetting" id="MxGroupSettingResult">
|
||||
<result property="settingId" column="setting_id" />
|
||||
<result property="settingName" column="setting_name" />
|
||||
<result property="autoSwitch" column="auto_switch" />
|
||||
<result property="switchAnimation" column="switch_animation" />
|
||||
<result property="switchTime" column="switch_time" />
|
||||
<result property="description" column="description" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMxGroupSettingVo">
|
||||
select setting_id, setting_name, auto_switch, switch_animation, switch_time, description from mx_group_setting
|
||||
</sql>
|
||||
|
||||
<!-- 查询列表 -->
|
||||
<select id="selectMxGroupSettingList" parameterType="MxGroupSetting" resultMap="MxGroupSettingResult">
|
||||
<include refid="selectMxGroupSettingVo"/>
|
||||
<where>
|
||||
<if test="settingName != null and settingName != ''"> and setting_name like concat('%', #{settingName}, '%')</if>
|
||||
<if test="autoSwitch != null and autoSwitch != ''"> and auto_switch = #{autoSwitch}</if>
|
||||
<if test="switchAnimation != null "> and switch_animation = #{switchAnimation}</if>
|
||||
<if test="switchTime != null "> and switch_time = #{switchTime}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 根据ID 查询 -->
|
||||
<select id="selectMxGroupSettingById" parameterType="String" resultMap="MxGroupSettingResult">
|
||||
<include refid="selectMxGroupSettingVo"/>
|
||||
where setting_id = #{settingId}
|
||||
</select>
|
||||
<!--插入配置-->
|
||||
<insert id="insertMxGroupSetting" parameterType="MxGroupSetting">
|
||||
insert into mx_group_setting
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="settingId != null and settingId != ''">setting_id,</if>
|
||||
<if test="settingName != null and settingName != ''">setting_name,</if>
|
||||
<if test="autoSwitch != null and autoSwitch != ''">auto_switch,</if>
|
||||
<if test="switchAnimation != null ">switch_animation,</if>
|
||||
<if test="switchTime != null ">switch_time,</if>
|
||||
<if test="description != null and description != ''">description,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="settingId != null and settingId != ''">#{settingId},</if>
|
||||
<if test="settingName != null and settingName != ''">#{settingName},</if>
|
||||
<if test="autoSwitch != null and autoSwitch != ''">#{autoSwitch},</if>
|
||||
<if test="switchAnimation != null ">#{switchAnimation},</if>
|
||||
<if test="switchTime != null ">#{switchTime},</if>
|
||||
<if test="description != null and description != ''">#{description},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<!--更新配置-->
|
||||
<update id="updateMxGroupSetting" parameterType="MxGroupSetting">
|
||||
update mx_group_setting
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="settingName != null and settingName != ''">setting_name = #{settingName},</if>
|
||||
<if test="autoSwitch != null and autoSwitch != ''">auto_switch = #{autoSwitch},</if>
|
||||
<if test="switchAnimation != null ">switch_animation = #{switchAnimation},</if>
|
||||
<if test="switchTime != null ">switch_time = #{switchTime},</if>
|
||||
<if test="description != null and description != ''">description = #{description},</if>
|
||||
</trim>
|
||||
where setting_id = #{settingId}
|
||||
</update>
|
||||
<!--删除配置-->
|
||||
<delete id="deleteMxGroupSettingById" parameterType="String">
|
||||
delete from mx_group_setting where setting_id = #{settingId}
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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.business.mapper.MxIntroduceMapper">
|
||||
|
||||
<!-- 找所有的工程 -->
|
||||
<select id="selectProject" resultType="map">
|
||||
SELECT pro_id proId, pro_name proName FROM mx_project WHERE pro_state = '0'
|
||||
</select>
|
||||
|
||||
<!-- 根据工程ID 查找主题 -->
|
||||
<select id="selectPageByProject" resultType="map">
|
||||
SELECT page_id pageId, page_name pageName FROM mx_pages WHERE pro_id = #{proId}
|
||||
</select>
|
||||
|
||||
<!-- 根据主题ID 查找解说词 -->
|
||||
<select id="selectIntroduceByPage" resultType="map">
|
||||
SELECT page_id pageId, introduce FROM mx_pages WHERE page_id = #{pageId}
|
||||
</select>
|
||||
|
||||
<!-- 更新解说词 -->
|
||||
<update id="updateIntroduce">
|
||||
UPDATE mx_pages SET introduce = #{introduce} WHERE page_id = #{pageId}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,184 @@
|
||||
<?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.business.mapper.MxPageGroupMapper">
|
||||
|
||||
<resultMap type="MxPageGroup" id="MxPageGroupResult">
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="pagePath" column="page_path" />
|
||||
<result property="settingId" column="setting_id" />
|
||||
<result property="description" column="description" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<!-- 设置信息 -->
|
||||
<association property="mxGroupSetting" javaType="MxGroupSetting">
|
||||
<result property="settingName" column="setting_name" />
|
||||
<result property="autoSwitch" column="auto_switch" />
|
||||
<result property="switchAnimation" column="switch_animation" />
|
||||
<result property="switchTime" column="switch_time" />
|
||||
<result property="description" column="setting_description" />
|
||||
</association>
|
||||
<collection property="themeManagers" javaType="java.util.ArrayList" ofType="ThemeManager">
|
||||
<result property="themeId" column="page_id" />
|
||||
<result property="themeName" column="page_name" />
|
||||
<result property="appCtrl" column="app_ctrl" />
|
||||
<result property="introduce" column="introduce" />
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!-- 工程 -->
|
||||
<resultMap type="MxProject" id="MxProjectResult">
|
||||
<result property="proId" column="pro_id" />
|
||||
<result property="proName" column="pro_name" />
|
||||
</resultMap>
|
||||
<!-- 主题管理 -->
|
||||
<resultMap type="MxPages" id="MxPagesResult">
|
||||
<result property="pageId" column="page_id" />
|
||||
<result property="pageName" column="page_name" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
<sql id="selectMxPageGroupVo">
|
||||
SELECT
|
||||
a.group_id,
|
||||
a.group_name,
|
||||
a.page_path,
|
||||
a.setting_id,
|
||||
a.description,
|
||||
a.create_time,
|
||||
b.setting_name,
|
||||
b.auto_switch,
|
||||
b.switch_animation,
|
||||
b.switch_time,
|
||||
b.description setting_description,
|
||||
d.page_name ,
|
||||
d.page_id
|
||||
|
||||
FROM
|
||||
mx_page_group a
|
||||
LEFT JOIN mx_group_setting b ON a.setting_id = b.setting_id
|
||||
left join mx_page_mid_group c on a.group_id = c.group_id
|
||||
left join mx_pages d on c.page_id=d.page_id
|
||||
order by a.group_id , c.order_num
|
||||
</sql>
|
||||
|
||||
<!-- 查询分组列表 -->
|
||||
<select id="selectMxPageGroupList" parameterType="MxPageGroup" resultMap="MxPageGroupResult">
|
||||
<include refid="selectMxPageGroupVo"/>
|
||||
<where>
|
||||
<if test="groupName != null and groupName != ''"> and group_name like concat('%', #{groupName}, '%')</if>
|
||||
<if test="pagePath != null and pagePath != ''"> and page_path = #{pagePath}</if>
|
||||
<if test="settingId != null and settingId != ''"> and setting_id = #{settingId}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 根据分组id 查询分组信息 -->
|
||||
<select id="selectMxPageGroupById" parameterType="String" resultMap="MxPageGroupResult">
|
||||
<include refid="selectMxPageGroupVo"/>
|
||||
where group_id = #{groupId}
|
||||
</select>
|
||||
|
||||
<!-- 插入分组信息 -->
|
||||
<insert id="insertMxPageGroup" parameterType="MxPageGroup">
|
||||
insert into mx_page_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="groupId != null and groupId != ''">group_id,</if>
|
||||
<if test="groupName != null and groupName != ''">group_name,</if>
|
||||
<if test="pagePath != null and pagePath != ''">page_path,</if>
|
||||
<if test="settingId != null and settingId != ''">setting_id,</if>
|
||||
<if test="description != null and description != ''">description,</if>
|
||||
create_time
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="groupId != null and groupId != ''">#{groupId},</if>
|
||||
<if test="groupName != null and groupName != ''">#{groupName},</if>
|
||||
<if test="pagePath != null and pagePath != ''">#{pagePath},</if>
|
||||
<if test="settingId != null and settingId != ''">#{settingId},</if>
|
||||
<if test="description != null and description != ''">#{description},</if>
|
||||
sysdate()
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 更新分组信息 -->
|
||||
<update id="updateMxPageGroup" parameterType="MxPageGroup">
|
||||
update mx_page_group
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="groupName != null and groupName != ''">group_name = #{groupName},</if>
|
||||
<if test="settingId != null and settingId != ''">setting_id = #{settingId},</if>
|
||||
<if test="description != null and description != ''">description = #{description},</if>
|
||||
create_time = sysdate()
|
||||
</trim>
|
||||
where group_id = #{groupId}
|
||||
</update>
|
||||
|
||||
<!--根据分组id 删除分组信息-->
|
||||
<delete id="deleteMxPageGroupById" parameterType="String">
|
||||
delete from mx_page_group where group_id = #{groupId}
|
||||
</delete>
|
||||
<!-- 删除分组相关的分组&主题中间表 -->
|
||||
<delete id="deleteMxPageMidGroupByGroupId" parameterType="String">
|
||||
delete from mx_page_mid_group where group_id = #{groupId}
|
||||
</delete>
|
||||
<!---->
|
||||
<delete id="removePageInGroup" >
|
||||
delete from mx_page_mid_group where group_id = #{groupId} and page_id =#{themeId}
|
||||
</delete>
|
||||
|
||||
<!-- 插入分组主题数据 -->
|
||||
<insert id="addPageToGroup">
|
||||
insert into mx_page_mid_group(group_id,page_id,order_num)
|
||||
values
|
||||
<foreach collection="themeManagers" index="index" item="item" separator=",">
|
||||
(#{groupId},#{item.themeId},#{item.orderNum})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--获取工程列表 -->
|
||||
<select id="getProjectList" resultMap="MxProjectResult">
|
||||
select * from mx_project
|
||||
</select>
|
||||
|
||||
<!-- 获取主题信息 -->
|
||||
<select id="getPagesList" resultMap="MxPagesResult">
|
||||
select page_id,page_name,create_time from mx_pages
|
||||
where pro_id = #{proId}
|
||||
</select>
|
||||
|
||||
<!-- 根据分组id 获取最大排序只(如果没有新增分组 返回0) -->
|
||||
<select id="getMaxOrderNum" resultType="int">
|
||||
select IFNULL( max(order_num) ,0) from mx_page_mid_group where group_id = #{groupId}
|
||||
</select>
|
||||
<!--修改分组主题排序-->
|
||||
<update id="editOrderNum">
|
||||
update mx_page_mid_group set order_num = #{orderNum} where group_id=#{groupId} and page_id=#{themeId}
|
||||
</update>
|
||||
|
||||
<!-- 根据page_path 查询主题信息-->
|
||||
<select id="listPagesByGroupPagePath" resultMap="MxPageGroupResult">
|
||||
SELECT
|
||||
a.group_id,
|
||||
a.group_name,
|
||||
a.page_path,
|
||||
a.setting_id,
|
||||
a.description,
|
||||
a.create_time,
|
||||
b.setting_name,
|
||||
b.auto_switch,
|
||||
b.switch_animation,
|
||||
b.switch_time,
|
||||
b.description setting_description,
|
||||
d.page_name ,
|
||||
d.page_id,
|
||||
d.app_ctrl,
|
||||
d.introduce
|
||||
|
||||
FROM
|
||||
mx_page_group a
|
||||
LEFT JOIN mx_group_setting b ON a.setting_id = b.setting_id
|
||||
left join mx_page_mid_group c on a.group_id = c.group_id
|
||||
left join mx_pages d on c.page_id=d.page_id
|
||||
where a.page_path = #{pagePath}
|
||||
order by c.order_num
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?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.business.mapper.MxQuartzMapper">
|
||||
<sql id="baseColumn">
|
||||
job_id jobId, job_name jobName, job_group jobGroup, invoke_target invokeTarget, cron_expression cronExpression,
|
||||
misfire_policy misfirePolicy, concurrent, status, create_by createBy, DATe_FORMAT(create_time, '%Y-%m-%d %H:%i:%s') createTime,
|
||||
update_by updateBy, DATe_FORMAT(update_time, '%Y-%m-%d %H:%i:%s') updateTime, remark
|
||||
</sql>
|
||||
|
||||
|
||||
<!--查询所有定时任务-->
|
||||
<select id="getQuartzList" resultType="java.util.Map">
|
||||
SELECT
|
||||
<include refid="baseColumn"></include>
|
||||
FROM
|
||||
sys_job
|
||||
<where>
|
||||
<if test="jobName != null and jobName != ''">
|
||||
AND job_name LIKE CONCAT('%', #{jobName}, '%')
|
||||
</if>
|
||||
<if test="jobGroup != null and jobGroup != ''">
|
||||
AND job_group = #{jobGroup}
|
||||
</if>
|
||||
<if test="invokeTarget != null and invokeTarget != ''">
|
||||
AND invoke_target LIKE CONCAT('%', #{invokeTarget}, '%')
|
||||
</if>
|
||||
<if test="status !=null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--通过id查询定时任务详细信息-->
|
||||
<select id="selectJobById" resultType="com.alonginfo.quartz.domain.SysJob">
|
||||
SELECT
|
||||
<include refid="baseColumn"></include>
|
||||
FROM
|
||||
sys_job
|
||||
WHERE
|
||||
job_id = #{jobId}
|
||||
</select>
|
||||
|
||||
<!--更新定时任务-->
|
||||
<update id="updateJob">
|
||||
UPDATE sys_job
|
||||
<set>
|
||||
<if test="jobName != null and jobName != ''">
|
||||
job_name = #{jobName},
|
||||
</if>
|
||||
<if test="jobGroup != null and jobGroup != ''">
|
||||
job_group = #{jobGroup},
|
||||
</if>
|
||||
<if test="invokeTarget != null and invokeTarget != ''">
|
||||
invoke_target = #{invokeTarget},
|
||||
</if>
|
||||
<if test="cronExpression != null and cronExpression != ''">
|
||||
cron_expression = #{cronExpression},
|
||||
</if>
|
||||
<if test="misfirePolicy != null and misfirePolicy != ''">
|
||||
misfire_policy = #{misfirePolicy},
|
||||
</if>
|
||||
<if test="concurrent != null and concurrent != ''">
|
||||
concurrent = #{concurrent},
|
||||
</if>
|
||||
<if test="status !=null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
remark = #{remark},
|
||||
</if>
|
||||
<if test="updateBy != null and updateBy != ''">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
update_time = now()
|
||||
</set>
|
||||
WHERE job_id = #{jobId}
|
||||
</update>
|
||||
|
||||
<!--新增定时任务-->
|
||||
<insert id="insertJob" useGeneratedKeys="true" keyProperty="jobId">
|
||||
INSERT INTO sys_job
|
||||
(job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent,
|
||||
status, create_by, create_time, update_by, update_time)
|
||||
VALUES
|
||||
(null, #{jobName}, #{jobGroup}, #{invokeTarget}, #{cronExpression}, #{misfirePolicy}, #{concurrent},
|
||||
#{status}, #{createBy}, now(), #{updateBy}, #{updateTime})
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?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.business.mapper.YwMonthTransactionMapper">
|
||||
|
||||
<!--获取月度直接交易列表-->
|
||||
<select id="getTransactionList" resultType="java.util.Map">
|
||||
SELECT transaction_name value, transaction_name label
|
||||
FROM
|
||||
yw_month_transaction_notice
|
||||
</select>
|
||||
|
||||
<!--获取交易公告-->
|
||||
<select id="getTransactionNotice" resultType="java.util.Map">
|
||||
SELECT transaction_type transactionType, DATE_FORMAT(organize_time, '%Y-%m-%d') organizeTime,
|
||||
CONCAT(DATE_FORMAT(organize_time, '%Y-%m-%d'), ' ', DATE_FORMAT(start_time, '%H:%i:%s')) startTime,
|
||||
CONCAT(DATE_FORMAT(organize_time, '%Y-%m-%d'), ' ', DATE_FORMAT(end_time, '%H:%i:%s')) endTime,
|
||||
IFNULL(seller_admit, 0) sellerAdmit, IFNULL(buyer_admit, 0) buyerAdmit, transaction_cycle transactionCycle,
|
||||
DATE_FORMAT(report_time, '%Y-%m-%d') reportTime
|
||||
FROM
|
||||
yw_month_transaction_notice
|
||||
WHERE
|
||||
transaction_name = #{transactionName}
|
||||
</select>
|
||||
|
||||
<!--根据月份获取购方竞价数据-->
|
||||
<select id="getBuyerData" resultType="java.util.Map">
|
||||
SELECT report_number reportNumber, max_report_price maxReportPrice, min_report_price minReportPrice,
|
||||
total_report_elec totalReportElec, avg_report_price avgReportPrice
|
||||
FROM
|
||||
yw_month_transaction_buyer_bidding_data
|
||||
WHERE
|
||||
month LIKE CONCAT('%', #{month}, '%')
|
||||
<if test="transactionType == 300">
|
||||
AND type LIKE CONCAT('%', '燃煤', '%')
|
||||
</if>
|
||||
<if test="transactionType == 500">
|
||||
AND type LIKE CONCAT('%', '燃气', '%')
|
||||
</if>
|
||||
<if test="monthFlag != ''">
|
||||
AND type LIKE CONCAT('%', '月内', '%')
|
||||
</if>
|
||||
<if test="monthFlag == ''">
|
||||
AND type NOT LIKE CONCAT('%', '月内', '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--根据月份获取购方竞价明细-->
|
||||
<select id="getBuyerDet" resultType="java.util.Map">
|
||||
SELECT company_name companyName, report_elec reportElec, report_price reportPrice,
|
||||
DATE_FORMAT(report_time, '%Y-%m-%d %H:%i:%s') reportTime
|
||||
FROM
|
||||
yw_month_transaction_buyer_bidding_det
|
||||
<where>
|
||||
month LIKE CONCAT('%', #{month}, '%')
|
||||
AND
|
||||
report_price >= #{transactionType}
|
||||
<if test="monthFlag != ''">
|
||||
AND unit_name LIKE CONCAT('%', #{monthFlag}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!--根据月份获取售方竞价数据-->
|
||||
<select id="getSellerData" resultType="java.util.Map">
|
||||
SELECT report_number reportNumber, max_report_price maxReportPrice, min_report_price minReportPrice,
|
||||
total_report_elec totalReportElec, avg_report_Price avgReportPrice
|
||||
FROM
|
||||
yw_month_transaction_seller_bidding_data
|
||||
WHERE
|
||||
month LIKE CONCAT('%', #{month}, '%')
|
||||
<if test="transactionType == 300">
|
||||
AND type LIKE CONCAT('%', '燃煤', '%')
|
||||
</if>
|
||||
<if test="transactionType == 500">
|
||||
AND type LIKE CONCAT('%', '燃气', '%')
|
||||
</if>
|
||||
<if test="monthFlag != ''">
|
||||
AND type LIKE CONCAT('%', '月内', '%')
|
||||
</if>
|
||||
<if test="monthFlag == ''">
|
||||
AND type NOT LIKE CONCAT('%', '月内', '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--根据月份获取售方竞价明细-->
|
||||
<select id="getSellerDet" resultType="java.util.Map">
|
||||
SELECT company_name companyName, report_elec reportElec, report_price reportPrice,
|
||||
DATE_FORMAT(report_time, '%Y-%m-%d %H:%i:%s') reportTime
|
||||
FROM
|
||||
yw_month_transaction_seller_bidding_det
|
||||
<where>
|
||||
month LIKE CONCAT('%', #{month}, '%')
|
||||
AND
|
||||
report_price >= #{transactionType}
|
||||
<if test="monthFlag != ''">
|
||||
AND unit_name LIKE CONCAT('%', #{monthFlag}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user