Newer
Older
huludao / src / main / resources / mapper / project / ProjectStandardConfigMapper.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.ProjectStandardConfigMapper">

    <!-- 通用映射列 -->
    <resultMap id="BaseResultMap" type="com.xf.huludao.project.entity.ProjectStandardConfig">
        <result column="id" property="id"/>
        <result column="area_id" property="areaId"/>
        <result column="config_name" property="configName"/>
        <result column="gis_area" property="gisArea"/>
        <result column="area_size" property="areaSize"/>
        <result column="duty_user" property="dutyUser"/>
        <result column="duty_user_name" property="dutyUserName"/>
        <result column="duty_user_phone" property="dutyUserPhone"/>
        <result column="lon" property="lon"/>
        <result column="lat" property="lat"/>
        <result column="address" property="address"/>
        <result column="data_before" property="dataBefore"/>
        <result column="data_after" property="dataAfter"/>
        <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,
              area_id,
              config_name,
              gis_area,
              area_size,
              duty_user,
              duty_user_name,
              duty_user_phone,
              lon,
              lat,
              address,
              data_before,
              data_after,
              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.areaId != null and request.areaId != ''">
            and area_id = #{request.areaId}
        </if>
        <if test="request.configName != null and request.configName != ''">
            and config_name = #{request.configName}
        </if>
        <if test="request.gisArea != null and request.gisArea != ''">
            and gis_area = #{request.gisArea}
        </if>
        <if test="request.areaSize != null and request.areaSize != ''">
            and area_size = #{request.areaSize}
        </if>
        <if test="request.dutyUser != null and request.dutyUser != ''">
            and duty_user = #{request.dutyUser}
        </if>
        <if test="request.dutyUserName != null and request.dutyUserName != ''">
            and duty_user_name = #{request.dutyUserName}
        </if>
        <if test="request.dutyUserPhone != null and request.dutyUserPhone != ''">
            and duty_user_phone = #{request.dutyUserPhone}
        </if>
        <if test="request.lon != null and request.lon != ''">
            and lon = #{request.lon}
        </if>
        <if test="request.lat != null and request.lat != ''">
            and lat = #{request.lat}
        </if>
        <if test="request.address != null and request.address != ''">
            and address = #{request.address}
        </if>
        <if test="request.dataBefore != null and request.dataBefore != ''">
            and data_before = #{request.dataBefore}
        </if>
        <if test="request.dataAfter != null and request.dataAfter != ''">
            and data_after = #{request.dataAfter}
        </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_config
        where is_deleted = 0
        <include refid="Where_Condition"/>
    </select>

    <select id="exportProjectStandardConfig" resultType="com.xf.huludao.project.entity.ProjectStandardConfig">
        SELECT * FROM project_standard_config ${ew.customSqlSegment}
    </select>
</mapper>