TacPblmQlttvListDao.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.TacPblmQlttvListDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.TacPblmQlttvList" id="tacPblmQlttvListResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="type" column="TYPE"/>
  7. <result property="code" column="CODE"/>
  8. <result property="name" column="NAME"/>
  9. <result property="sn" column="SN"/>
  10. <result property="relCode" column="RELCODE"/>
  11. <result property="note" column="NOTE"/>
  12. </resultMap>
  13. <sql id="table_columns">
  14. ID,
  15. TYPE,
  16. CODE,
  17. NAME,
  18. SN,RELCODE,NOTE
  19. </sql>
  20. <sql id="entity_properties">
  21. #{id},
  22. #{type},
  23. #{code},
  24. #{name},
  25. #{sn},#{relCode},#{note}
  26. </sql>
  27. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  28. <sql id="page_where">
  29. <trim prefix="where" prefixOverrides="and | or ">
  30. <if test="type != null and type != ''">and TYPE = #{type}</if>
  31. <if test="code != null and code != ''">and CODE = #{code}</if>
  32. <if test="name != null and name != ''">and NAME = #{name}</if>
  33. <if test="sn != null and sn != ''">and SN = #{sn}</if>
  34. <if test="relCode != null and relCode != ''">and RELCODE like '%${relCode}%'</if>
  35. <if test="note != null and note != ''">and NOTE = #{note}</if>
  36. </trim>
  37. </sql>
  38. <select id="get" resultMap="tacPblmQlttvListResultMap" parameterType="String" >
  39. select <include refid="table_columns" /> from TAC_PBLM_QLTTV_LIST where ID = #{id}
  40. </select>
  41. <select id="getBy" resultMap="tacPblmQlttvListResultMap">
  42. select <include refid="table_columns" /> from TAC_PBLM_QLTTV_LIST <include refid="page_where" />
  43. </select>
  44. <select id="findAll" resultMap="tacPblmQlttvListResultMap">
  45. select <include refid="table_columns" /> from TAC_PBLM_QLTTV_LIST
  46. </select>
  47. <select id="findList" resultMap="tacPblmQlttvListResultMap">
  48. select <include refid="table_columns" /> from TAC_PBLM_QLTTV_LIST <include refid="page_where" />
  49. </select>
  50. <select id="selectCount" resultType="int" >
  51. select count(ID) from TAC_PBLM_QLTTV_LIST <include refid="page_where" />
  52. </select>
  53. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.TacPblmQlttvList">
  54. insert into TAC_PBLM_QLTTV_LIST( <include refid="table_columns" /> )
  55. values ( <include refid="entity_properties" /> )
  56. </insert>
  57. <delete id="delete" parameterType="java.lang.String">
  58. delete from TAC_PBLM_QLTTV_LIST where ID = #{id}
  59. </delete>
  60. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.TacPblmQlttvList">
  61. delete from TAC_PBLM_QLTTV_LIST <include refid="page_where" />
  62. </delete>
  63. <update id="deleteInFlag" parameterType="java.lang.String">
  64. update TAC_PBLM_QLTTV_LIST set flag_valid = 0 where ID = #{id}
  65. </update>
  66. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.TacPblmQlttvList">
  67. update TAC_PBLM_QLTTV_LIST
  68. <trim prefix="set" suffixOverrides=",">
  69. <if test="type != null and type != ''">TYPE = #{type},</if>
  70. <if test="code != null and code != ''">CODE = #{code},</if>
  71. <if test="name != null and name != ''">NAME = #{name},</if>
  72. <if test="sn != null and sn != ''">SN = #{sn},</if>
  73. <if test="relCode != null and relCode != ''">RELCODE = #{relCode},</if>
  74. <if test="note != null and note != ''">NOTE = #{note},</if>
  75. </trim>
  76. <where>ID = #{id}</where>
  77. </update>
  78. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.TacPblmQlttvList">
  79. update TAC_PBLM_QLTTV_LIST
  80. <trim prefix="set" suffixOverrides=",">
  81. <if test="type != null and type != ''">TYPE = #{type},</if>
  82. <if test="code != null and code != ''">CODE = #{code},</if>
  83. <if test="name != null and name != ''">NAME = #{name},</if>
  84. <if test="sn != null and sn != ''">SN = #{sn},</if>
  85. <if test="relCode != null and relCode != ''">RELCODE = #{relCode},</if>
  86. <if test="note != null and note != ''">NOTE = #{note},</if>
  87. </trim>
  88. <include refid="page_where" />
  89. </update>
  90. <!-- 其他自定义SQL -->
  91. </mapper>