From a0688f29bd13e53fc02a6b9c89ac501864107533 Mon Sep 17 00:00:00 2001
From: 沈斌 <bluelazysb@hotmail.com>
Date: Sat, 11 Nov 2017 13:12:29 +0800
Subject: [PATCH] test
---
src/main/resources/mapper/MonitorPointDao.xml | 61 +++++++++++++++++++++++++++++-
1 files changed, 59 insertions(+), 2 deletions(-)
diff --git a/src/main/resources/mapper/MonitorPointDao.xml b/src/main/resources/mapper/MonitorPointDao.xml
index 26dc364..45d8612 100644
--- a/src/main/resources/mapper/MonitorPointDao.xml
+++ b/src/main/resources/mapper/MonitorPointDao.xml
@@ -1,8 +1,65 @@
<?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.moral.monitor.dao.MonitorPointDao">
-
+<mapper namespace="com.moral.monitor.dao.MonitorpointDao">
+ <resultMap id="BaseResultMap" type="com.moral.monitor.entity.MonitorPoint">
+ <id column="id" jdbcType="VARCHAR" property="id" />
+ <result column="name" jdbcType="VARCHAR" property="name" />
+ <result column="longitude" jdbcType="DOUBLE" property="longitude" />
+ <result column="latitude" jdbcType="DOUBLE" property="latitude" />
+ <result column="provincecode" jdbcType="VARCHAR" property="provincecode" />
+ <result column="citycode" jdbcType="VARCHAR" property="citycode" />
+ <result column="areacode" jdbcType="VARCHAR" property="areacode" />
+ <result column="address" jdbcType="VARCHAR" property="address" />
+ <result column="repairman" jdbcType="VARCHAR" property="repairman" />
+ <result column="region_description" jdbcType="VARCHAR" property="regionDescription" />
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+ <result column="owner" jdbcType="VARCHAR" property="owner" />
+ </resultMap>
+ <sql id="Example_Where_Clause">
+ <where>
+ <foreach collection="oredCriteria" item="criteria" separator="or">
+ <if test="criteria.valid">
+ <trim prefix="(" prefixOverrides="and" suffix=")">
+ <foreach collection="criteria.criteria" item="criterion">
+ <choose>
+ <when test="criterion.noValue">
+ and ${criterion.condition}
+ </when>
+ <when test="criterion.singleValue">
+ and ${criterion.condition} #{criterion.value}
+ </when>
+ <when test="criterion.betweenValue">
+ and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+ </when>
+ <when test="criterion.listValue">
+ and ${criterion.condition}
+ <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+ #{listItem}
+ </foreach>
+ </when>
+ </choose>
+ </foreach>
+ </trim>
+ </if>
+ </foreach>
+ </where>
+ </sql>
+ <select id="selectByExample" parameterType="com.moral.monitor.entity.MonitorPointExample" resultMap="BaseResultMap">
+ select
+ <if test="distinct">
+ distinct
+ </if>
+ monitorpoint.*
+ from monitorpoint
+ LEFT JOIN area ON monitorpoint.areacode = area.`code`
+ <if test="_parameter != null">
+ <include refid="Example_Where_Clause" />
+ </if>
+ <if test="orderByClause != null">
+ order by ${orderByClause}
+ </if>
+ </select>
<!--���������������-->
<select id="allMonitorPoint" parameterType="com.moral.monitor.entity.QueryHelper" resultType="com.moral.monitor.entity.MonitorPoint">
select * from monitorpoint
--
Gitblit v1.8.0