TacWordBaseDao.xml 4.7 KB

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