GwSubProcessDao.xml 3.8 KB

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