Newer
Older
huludao / src / main / resources / mapper / project / ProjectStandardAreaMapper.xml
<?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.xf.huludao.project.dao.ProjectStandardAreaMapper">

    <!-- 通用映射列 -->
    <resultMap id="BaseResultMap" type="com.xf.huludao.project.entity.ProjectStandardArea">
        <result column="id" property="id"/>
        <result column="standard_name" property="standardName"/>
        <result column="standard_value" property="standardValue"/>
        <result column="type" property="type"/>
        <result column="create_time" property="createTime"/>
        <result column="create_user" property="createUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="status" property="status"/>
        <result column="create_dept" property="createDept"/>
    </resultMap>

    <!-- 通用数据库列 -->
    <sql id="Base_Column_List">
              id,
              standard_name,
              standard_value,
              `type`,
              create_time,
              create_user,
              update_time,
              update_user,
              is_deleted,
              status,
              create_dept
          </sql>

    <sql id="Where_Condition">
        <if test="request.id != null and request.id != ''">
            and id = #{request.id}
        </if>
        <if test="request.standardName != null and request.standardName != ''">
            and standard_name = #{request.standardName}
        </if>
        <if test="request.standardValue != null and request.standardValue != ''">
            and standard_value = #{request.standardValue}
        </if>
        <if test="request.type != null and request.type != ''">
            and `type` = #{request.type}
        </if>
        <if test="request.createTime != null and request.createTime != ''">
            and create_time = #{request.createTime}
        </if>
        <if test="request.createUser != null and request.createUser != ''">
            and create_user = #{request.createUser}
        </if>
        <if test="request.updateTime != null and request.updateTime != ''">
            and update_time = #{request.updateTime}
        </if>
        <if test="request.updateUser != null and request.updateUser != ''">
            and update_user = #{request.updateUser}
        </if>
        <if test="request.isDeleted != null and request.isDeleted != ''">
            and is_deleted = #{request.isDeleted}
        </if>
        <if test="request.status != null and request.status != ''">
            and status = #{request.status}
        </if>
        <if test="request.createDept != null and request.createDept != ''">
            and create_dept = #{request.createDept}
        </if>
    </sql>

    <select id="selectByCondition" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from project_standard_area
        where is_deleted = 0
        <include refid="Where_Condition"/>
        order by create_time
    </select>

    <select id="exportProjectStandardArea" resultType="com.xf.huludao.project.entity.ProjectStandardArea">
        SELECT * FROM project_standard_area ${ew.customSqlSegment}
    </select>
</mapper>