|
@@ -0,0 +1,115 @@
|
|
|
+<?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.xzl.system.mapper.RptDataConfigMapper">
|
|
|
+
|
|
|
+ <resultMap type="RptDataConfig" id="RptDataConfigResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="reportId" column="report_id" />
|
|
|
+ <result property="reportName" column="report_name" />
|
|
|
+ <result property="reportDataItem" column="report_data_item" />
|
|
|
+ <result property="reportDataName" column="report_data_name" />
|
|
|
+ <result property="reportDataField" column="report_data_field" />
|
|
|
+ <result property="reportDataValue" column="report_data_value" />
|
|
|
+ <result property="reportDataSource" column="report_data_source" />
|
|
|
+ <result property="reportDataNum" column="report_data_num" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="createdDate" column="created_date" />
|
|
|
+ <result property="lastModifiedBy" column="last_modified_by" />
|
|
|
+ <result property="lastModifiedDate" column="last_modified_date" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectRptDataConfigVo">
|
|
|
+ select id, report_id, report_name, report_data_item, report_data_name, report_data_field, report_data_value, report_data_source, report_data_num, create_by, created_date, last_modified_by, last_modified_date from rpt_data_config
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectRptDataConfigList" parameterType="RptDataConfig" resultMap="RptDataConfigResult">
|
|
|
+ <include refid="selectRptDataConfigVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="reportId != null and reportId != ''"> and report_id = #{reportId}</if>
|
|
|
+ <if test="reportName != null and reportName != ''"> and report_name like concat('%', #{reportName}, '%')</if>
|
|
|
+ <if test="reportDataItem != null and reportDataItem != ''"> and report_data_item = #{reportDataItem}</if>
|
|
|
+ <if test="reportDataName != null and reportDataName != ''"> and report_data_name like concat('%', #{reportDataName}, '%')</if>
|
|
|
+ <if test="reportDataField != null and reportDataField != ''"> and report_data_field = #{reportDataField}</if>
|
|
|
+ <if test="reportDataValue != null and reportDataValue != ''"> and report_data_value = #{reportDataValue}</if>
|
|
|
+ <if test="reportDataSource == null or reportDataSource == ''"> and report_data_source = '0'</if>
|
|
|
+ <if test="reportDataSource != null and reportDataSource != ''"> and report_data_source = #{reportDataSource}</if>
|
|
|
+ <if test="reportDataNum != null "> and report_data_num = #{reportDataNum}</if>
|
|
|
+ <if test="createdDate != null "> and created_date = #{createdDate}</if>
|
|
|
+ <if test="lastModifiedBy != null and lastModifiedBy != ''"> and last_modified_by = #{lastModifiedBy}</if>
|
|
|
+ <if test="lastModifiedDate != null "> and last_modified_date = #{lastModifiedDate}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectDistinctRptDataConfigList" parameterType="RptDataConfig" resultMap="RptDataConfigResult">
|
|
|
+ select distinct report_id, report_name from rpt_data_config order by report_data_num asc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectRptDataConfigById" parameterType="Long" resultMap="RptDataConfigResult">
|
|
|
+ <include refid="selectRptDataConfigVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertRptDataConfig" parameterType="RptDataConfig" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into rpt_data_config
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="reportId != null">report_id,</if>
|
|
|
+ <if test="reportName != null">report_name,</if>
|
|
|
+ <if test="reportDataItem != null">report_data_item,</if>
|
|
|
+ <if test="reportDataName != null">report_data_name,</if>
|
|
|
+ <if test="reportDataField != null">report_data_field,</if>
|
|
|
+ <if test="reportDataValue != null">report_data_value,</if>
|
|
|
+ <if test="reportDataSource != null">report_data_source,</if>
|
|
|
+ <if test="reportDataNum != null">report_data_num,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createdDate != null">created_date,</if>
|
|
|
+ <if test="lastModifiedBy != null">last_modified_by,</if>
|
|
|
+ <if test="lastModifiedDate != null">last_modified_date,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="reportId != null">#{reportId},</if>
|
|
|
+ <if test="reportName != null">#{reportName},</if>
|
|
|
+ <if test="reportDataItem != null">#{reportDataItem},</if>
|
|
|
+ <if test="reportDataName != null">#{reportDataName},</if>
|
|
|
+ <if test="reportDataField != null">#{reportDataField},</if>
|
|
|
+ <if test="reportDataValue != null">#{reportDataValue},</if>
|
|
|
+ <if test="reportDataSource != null">#{reportDataSource},</if>
|
|
|
+ <if test="reportDataNum != null">#{reportDataNum},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createdDate != null">#{createdDate},</if>
|
|
|
+ <if test="lastModifiedBy != null">#{lastModifiedBy},</if>
|
|
|
+ <if test="lastModifiedDate != null">#{lastModifiedDate},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateRptDataConfig" parameterType="RptDataConfig">
|
|
|
+ update rpt_data_config
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="reportId != null">report_id = #{reportId},</if>
|
|
|
+ <if test="reportName != null">report_name = #{reportName},</if>
|
|
|
+ <if test="reportDataItem != null">report_data_item = #{reportDataItem},</if>
|
|
|
+ <if test="reportDataName != null">report_data_name = #{reportDataName},</if>
|
|
|
+ <if test="reportDataField != null">report_data_field = #{reportDataField},</if>
|
|
|
+ <if test="reportDataValue != null">report_data_value = #{reportDataValue},</if>
|
|
|
+ <if test="reportDataSource != null">report_data_source = #{reportDataSource},</if>
|
|
|
+ <if test="reportDataNum != null">report_data_num = #{reportDataNum},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createdDate != null">created_date = #{createdDate},</if>
|
|
|
+ <if test="lastModifiedBy != null">last_modified_by = #{lastModifiedBy},</if>
|
|
|
+ <if test="lastModifiedDate != null">last_modified_date = #{lastModifiedDate},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteRptDataConfigById" parameterType="Long">
|
|
|
+ delete from rpt_data_config where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteRptDataConfigByIds" parameterType="String">
|
|
|
+ delete from rpt_data_config where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|