AttZhejiangJgBaseDao.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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.AttZhejiangJgBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttZhejiangJgBase" id="attZhejiangJgBaseResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="departNm" column="DEPART_NM"/>
  7. <result property="adCode" column="AD_CODE"/>
  8. <result property="note" column="NOTE"/>
  9. <result property="dataStat" column="DATA_STAT"/>
  10. <result property="adFullName" column="AD_FULL_NAME"/>
  11. <result property="telphone" column="TELPHONE"/>
  12. <result property="lgtd" column="LGTD"/>
  13. <result property="lttd" column="LTTD"/>
  14. <result property="lgtdpc" column="LGTDPC"/>
  15. <result property="lttdpc" column="LTTDPC"/>
  16. <result property="createTime" column="CREATE_TIME"/>
  17. <result property="departNo" column="DEPART_NO"/>
  18. </resultMap>
  19. <sql id="table_columns">
  20. ID,
  21. DEPART_NM,
  22. AD_CODE,
  23. NOTE,
  24. DATA_STAT,
  25. AD_FULL_NAME,
  26. TELPHONE,
  27. LGTD,
  28. LTTD,
  29. LGTDPC,
  30. LTTDPC,
  31. CREATE_TIME,
  32. DEPART_NO
  33. </sql>
  34. <sql id="entity_properties">
  35. #{id},
  36. #{departNm},
  37. #{adCode},
  38. #{note},
  39. #{dataStat},
  40. #{adFullName},
  41. #{telphone},
  42. #{lgtd},
  43. #{lttd},
  44. #{lgtdpc},
  45. #{lttdpc},
  46. #{createTime},
  47. #{departNo}
  48. </sql>
  49. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  50. <sql id="page_where">
  51. <trim prefix="where" prefixOverrides="and | or ">
  52. <if test="departNm != null and departNm != ''">and DEPART_NM = #{departNm}</if>
  53. <if test="adCode != null and adCode != ''">and AD_CODE = #{adCode}</if>
  54. <if test="note != null and note != ''">and NOTE = #{note}</if>
  55. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  56. <if test="adFullName != null and adFullName != ''">and AD_FULL_NAME = #{adFullName}</if>
  57. <if test="telphone != null and telphone != ''">and TELPHONE = #{telphone}</if>
  58. <if test="lgtd != null and lgtd != ''">and LGTD = #{lgtd}</if>
  59. <if test="lttd != null and lttd != ''">and LTTD = #{lttd}</if>
  60. <if test="lgtdpc != null and lgtdpc != ''">and LGTDPC = #{lgtdpc}</if>
  61. <if test="lttdpc != null and lttdpc != ''">and LTTDPC = #{lttdpc}</if>
  62. <if test="createTime != null and createTime != ''">and CREATE_TIME = #{createTime}</if>
  63. <if test="departNo != null and departNo != ''">and DEPART_NO = #{departNo}</if>
  64. </trim>
  65. </sql>
  66. <select id="get" resultMap="attZhejiangJgBaseResultMap" parameterType="String" >
  67. select <include refid="table_columns" /> from Att_ZHEJIANG_JG_base where ID = #{id}
  68. </select>
  69. <select id="getBy" resultMap="attZhejiangJgBaseResultMap">
  70. select <include refid="table_columns" /> from Att_ZHEJIANG_JG_base <include refid="page_where" />
  71. </select>
  72. <select id="findAll" resultMap="attZhejiangJgBaseResultMap">
  73. select <include refid="table_columns" /> from Att_ZHEJIANG_JG_base
  74. </select>
  75. <select id="findList" resultMap="attZhejiangJgBaseResultMap">
  76. select <include refid="table_columns" /> from Att_ZHEJIANG_JG_base <include refid="page_where" />
  77. </select>
  78. <select id="selectCount" resultType="int" >
  79. select count(ID) from Att_ZHEJIANG_JG_base <include refid="page_where" />
  80. </select>
  81. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttZhejiangJgBase">
  82. insert into Att_ZHEJIANG_JG_base( <include refid="table_columns" /> )
  83. values ( <include refid="entity_properties" /> )
  84. </insert>
  85. <delete id="delete" parameterType="java.lang.String">
  86. delete from Att_ZHEJIANG_JG_base where ID = #{id}
  87. </delete>
  88. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttZhejiangJgBase">
  89. delete from Att_ZHEJIANG_JG_base <include refid="page_where" />
  90. </delete>
  91. <update id="deleteInFlag" parameterType="java.lang.String">
  92. update Att_ZHEJIANG_JG_base set flag_valid = 0 where ID = #{id}
  93. </update>
  94. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttZhejiangJgBase">
  95. update Att_ZHEJIANG_JG_base
  96. <trim prefix="set" suffixOverrides=",">
  97. <if test="departNm != null and departNm != ''">DEPART_NM = #{departNm},</if>
  98. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  99. <if test="note != null and note != ''">NOTE = #{note},</if>
  100. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  101. <if test="adFullName != null and adFullName != ''">AD_FULL_NAME = #{adFullName},</if>
  102. <if test="telphone != null and telphone != ''">TELPHONE = #{telphone},</if>
  103. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  104. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  105. <if test="lgtdpc != null and lgtdpc != ''">LGTDPC = #{lgtdpc},</if>
  106. <if test="lttdpc != null and lttdpc != ''">LTTDPC = #{lttdpc},</if>
  107. <if test="createTime != null and createTime != ''">CREATE_TIME = #{createTime},</if>
  108. <if test="departNo != null and departNo != ''">DEPART_NO = #{departNo},</if>
  109. </trim>
  110. <where>ID = #{id}</where>
  111. </update>
  112. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttZhejiangJgBase">
  113. update Att_ZHEJIANG_JG_base
  114. <trim prefix="set" suffixOverrides=",">
  115. <if test="departNm != null and departNm != ''">DEPART_NM = #{departNm},</if>
  116. <if test="adCode != null and adCode != ''">AD_CODE = #{adCode},</if>
  117. <if test="note != null and note != ''">NOTE = #{note},</if>
  118. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  119. <if test="adFullName != null and adFullName != ''">AD_FULL_NAME = #{adFullName},</if>
  120. <if test="telphone != null and telphone != ''">TELPHONE = #{telphone},</if>
  121. <if test="lgtd != null and lgtd != ''">LGTD = #{lgtd},</if>
  122. <if test="lttd != null and lttd != ''">LTTD = #{lttd},</if>
  123. <if test="lgtdpc != null and lgtdpc != ''">LGTDPC = #{lgtdpc},</if>
  124. <if test="lttdpc != null and lttdpc != ''">LTTDPC = #{lttdpc},</if>
  125. <if test="createTime != null and createTime != ''">CREATE_TIME = #{createTime},</if>
  126. <if test="departNo != null and departNo != ''">DEPART_NO = #{departNo},</if>
  127. </trim>
  128. <include refid="page_where" />
  129. </update>
  130. <!-- 其他自定义SQL -->
  131. </mapper>