AttEfpBaseDao.xml 4.8 KB

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