BisInspAllRlationPersOrgaDao.xml 4.8 KB

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