PersPositionLatestDao.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.com.goldenwater.dcproj.dao.PersPositionLatestDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.PersPositionLatest" id="persPositionLatestResultMap">
  5. <result property="persId" column="PERS_ID"/>
  6. <result property="orgId" column="ORG_ID"/>
  7. <result property="groupId" column="GROUP_ID"/>
  8. <result property="persName" column="PERS_NAME"/>
  9. <result property="mobile" column="MOBILE"/>
  10. <result property="operateTime" column="OPERATE_TIME"/>
  11. <result property="adCode" column="AD_CODE"/>
  12. <result property="longitude" column="LONGITUDE"/>
  13. <result property="latitude" column="LATITUDE"/>
  14. <result property="lon" column="LON"/>
  15. <result property="lat" column="LAT"/>
  16. <result property="address" column="ADDRESS"/>
  17. </resultMap>
  18. <sql id="table_columns">
  19. PERS_ID,
  20. ORG_ID,
  21. GROUP_ID,
  22. PERS_NAME,
  23. MOBILE,
  24. OPERATE_TIME,
  25. AD_CODE,
  26. LONGITUDE,
  27. LATITUDE,
  28. LON,
  29. LAT,
  30. ADDRESS
  31. </sql>
  32. <sql id="entity_properties">
  33. #{persId},
  34. #{orgId},
  35. #{groupId},
  36. #{persName},
  37. #{mobile},
  38. #{operateTime},
  39. #{adCode},
  40. #{longitude},
  41. #{latitude},
  42. #{lon},
  43. #{lat},
  44. #{address}
  45. </sql>
  46. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  47. <sql id="page_where">
  48. <trim prefix="where" prefixOverrides="and | or ">
  49. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  50. <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
  51. <if test="groupId != null and groupId != ''">and GROUP_ID = #{groupId}</if>
  52. <if test="persName != null and persName != ''">and PERS_NAME = #{persName}</if>
  53. <if test="mobile != null and mobile != ''">and MOBILE = #{mobile}</if>
  54. <if test="operateTime != null">and OPERATE_TIME = #{operateTime}</if>
  55. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  56. <if test="longitude != null and longitude != ''">and LONGITUDE = #{longitude}</if>
  57. <if test="latitude != null and latitude != ''">and LATITUDE = #{latitude}</if>
  58. <if test="lon != null and lon != ''">and LON = #{lon}</if>
  59. <if test="lat != null and lat != ''">and LAT = #{lat}</if>
  60. </trim>
  61. </sql>
  62. <select id="get" resultMap="persPositionLatestResultMap" parameterType="String">
  63. select
  64. <include refid="table_columns"/>
  65. from pers_position_latest where PERS_ID = #{id}
  66. </select>
  67. <select id="getBy" resultMap="persPositionLatestResultMap">
  68. select
  69. <include refid="table_columns"/>
  70. from pers_position_latest
  71. <include refid="page_where"/>
  72. </select>
  73. <select id="findAll" resultMap="persPositionLatestResultMap">
  74. select
  75. <include refid="table_columns"/>
  76. from pers_position_latest
  77. </select>
  78. <select id="findList" resultMap="persPositionLatestResultMap">
  79. select
  80. <include refid="table_columns"/>
  81. from pers_position_latest
  82. <include refid="page_where"/>
  83. </select>
  84. <select id="selectCount" resultType="int">
  85. select count(ID) from pers_position_latest
  86. <include refid="page_where"/>
  87. </select>
  88. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.PersPositionLatest">
  89. insert into pers_position_latest(
  90. <include refid="table_columns"/>
  91. )
  92. values (
  93. <include refid="entity_properties"/>
  94. )
  95. </insert>
  96. <delete id="delete" parameterType="java.lang.String">
  97. delete from pers_position_latest where ID = #{id}
  98. </delete>
  99. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.PersPositionLatest">
  100. delete from pers_position_latest
  101. <include refid="page_where"/>
  102. </delete>
  103. <update id="deleteInFlag" parameterType="java.lang.String">
  104. update pers_position_latest set flag_valid = 0 where ID = #{id}
  105. </update>
  106. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.PersPositionLatest">
  107. update pers_position_latest
  108. <trim prefix="set" suffixOverrides=",">
  109. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  110. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  111. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  112. <if test="mobile != null and mobile != ''">MOBILE = #{mobile},</if>
  113. <if test="operateTime != null">OPERATE_TIME = #{operateTime},</if>
  114. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  115. <if test="longitude != null and longitude != ''">LONGITUDE = #{longitude},</if>
  116. <if test="latitude != null and latitude != ''">LATITUDE = #{latitude},</if>
  117. <if test="lon != null and lon != ''">LON = #{lon},</if>
  118. <if test="lat != null and lat != ''">LAT = #{lat},</if>
  119. <if test="address != null">ADDRESS = #{address},</if>
  120. </trim>
  121. <where>PERS_ID = #{persId}</where>
  122. </update>
  123. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.PersPositionLatest">
  124. update pers_position_latest
  125. <trim prefix="set" suffixOverrides=",">
  126. <if test="orgId != null and orgId != ''">ORG_ID = #{orgId},</if>
  127. <if test="groupId != null and groupId != ''">GROUP_ID = #{groupId},</if>
  128. <if test="persName != null and persName != ''">PERS_NAME = #{persName},</if>
  129. <if test="mobile != null and mobile != ''">MOBILE = #{mobile},</if>
  130. <if test="operateTime != null">OPERATE_TIME = #{operateTime},</if>
  131. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  132. <if test="longitude != null and longitude != ''">LONGITUDE = #{longitude},</if>
  133. <if test="latitude != null and latitude != ''">LATITUDE = #{latitude},</if>
  134. <if test="lon != null and lon != ''">LON = #{lon},</if>
  135. <if test="lat != null and lat != ''">LAT = #{lat},</if>
  136. <if test="address != null">ADDRESS = #{address},</if>
  137. </trim>
  138. <include refid="page_where"/>
  139. </update>
  140. <!-- 其他自定义SQL -->
  141. </mapper>