TacObjSubjectDao.xml 4.4 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.TacObjSubjectDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacObjSubject" id="tacObjSubjectResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="subName" column="SUB_NAME"/>
  7. <result property="note" column="NOTE"/>
  8. <result property="intm" column="INTM"/>
  9. <result property="sysType" column="SYS_TYPE"/>
  10. <result property="sysName" column="SYS_NAME"/>
  11. </resultMap>
  12. <sql id="table_columns">
  13. ID,
  14. SUB_NAME,
  15. NOTE,
  16. INTM,SYS_TYPE,SYS_NAME
  17. </sql>
  18. <sql id="entity_properties">
  19. #{id},
  20. #{subName},
  21. #{note},
  22. #{intm},#{sysType},#{sysName}
  23. </sql>
  24. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  25. <sql id="page_where">
  26. <trim prefix="where" prefixOverrides="and | or ">
  27. <if test="subName != null and subName != ''">and SUB_NAME like '%${subName}%'</if>
  28. <if test="note != null and note != ''">and NOTE like '%${note}%'</if>
  29. <if test="intm != null">and INTM = #{intm}</if>
  30. <if test="ids != null and ids !=''">and id in (${ids})</if>
  31. <if test="sysType != null and sysType !=''">and sys_Type=#{sysType}</if>
  32. <if test="sysName != null and sysName !=''">and SYS_NAME like '${sysName}%'</if>
  33. </trim>
  34. </sql>
  35. <select id="get" resultMap="tacObjSubjectResultMap" parameterType="String">
  36. select
  37. <include refid="table_columns"/>
  38. from TAC_OBJ_SUBJECT where ID = #{id}
  39. </select>
  40. <select id="getBy" resultMap="tacObjSubjectResultMap">
  41. select
  42. <include refid="table_columns"/>
  43. from TAC_OBJ_SUBJECT
  44. <include refid="page_where"/>
  45. </select>
  46. <select id="findAll" resultMap="tacObjSubjectResultMap">
  47. select
  48. <include refid="table_columns"/>
  49. from TAC_OBJ_SUBJECT
  50. </select>
  51. <select id="findList" resultMap="tacObjSubjectResultMap">
  52. select
  53. <include refid="table_columns"/>
  54. from TAC_OBJ_SUBJECT
  55. <include refid="page_where"/>
  56. </select>
  57. <select id="listType" resultMap="tacObjSubjectResultMap" >
  58. select distinct t.sys_type,t.sys_name from tac_obj_subject t where t.sys_type is not null
  59. </select>
  60. <select id="selectCount" resultType="int">
  61. select SEQ_GE_SLDC_NEXT.nextval from dual
  62. </select>
  63. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacObjSubject">
  64. insert into TAC_OBJ_SUBJECT(
  65. <include refid="table_columns"/>
  66. )
  67. values (
  68. <include refid="entity_properties"/>
  69. )
  70. </insert>
  71. <delete id="delete" parameterType="java.lang.String">
  72. delete from TAC_OBJ_SUBJECT where ID = #{id}
  73. </delete>
  74. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacObjSubject">
  75. delete from TAC_OBJ_SUBJECT
  76. <include refid="page_where"/>
  77. </delete>
  78. <update id="deleteInFlag" parameterType="java.lang.String">
  79. update TAC_OBJ_SUBJECT set flag_valid = 0 where ID = #{id}
  80. </update>
  81. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacObjSubject">
  82. update TAC_OBJ_SUBJECT
  83. <trim prefix="set" suffixOverrides=",">
  84. <if test="subName != null and subName != ''">SUB_NAME = #{subName},</if>
  85. <if test="note != null and note != ''">NOTE = #{note},</if>
  86. <if test="intm != null">INTM = #{intm},</if>
  87. <if test="sysName != null">sys_name = #{sysName},</if>
  88. <if test="sysType != null">SYS_TYPE = #{sysType},</if>
  89. </trim>
  90. <where>ID = #{id}</where>
  91. </update>
  92. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacObjSubject">
  93. update TAC_OBJ_SUBJECT
  94. <trim prefix="set" suffixOverrides=",">
  95. <if test="subName != null and subName != ''">SUB_NAME = #{subName},</if>
  96. <if test="note != null and note != ''">NOTE = #{note},</if>
  97. <if test="intm != null">INTM = #{intm},</if>
  98. <if test="sysName != null">sys_name = #{sysName},</if>
  99. <if test="sysType != null">SYS_TYPE = #{sysType},</if>
  100. </trim>
  101. <include refid="page_where"/>
  102. </update>
  103. <!-- 其他自定义SQL -->
  104. </mapper>