BisInspXjvillUsrDao.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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.BisInspXjvillUsrDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspXjvillUsr" id="bisInspXjvillUsrResultMap">
  5. <result property="rgstrId" column="RGSTR_ID"/>
  6. <result property="id" column="ID"/>
  7. <result property="regmId" column="REGM_ID"/>
  8. <result property="userNm" column="USER_NM"/>
  9. <result property="telphone" column="TELPHONE"/>
  10. <result property="loc" column="LOC"/>
  11. <result property="isInHome" column="IS_IN_HOME"/>
  12. <result property="isCalm" column="IS_CALM"/>
  13. <result property="isDay" column="IS_DAY"/>
  14. <result property="isEnough" column="IS_ENOUGH"/>
  15. <result property="isWell" column="IS_WELL"/>
  16. <result property="isImp" column="IS_IMP"/>
  17. <result property="isSmell" column="IS_SMELL"/>
  18. <result property="price" column="PRICE"/>
  19. <result property="isTel" column="IS_TEL"/>
  20. <result property="isSolve" column="IS_SOLVE"/>
  21. <result property="othr" column="OTHR"/>
  22. <result property="persId" column="PERS_ID"/>
  23. <result property="intm" column="INTM"/>
  24. <result property="uptm" column="UPTM"/>
  25. <result property="note" column="NOTE"/>
  26. <result property="dataStat" column="DATA_STAT"/>
  27. <result property="state" column="STATE"/>
  28. </resultMap>
  29. <sql id="table_columns">
  30. RGSTR_ID,
  31. ID,
  32. REGM_ID,
  33. USER_NM,
  34. TELPHONE,
  35. LOC,
  36. IS_IN_HOME,
  37. IS_CALM,
  38. IS_DAY,
  39. IS_ENOUGH,
  40. IS_WELL,
  41. IS_IMP,
  42. IS_SMELL,
  43. PRICE,
  44. IS_TEL,
  45. IS_SOLVE,
  46. OTHR,
  47. PERS_ID,
  48. INTM,
  49. UPTM,
  50. NOTE,
  51. DATA_STAT,
  52. STATE
  53. </sql>
  54. <sql id="entity_properties">
  55. #{rgstrId},
  56. #{id},
  57. #{regmId},
  58. #{userNm},
  59. #{telphone},
  60. #{loc},
  61. #{isInHome},
  62. #{isCalm},
  63. #{isDay},
  64. #{isEnough},
  65. #{isWell},
  66. #{isImp},
  67. #{isSmell},
  68. #{price},
  69. #{isTel},
  70. #{isSolve},
  71. #{othr},
  72. #{persId},
  73. #{intm},
  74. #{uptm},
  75. #{note},
  76. #{dataStat},
  77. #{state}
  78. </sql>
  79. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  80. <sql id="page_where">
  81. <trim prefix="where" prefixOverrides="and | or ">
  82. <if test="rgstrId != null and rgstrId != ''">
  83. and RGSTR_ID = #{rgstrId}
  84. </if>
  85. <if test="regmId != null and regmId != ''">
  86. and REGM_ID = #{regmId}
  87. </if>
  88. <if test="userNm != null and userNm != ''">
  89. and USER_NM = #{userNm}
  90. </if>
  91. <if test="telphone != null and telphone != ''">
  92. and TELPHONE = #{telphone}
  93. </if>
  94. <if test="loc != null and loc != ''">
  95. and LOC = #{loc}
  96. </if>
  97. <if test="isInHome != null and isInHome != ''">
  98. and IS_IN_HOME = #{isInHome}
  99. </if>
  100. <if test="isCalm != null and isCalm != ''">
  101. and IS_CALM = #{isCalm}
  102. </if>
  103. <if test="isDay != null and isDay != ''">
  104. and IS_DAY = #{isDay}
  105. </if>
  106. <if test="isEnough != null and isEnough != ''">
  107. and IS_ENOUGH = #{isEnough}
  108. </if>
  109. <if test="isWell != null and isWell != ''">
  110. and IS_WELL = #{isWell}
  111. </if>
  112. <if test="isImp != null and isImp != ''">
  113. and IS_IMP = #{isImp}
  114. </if>
  115. <if test="isSmell != null and isSmell != ''">
  116. and IS_SMELL = #{isSmell}
  117. </if>
  118. <if test="price != null and price != ''">
  119. and PRICE = #{price}
  120. </if>
  121. <if test="isTel != null and isTel != ''">
  122. and IS_TEL = #{isTel}
  123. </if>
  124. <if test="isSolve != null and isSolve != ''">
  125. and IS_SOLVE = #{isSolve}
  126. </if>
  127. <if test="othr != null and othr != ''">
  128. and OTHR = #{othr}
  129. </if>
  130. <if test="persId != null and persId != ''">
  131. and PERS_ID = #{persId}
  132. </if>
  133. <if test="intm != null">
  134. and INTM = #{intm}
  135. </if>
  136. <if test="uptm != null">
  137. and UPTM = #{uptm}
  138. </if>
  139. <if test="note != null and note != ''">
  140. and NOTE = #{note}
  141. </if>
  142. <if test="dataStat != null and dataStat != ''">
  143. and DATA_STAT = #{dataStat}
  144. </if>
  145. <if test="state != null and state != ''">
  146. and STATE = #{state}
  147. </if>
  148. and DATA_STAT='0'
  149. </trim>
  150. </sql>
  151. <select id="get" resultMap="bisInspXjvillUsrResultMap" parameterType="String">
  152. select
  153. <include refid="table_columns"/>
  154. from BIS_INSP_XJVILL_USR where ID = #{id}
  155. </select>
  156. <select id="getBy" resultMap="bisInspXjvillUsrResultMap">
  157. select
  158. <include refid="table_columns"/>
  159. from BIS_INSP_XJVILL_USR
  160. <include refid="page_where"/>
  161. </select>
  162. <select id="findAll" resultMap="bisInspXjvillUsrResultMap">
  163. select
  164. <include refid="table_columns"/>
  165. from BIS_INSP_XJVILL_USR
  166. </select>
  167. <select id="findList" resultMap="bisInspXjvillUsrResultMap">
  168. select
  169. <include refid="table_columns"/>
  170. from BIS_INSP_XJVILL_USR
  171. <include refid="page_where"/>
  172. <choose>
  173. <when test="regmId != null and regmId != ''">
  174. and REGM_ID = #{regmId}
  175. </when>
  176. <otherwise>
  177. and REGM_ID IS NULL
  178. </otherwise>
  179. </choose>
  180. </select>
  181. <select id="selectCount" resultType="int">
  182. select count(ID) from BIS_INSP_XJVILL_USR
  183. <include refid="page_where"/>
  184. </select>
  185. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspXjvillUsr">
  186. insert into BIS_INSP_XJVILL_USR(
  187. <include refid="table_columns"/>
  188. )
  189. values (
  190. <include refid="entity_properties"/>
  191. )
  192. </insert>
  193. <delete id="delete" parameterType="java.lang.String">
  194. update BIS_INSP_XJVILL_USR set DATA_STAT='9' where ID = #{id}
  195. </delete>
  196. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspXjvillUsr">
  197. update BIS_INSP_XJVILL_USR set DATA_STAT='9'
  198. <include refid="page_where"/>
  199. </delete>
  200. <update id="deleteInFlag" parameterType="java.lang.String">
  201. update BIS_INSP_XJVILL_USR set DATA_STAT = '9' where ID = #{id}
  202. </update>
  203. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspXjvillUsr">
  204. update BIS_INSP_XJVILL_USR
  205. <trim prefix="set" suffixOverrides=",">
  206. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID
  207. = #{rgstrId},
  208. </if>
  209. <if test="regmId != null and regmId != ''">REGM_ID
  210. = #{regmId},
  211. </if>
  212. <if test="userNm != null and userNm != ''">USER_NM
  213. = #{userNm},
  214. </if>
  215. <if test="telphone != null and telphone != ''">TELPHONE
  216. = #{telphone},
  217. </if>
  218. <if test="loc != null and loc != ''">LOC
  219. = #{loc},
  220. </if>
  221. <if test="isInHome != null and isInHome != ''">IS_IN_HOME
  222. = #{isInHome},
  223. </if>
  224. <if test="isCalm != null and isCalm != ''">IS_CALM
  225. = #{isCalm},
  226. </if>
  227. <if test="isDay != null and isDay != ''">IS_DAY
  228. = #{isDay},
  229. </if>
  230. <if test="isEnough != null and isEnough != ''">IS_ENOUGH
  231. = #{isEnough},
  232. </if>
  233. <if test="isWell != null and isWell != ''">IS_WELL
  234. = #{isWell},
  235. </if>
  236. <if test="isImp != null and isImp != ''">IS_IMP
  237. = #{isImp},
  238. </if>
  239. <if test="isSmell != null and isSmell != ''">IS_SMELL
  240. = #{isSmell},
  241. </if>
  242. <if test="price != null and price != ''">PRICE
  243. = #{price},
  244. </if>
  245. <if test="isTel != null and isTel != ''">IS_TEL
  246. = #{isTel},
  247. </if>
  248. <if test="isSolve != null and isSolve != ''">IS_SOLVE
  249. = #{isSolve},
  250. </if>
  251. <if test="othr != null and othr != ''">OTHR
  252. = #{othr},
  253. </if>
  254. <if test="persId != null and persId != ''">PERS_ID
  255. = #{persId},
  256. </if>
  257. <if test="intm != null">INTM
  258. = #{intm},
  259. </if>
  260. <if test="uptm != null">UPTM
  261. = #{uptm},
  262. </if>
  263. <if test="note != null and note != ''">NOTE
  264. = #{note},
  265. </if>
  266. <if test="dataStat != null and dataStat != ''">DATA_STAT
  267. = #{dataStat},
  268. </if>
  269. <if test="state != null and state != ''">STATE
  270. = #{state},
  271. </if>
  272. </trim>
  273. <where>ID = #{id}</where>
  274. </update>
  275. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspXjvillUsr">
  276. update BIS_INSP_XJVILL_USR
  277. <trim prefix="set" suffixOverrides=",">
  278. <if test="rgstrId != null and rgstrId != ''">RGSTR_ID
  279. = #{rgstrId},
  280. </if>
  281. <if test="regmId != null and regmId != ''">REGM_ID
  282. = #{regmId},
  283. </if>
  284. <if test="userNm != null and userNm != ''">USER_NM
  285. = #{userNm},
  286. </if>
  287. <if test="telphone != null and telphone != ''">TELPHONE
  288. = #{telphone},
  289. </if>
  290. <if test="loc != null and loc != ''">LOC
  291. = #{loc},
  292. </if>
  293. <if test="isInHome != null and isInHome != ''">IS_IN_HOME
  294. = #{isInHome},
  295. </if>
  296. <if test="isCalm != null and isCalm != ''">IS_CALM
  297. = #{isCalm},
  298. </if>
  299. <if test="isDay != null and isDay != ''">IS_DAY
  300. = #{isDay},
  301. </if>
  302. <if test="isEnough != null and isEnough != ''">IS_ENOUGH
  303. = #{isEnough},
  304. </if>
  305. <if test="isWell != null and isWell != ''">IS_WELL
  306. = #{isWell},
  307. </if>
  308. <if test="isImp != null and isImp != ''">IS_IMP
  309. = #{isImp},
  310. </if>
  311. <if test="isSmell != null and isSmell != ''">IS_SMELL
  312. = #{isSmell},
  313. </if>
  314. <if test="price != null and price != ''">PRICE
  315. = #{price},
  316. </if>
  317. <if test="isTel != null and isTel != ''">IS_TEL
  318. = #{isTel},
  319. </if>
  320. <if test="isSolve != null and isSolve != ''">IS_SOLVE
  321. = #{isSolve},
  322. </if>
  323. <if test="othr != null and othr != ''">OTHR
  324. = #{othr},
  325. </if>
  326. <if test="persId != null and persId != ''">PERS_ID
  327. = #{persId},
  328. </if>
  329. <if test="intm != null">INTM
  330. = #{intm},
  331. </if>
  332. <if test="uptm != null">UPTM
  333. = #{uptm},
  334. </if>
  335. <if test="note != null and note != ''">NOTE
  336. = #{note},
  337. </if>
  338. <if test="dataStat != null and dataStat != ''">DATA_STAT
  339. = #{dataStat},
  340. </if>
  341. <if test="state != null and state != ''">STATE
  342. = #{state},
  343. </if>
  344. </trim>
  345. <include refid="page_where"/>
  346. </update>
  347. <!-- 其他自定义SQL -->
  348. </mapper>