d27d9228c282923fd3030208c6b7ea00e09d461a.svn-base 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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.BisInspWorkInfoDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspWorkInfo" id="bisInspWorkInfoResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="name" column="NAME"/>
  7. <result property="type" column="TYPE"/>
  8. <result property="code" column="CODE"/>
  9. <result property="lon" column="LON"/>
  10. <result property="lat" column="LAT"/>
  11. <result property="persId" column="PERS_ID"/>
  12. <result property="sttm" column="STTM"/>
  13. <result property="entm" column="ENTM"/>
  14. <result property="objId" column="OBJ_ID"/>
  15. </resultMap>
  16. <sql id="table_columns">
  17. ID,
  18. NAME,
  19. TYPE,
  20. CODE,
  21. LON,
  22. LAT,
  23. PERS_ID,STTM,ENTM,OBJ_ID
  24. </sql>
  25. <sql id="entity_properties">
  26. #{id},
  27. #{name},
  28. #{type},
  29. #{code},
  30. #{lon},
  31. #{lat},
  32. #{persId},#{sttm},#{entm},#{objId}
  33. </sql>
  34. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  35. <sql id="page_where">
  36. <trim prefix="where" prefixOverrides="and | or ">
  37. <if test="name != null and name != ''">and NAME = #{name}</if>
  38. <if test="type != null and type != ''">and TYPE = #{type}</if>
  39. <if test="code != null and code != ''">and CODE = #{code}</if>
  40. <if test="lon != null and lon != ''">and LON = #{lon}</if>
  41. <if test="lat != null and lat != ''">and LAT = #{lat}</if>
  42. <if test="persId != null and persId != ''">and PERS_ID = #{persId}</if>
  43. <if test="sttm != null and sttm != ''">and STTM = #{sttm}</if>
  44. <if test="entm != null and entm != ''">and ENTM = #{entm}</if>
  45. <if test="objId != null and objId != ''">and OBJ_ID = #{objId}</if>
  46. </trim>
  47. </sql>
  48. <select id="get" resultMap="bisInspWorkInfoResultMap" parameterType="String" >
  49. select <include refid="table_columns" /> from BIS_INSP_WORK_INFO where ID = #{id}
  50. </select>
  51. <select id="getBy" resultMap="bisInspWorkInfoResultMap">
  52. select <include refid="table_columns" /> from BIS_INSP_WORK_INFO <include refid="page_where" />
  53. </select>
  54. <select id="findAll" resultMap="bisInspWorkInfoResultMap">
  55. select <include refid="table_columns" /> from BIS_INSP_WORK_INFO
  56. </select>
  57. <select id="findList" resultMap="bisInspWorkInfoResultMap">
  58. select <include refid="table_columns" /> from BIS_INSP_WORK_INFO <include refid="page_where" />
  59. </select>
  60. <select id="selectCount" resultType="int" >
  61. select count(ID) from BIS_INSP_WORK_INFO <include refid="page_where" />
  62. </select>
  63. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspWorkInfo">
  64. insert into BIS_INSP_WORK_INFO( <include refid="table_columns" /> )
  65. values ( <include refid="entity_properties" /> )
  66. </insert>
  67. <delete id="delete" parameterType="java.lang.String">
  68. delete from BIS_INSP_WORK_INFO where ID = #{id}
  69. </delete>
  70. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWorkInfo">
  71. delete from BIS_INSP_WORK_INFO <include refid="page_where" />
  72. </delete>
  73. <update id="deleteInFlag" parameterType="java.lang.String">
  74. update BIS_INSP_WORK_INFO set flag_valid = 0 where ID = #{id}
  75. </update>
  76. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspWorkInfo">
  77. update BIS_INSP_WORK_INFO
  78. <trim prefix="set" suffixOverrides=",">
  79. <if test="name != null and name != ''">NAME = #{name},</if>
  80. <if test="type != null and type != ''">TYPE = #{type},</if>
  81. <if test="code != null and code != ''">CODE = #{code},</if>
  82. <if test="lon != null and lon != ''">LON = #{lon},</if>
  83. <if test="lat != null and lat != ''">LAT = #{lat},</if>
  84. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  85. <if test="sttm != null and sttm != ''">STTM = #{sttm},</if>
  86. <if test="entm != null and entm != ''">ENTM = #{entm},</if>
  87. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  88. </trim>
  89. <where>ID = #{id}</where>
  90. </update>
  91. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspWorkInfo">
  92. update BIS_INSP_WORK_INFO
  93. <trim prefix="set" suffixOverrides=",">
  94. <if test="name != null and name != ''">NAME = #{name},</if>
  95. <if test="type != null and type != ''">TYPE = #{type},</if>
  96. <if test="code != null and code != ''">CODE = #{code},</if>
  97. <if test="lon != null and lon != ''">LON = #{lon},</if>
  98. <if test="lat != null and lat != ''">LAT = #{lat},</if>
  99. <if test="persId != null and persId != ''">PERS_ID = #{persId},</if>
  100. <if test="sttm != null and sttm != ''">STTM = #{sttm},</if>
  101. <if test="entm != null and entm != ''">ENTM = #{entm},</if>
  102. <if test="objId != null and objId != ''">OBJ_ID = #{objId},</if>
  103. </trim>
  104. <include refid="page_where" />
  105. </update>
  106. <!-- 其他自定义SQL -->
  107. </mapper>