| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <?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="cn.com.goldenwater.dcproj.dao.PersPositionLatestDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.PersPositionLatest" id="persPositionLatestResultMap">
- <result property="persId" column="PERS_ID"/>
- <result property="orgId" column="ORG_ID"/>
- <result property="groupId" column="GROUP_ID"/>
- <result property="persName" column="PERS_NAME"/>
- <result property="mobile" column="MOBILE"/>
- <result property="operateTime" column="OPERATE_TIME"/>
- <result property="adCode" column="AD_CODE"/>
- <result property="longitude" column="LONGITUDE"/>
- <result property="latitude" column="LATITUDE"/>
- <result property="lon" column="LON"/>
- <result property="lat" column="LAT"/>
- <result property="address" column="ADDRESS"/>
- </resultMap>
- <sql id="table_columns">
- PERS_ID,
- ORG_ID,
- GROUP_ID,
- PERS_NAME,
- MOBILE,
- OPERATE_TIME,
- AD_CODE,
- LONGITUDE,
- LATITUDE,
- LON,
- LAT,
- ADDRESS
- </sql>
- <sql id="entity_properties">
- #{persId},
- #{orgId},
- #{groupId},
- #{persName},
- #{mobile},
- #{operateTime},
- #{adCode},
- #{longitude},
- #{latitude},
- #{lon},
- #{lat},
- #{address}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
- <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
- <if test="mobile != null and mobile != ''">and MOBILE = #{mobile}</if>
- <if test="operateTime != null">and OPERATE_TIME = #{operateTime}</if>
- <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
- <if test="longitude != null and longitude != ''">and LONGITUDE = #{longitude}</if>
- <if test="latitude != null and latitude != ''">and LATITUDE = #{latitude}</if>
- <if test="lon != null and lon != ''">and LON = #{lon}</if>
- <if test="lat != null and lat != ''">and LAT = #{lat}</if>
- </trim>
- </sql>
- <select id="get" resultMap="persPositionLatestResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from pers_position_latest where PERS_ID = #{id}
- </select>
- <select id="getBy" resultMap="persPositionLatestResultMap">
- select
- <include refid="table_columns"/>
- from pers_position_latest
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="persPositionLatestResultMap">
- select
- <include refid="table_columns"/>
- from pers_position_latest
- </select>
- <select id="findList" resultMap="persPositionLatestResultMap">
- select
- <include refid="table_columns"/>
- from pers_position_latest
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from pers_position_latest
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.PersPositionLatest">
- insert into pers_position_latest(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from pers_position_latest where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.PersPositionLatest">
- delete from pers_position_latest
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update pers_position_latest set flag_valid = 0 where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.PersPositionLatest">
- update pers_position_latest
- <trim prefix="set" suffixOverrides=",">
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
- <if test="mobile != null and mobile != ''">MOBILE = #{mobile},</if>
- <if test="operateTime != null">OPERATE_TIME = #{operateTime},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="longitude != null and longitude != ''">LONGITUDE = #{longitude},</if>
- <if test="latitude != null and latitude != ''">LATITUDE = #{latitude},</if>
- <if test="lon != null and lon != ''">LON = #{lon},</if>
- <if test="lat != null and lat != ''">LAT = #{lat},</if>
- <if test="address != null">ADDRESS = #{address},</if>
- </trim>
- <where>PERS_ID = #{persId}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.PersPositionLatest">
- update pers_position_latest
- <trim prefix="set" suffixOverrides=",">
- <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
- <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
- <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
- <if test="mobile != null and mobile != ''">MOBILE = #{mobile},</if>
- <if test="operateTime != null">OPERATE_TIME = #{operateTime},</if>
- <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
- <if test="longitude != null and longitude != ''">LONGITUDE = #{longitude},</if>
- <if test="latitude != null and latitude != ''">LATITUDE = #{latitude},</if>
- <if test="lon != null and lon != ''">LON = #{lon},</if>
- <if test="lat != null and lat != ''">LAT = #{lat},</if>
- <if test="address != null">ADDRESS = #{address},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- </mapper>
|