BisInspAppErrlogDao.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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.BisInspAppErrlogDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.BisInspAppErrlog" id="bisInspAppErrlogResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="persid" column="PERSID"/>
  7. <result property="intm" column="INTM"/>
  8. <result property="erlog" column="ERLOG"/>
  9. <result property="flagValid" column="FLAG_VALID"/>
  10. <result property="erstate" column="ERSTATE"/>
  11. </resultMap>
  12. <sql id="table_columns">
  13. ID,
  14. PERSID,
  15. <if test="intm != null and intm != ''">INTM,</if>
  16. ERLOG
  17. <if test="flagValid != null and flagValid != ''">,FLAG_VALID</if>
  18. <if test="erstate != null and erstate != ''">,ERSTATE</if>
  19. </sql>
  20. <sql id="entity_properties">
  21. #{id},
  22. #{persid}
  23. <if test="intm != null and intm != ''">,#{intm}</if>
  24. ,#{erlog}
  25. <if test="flagValid != null and flagValid != ''">,#{flagValid}</if>
  26. <if test="erstate != null and erstate != ''">,#{erstate}</if>
  27. </sql>
  28. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  29. <sql id="page_where">
  30. <trim prefix="where" prefixOverrides="and | or ">
  31. <if test="persid != null and persid != ''">and PERSID = #{persid}</if>
  32. <if test="intm != null">and INTM = #{intm}</if>
  33. <if test="erlog != null and erlog != ''">and ERLOG = #{erlog}</if>
  34. <if test="flagValid != null">and FLAG_VALID = #{flagValid}</if>
  35. <if test="erstate != null">and ERSTATE = #{erstate}</if>
  36. </trim>
  37. </sql>
  38. <select id="get" resultMap="bisInspAppErrlogResultMap" parameterType="String">
  39. select
  40. <include refid="table_columns"/>
  41. from BIS_INSP_APP_ERRLOG where ID = #{id}
  42. </select>
  43. <select id="getBy" resultMap="bisInspAppErrlogResultMap">
  44. select
  45. <include refid="table_columns"/>
  46. from BIS_INSP_APP_ERRLOG
  47. <include refid="page_where"/>
  48. </select>
  49. <select id="findAll" resultMap="bisInspAppErrlogResultMap">
  50. select
  51. <include refid="table_columns"/>
  52. from BIS_INSP_APP_ERRLOG
  53. </select>
  54. <select id="findList" resultMap="bisInspAppErrlogResultMap">
  55. select
  56. <include refid="table_columns"/>
  57. from BIS_INSP_APP_ERRLOG
  58. <include refid="page_where"/>
  59. </select>
  60. <select id="selectCount" resultType="int">
  61. select count(ID) from BIS_INSP_APP_ERRLOG
  62. <include refid="page_where"/>
  63. </select>
  64. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspAppErrlog">
  65. insert into BIS_INSP_APP_ERRLOG(
  66. <include refid="table_columns"/>
  67. )
  68. values (
  69. <include refid="entity_properties"/>
  70. )
  71. </insert>
  72. <delete id="delete" parameterType="java.lang.String">
  73. delete from BIS_INSP_APP_ERRLOG where ID = #{id}
  74. </delete>
  75. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspAppErrlog">
  76. delete from BIS_INSP_APP_ERRLOG
  77. <include refid="page_where"/>
  78. </delete>
  79. <update id="deleteInFlag" parameterType="java.lang.String">
  80. update BIS_INSP_APP_ERRLOG set flag_valid = 0 where ID = #{id}
  81. </update>
  82. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspAppErrlog">
  83. update BIS_INSP_APP_ERRLOG
  84. <trim prefix="set" suffixOverrides=",">
  85. <if test="persid != null and persid != ''">PERSID = #{persid},</if>
  86. <if test="intm != null">INTM = #{intm},</if>
  87. <if test="erlog != null and erlog != ''">ERLOG = #{erlog},</if>
  88. <if test="flagValid != null">FLAG_VALID = #{flagValid},</if>
  89. <if test="erstate != null">ERSTATE = #{erstate},</if>
  90. </trim>
  91. <where>ID = #{id}</where>
  92. </update>
  93. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspAppErrlog">
  94. update BIS_INSP_APP_ERRLOG
  95. <trim prefix="set" suffixOverrides=",">
  96. <if test="persid != null and persid != ''">PERSID = #{persid},</if>
  97. <if test="intm != null">INTM = #{intm},</if>
  98. <if test="erlog != null and erlog != ''">ERLOG = #{erlog},</if>
  99. <if test="flagValid != null">FLAG_VALID = #{flagValid},</if>
  100. <if test="erstate != null">ERSTATE = #{erstate},</if>
  101. </trim>
  102. <include refid="page_where"/>
  103. </update>
  104. <!-- 其他自定义SQL -->
  105. <select id="findPersidError" parameterType="cn.com.goldenwater.dcproj.param.BisInspAppErrlogParam" resultType="cn.com.goldenwater.dcproj.dto.BisInspAppErrlogDto">
  106. select A.*,b.PERS_NAME from BIS_INSP_APP_ERRLOG A
  107. LEFT JOIN BIS_INSP_ALL_RLATION_PERS B
  108. ON A.PERSID=B.GUID
  109. WHERE A.FLAG_VALID='1'
  110. AND ERSTATE='0'
  111. <if test="persid != null and persid != ''">AND A.persid = #{persid}</if>
  112. </select>
  113. </mapper>