ReportTableMapper.xml 1.93 KB
<?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.lhcredit.project.business.reportTable.mapper.ReportTableMapper">
    <update id="updateReport">
        UPDATE
        b_report_table
        <set>
            <if test="reportTable.reportName !=null and reportTable.reportName != ''">
                 report_name = #{reportTable.reportName}
            </if>
            <if test="reportTable.notice !=null and reportTable.notice != ''">
                 notice = #{reportTable.notice}
            </if>
            <if test="reportTable.title !=null and reportTable.title != ''">
                 title = #{reportTable.title}
            </if>
            <if test="reportTable.imageUrl !=null and reportTable.imageUrl != ''">
                 image_url = #{reportTable.imageUrl}
            </if>
            <if test="reportTable.type !=null and reportTable.type != ''">
                 `type` = #{reportTable.type}
            </if>
            <if test="reportTable.sample !=null and reportTable.sample != ''">
                sample = #{reportTable.sample}
            </if>
            <if test="reportTable.isDel !=null and reportTable.isDel != ''">
                is_del = #{reportTable.isDel}
            </if>
            where id = #{reportTable.id}
        </set>
    </update>

    <select id="findAllReportTable" resultType="com.lhcredit.project.business.reportTable.domain.ReportTable">
        SELECT
            id,
            report_name as reportName,
            notice,
            title,
            image_url as imageUrl,
            type,
            sample,
            is_del as isDel
        FROM
            b_report_table
            <where>
                <if test="isDel != null and isDel != '' ">
                    is_del = #{isDel}
                </if>
            </where>
    </select>
</mapper>