TacObjPblmstbLawDao.xml 3.9 KB

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