StandardMapper.xml 1.52 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.ruoyi.mapper.StandardMapper">

    <resultMap id="BaseResultMap" type="com.ruoyi.domain.Standard">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="name" column="name" jdbcType="VARCHAR"/>
        <result property="standardNo" column="standard_no" jdbcType="VARCHAR"/>
        <result property="file" column="file" jdbcType="VARCHAR"/>
        <result property="standardType" column="standard_type" jdbcType="VARCHAR"/>
        <result property="standardStatus" column="standard_status" jdbcType="VARCHAR"/>
        <result property="releaseDate" column="release_date" jdbcType="TIMESTAMP"/>
        <result property="implementationDate" column="implementation_date" jdbcType="TIMESTAMP"/>
    </resultMap>

    <select id="findList" parameterType="com.ruoyi.web.request.StandardListRequest" resultMap="BaseResultMap">
        SELECT id, name, standard_no, file,standard_type,standard_status,release_date,implementation_date
        FROM t_standard
        <where>
            <if test="keyWord != null and keyWord != ''">
                name like concat('%',#{keyWord},'%') OR standard_no like concat('%',#{keyWord},'%')
            </if>
        </where>
    </select>

    <select id="findListById" resultMap="BaseResultMap">
        SELECT id, name, standard_no, file
        FROM t_standard WHERE id = #{id}
    </select>

</mapper>