|
@@ -31,4 +31,98 @@
|
|
|
<include refid="selectStatisticReportVo"/>
|
|
|
where id = #{id} and is_del = "N"
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+ <resultMap type="com.boman.domain.dto.StatisticReportDto" id="ReportDtoResult">
|
|
|
+ <id property="id" column="id"/>
|
|
|
+ <result property="name" column="name"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectReportVo">
|
|
|
+ select * from statistic_report
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectList" parameterType="com.boman.domain.entity.StatisticReport" resultMap="StatisticReportResult">
|
|
|
+ <include refid="selectReportVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ AND id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null and createBy != ''">
|
|
|
+ AND create_by = #{createBy}
|
|
|
+ </if>
|
|
|
+ <if test="reportName != null and reportName != ''">
|
|
|
+ AND lower(report_name) like lower(concat('%', #{reportName}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="sTime != null and sTime != ''">
|
|
|
+ AND date_format(start_time, '%Y-%m-%d') <= #{sTime}
|
|
|
+ </if>
|
|
|
+ <if test="eTime != null and eTime != ''">
|
|
|
+ AND date_format(end_time, '%Y-%m-%d') >= #{eTime}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''">
|
|
|
+ AND status = #{status}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by create_time DESC
|
|
|
+ limit
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="com.boman.domain.entity.StatisticReport" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into statistic_report
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="reportName != null and reportName != ''">report_name,</if>
|
|
|
+ <if test="reportId != null">report_id,</if>
|
|
|
+ <if test="templateName != null">template_name,</if>
|
|
|
+ <if test="startTime != null">start_time,</if>
|
|
|
+ <if test="endTime != null">end_time,</if>
|
|
|
+ <if test="reportStatus != null">report_status,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="repUploadFile != null and repUploadFile != ''">rep_upload_file,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="reportName != null and reportName != ''">#{reportName},</if>
|
|
|
+ <if test="reportId != null">#{reportId},</if>
|
|
|
+ <if test="templateName != null">#{templateName},</if>
|
|
|
+ <if test="startTime != null">#{startTime},</if>
|
|
|
+ <if test="endTime != null">#{endTime},</if>
|
|
|
+ <if test="reportStatus != null">#{reportStatus},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="repUploadFile != null and repUploadFile != ''">#{repUploadFile},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="isDel != null">#{isDel},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="update" parameterType="com.boman.domain.entity.StatisticReport">
|
|
|
+ update statistic_report
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="reportName != null and reportName != ''">report_name = #{reportName},</if>
|
|
|
+ <if test="reportId != null">report_id = #{reportId},</if>
|
|
|
+ <if test="templateName != null">template_name = #{template_name},</if>
|
|
|
+ <if test="startTime != null">start_time = #{startTime},</if>
|
|
|
+ <if test="endTime == null">end_time = #{endTime},</if>
|
|
|
+ <if test="reportStatus != null">report_status = #{reportStatus},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="repUploadFile != null">rep_upload_file = #{repUploadFile},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="isDel != null">is_del = #{isDel},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="selectReportInfo" resultMap="ReportDtoResult" parameterType="java.lang.String">
|
|
|
+ select id, name from jimu_report where create_by = #{userName} order by create_by desc
|
|
|
+ </select>
|
|
|
+</mapper>
|