IndustryInfo.xml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.enterprise.modules.base.dao.IndustryInfoDAO">
  6. <resultMap id="IndustryInfoMap" type="com.jpsoft.enterprise.modules.base.entity.IndustryInfo">
  7. <id property="id" column="id_" />
  8. <result property="industryName" column="industry_name" />
  9. <result property="parentId" column="parent_id" />
  10. <result property="createBy" column="create_by" />
  11. <result property="createTime" column="create_time" />
  12. <result property="updateBy" column="update_by" />
  13. <result property="updateTime" column="update_time" />
  14. <result property="delFlag" column="del_flag" />
  15. </resultMap>
  16. <insert id="insert" parameterType="com.jpsoft.enterprise.modules.base.entity.IndustryInfo">
  17. <!--
  18. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  19. select sys_guid() from dual
  20. </selectKey>
  21. -->
  22. <![CDATA[
  23. insert into base_industry_info
  24. (id_,industry_name,parent_id,create_by,create_time,update_by,update_time,del_flag)
  25. values
  26. (
  27. #{id,jdbcType=VARCHAR}
  28. ,#{industryName,jdbcType=VARCHAR}
  29. ,#{parentId,jdbcType=VARCHAR}
  30. ,#{createBy,jdbcType=VARCHAR}
  31. ,#{createTime,jdbcType= TIMESTAMP }
  32. ,#{updateBy,jdbcType=VARCHAR}
  33. ,#{updateTime,jdbcType= TIMESTAMP }
  34. ,#{delFlag,jdbcType= NUMERIC }
  35. )
  36. ]]>
  37. </insert>
  38. <delete id="delete" parameterType="string">
  39. delete from base_industry_info where id_=#{id,jdbcType=VARCHAR}
  40. </delete>
  41. <update id="update" parameterType="com.jpsoft.enterprise.modules.base.entity.IndustryInfo">
  42. update base_industry_info
  43. <set>
  44. <if test="industryName!=null">
  45. industry_name=#{industryName,jdbcType=VARCHAR},
  46. </if>
  47. <if test="parentId!=null">
  48. parent_id=#{parentId,jdbcType=VARCHAR},
  49. </if>
  50. <if test="createBy!=null">
  51. create_by=#{createBy,jdbcType=VARCHAR},
  52. </if>
  53. <if test="createTime!=null">
  54. create_time=#{createTime,jdbcType= TIMESTAMP },
  55. </if>
  56. <if test="updateBy!=null">
  57. update_by=#{updateBy,jdbcType=VARCHAR},
  58. </if>
  59. <if test="updateTime!=null">
  60. update_time=#{updateTime,jdbcType= TIMESTAMP },
  61. </if>
  62. <if test="delFlag!=null">
  63. del_flag=#{delFlag,jdbcType= NUMERIC },
  64. </if>
  65. </set>
  66. where id_=#{id}
  67. </update>
  68. <select id="get" parameterType="string" resultMap="IndustryInfoMap">
  69. select
  70. id_,industry_name,parent_id,create_by,create_time,update_by,update_time,del_flag from base_industry_info where id_=#{0}
  71. </select>
  72. <select id="exist" parameterType="string" resultType="int">
  73. select count(*) from base_industry_info where id_=#{0}
  74. </select>
  75. <select id="list" resultMap="IndustryInfoMap">
  76. select * from base_industry_info
  77. </select>
  78. <select id="search" parameterType="hashmap" resultMap="IndustryInfoMap">
  79. <![CDATA[
  80. select * from base_industry_info
  81. ]]>
  82. <where>
  83. <if test="searchParams.id != null">
  84. and ID_ like #{searchParams.id}
  85. </if>
  86. </where>
  87. <foreach item="sort" collection="sortList" open="order by" separator=",">
  88. ${sort.name} ${sort.order}
  89. </foreach>
  90. </select>
  91. <select id="findIndustryByParentId" resultMap="IndustryInfoMap">
  92. <![CDATA[
  93. select * from base_industry_info
  94. where del_flag = 0
  95. and parent_id = #{parentId}
  96. ]]>
  97. </select>
  98. <select id="findParentIndustry" resultMap="IndustryInfoMap">
  99. <![CDATA[
  100. select * from base_industry_info
  101. where del_flag = 0
  102. and parent_id is null
  103. ]]>
  104. </select>
  105. </mapper>