GRZLGL_Mapper.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//ibatis.apache.org//DTD Mapper 3.0//EN"
  4. "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
  5. <mapper namespace="GRZLGL">
  6. <!-- 个人顺序号序列 -->
  7. <sql id="TEST_GRJBZL_GRSXH_SEQ">
  8. select SEQ_GRSXH.nextval from dual
  9. </sql>
  10. <!-- 所有字段 -->
  11. <sql id="TEST_GRJBZL_COL">
  12. GRSXH, GRBH, GMSFHM, XM, XB, CSRQ, BZ
  13. </sql>
  14. <!-- 查询 -->
  15. <select id="TEST_GRJBZL_Q" parameterType="hashmap" resultType="hashmap">
  16. select
  17. <include refid="TEST_GRJBZL_COL"/>
  18. from TEST_GRJBZL
  19. <where>
  20. <if test="GRSXH != null">
  21. and GRSXH = #{GRSXH}
  22. </if>
  23. <if test="GMSFHM != null and GMSFHM != ''">
  24. and GMSFHM = #{GMSFHM}
  25. </if>
  26. </where>
  27. </select>
  28. <!-- ajax 查询 :根据公民身份号码 -->
  29. <select id="TEST_GRJBZL_GRSXH_Q" resultType="hashmap">
  30. SELECT * FROM TEST_GRJBZL where GMSFHM=#{GMSFHM}
  31. </select>
  32. <!-- 普通插入 -->
  33. <insert id="TEST_GRJBZL_I" parameterType="hashmap">
  34. <selectKey keyProperty="GRSXH" resultType="long" order="BEFORE">
  35. <include refid="TEST_GRJBZL_GRSXH_SEQ" />
  36. </selectKey>
  37. insert into TEST_GRJBZL (
  38. <include refid="TEST_GRJBZL_COL" />
  39. )
  40. values (
  41. #{GRSXH},#{GRBH},#{GMSFHM},#{XM},#{XB},#{CSRQ},
  42. <if test="BZ != null">
  43. #{BZ}
  44. </if>
  45. <if test="BZ == null">
  46. ''
  47. </if>
  48. )
  49. </insert>
  50. <!-- 选择修改 by主键 -->
  51. <update id="TEST_GRJBZL_U" parameterType="hashmap">
  52. update TEST_GRJBZL
  53. <set>
  54. <if test="GRBH != null">GRBH = #{GRBH},</if>
  55. <if test="GMSFHM != null">GMSFHM = #{GMSFHM},</if>
  56. <if test="XM != null">XM = #{XM},</if>
  57. <if test="XB != null">XB = #{XB},</if>
  58. <if test="CSRQ != null">CSRQ = #{CSRQ},</if>
  59. </set>
  60. WHERE GRSXH =#{GRSXH}
  61. </update>
  62. </mapper>