AttJobBaseDao.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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.AttJobBaseDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.AttJobBase" id="attJobBaseResultMap">
  5. <result property="guid" column="GUID"/>
  6. <result property="jobGuid" column="JOB_GUID"/>
  7. <result property="jobCode" column="JOB_CODE"/>
  8. <result property="jobName" column="JOB_NAME"/>
  9. <result property="jobLevel" column="JOB_LEVEL"/>
  10. <result property="jobResp" column="JOB_RESP"/>
  11. <result property="orgGuid" column="ORG_GUID"/>
  12. <result property="status" column="STATUS"/>
  13. <result property="modifier" column="MODIFIER"/>
  14. <result property="fromDate" column="FROM_DATE"/>
  15. <result property="toDate" column="TO_DATE"/>
  16. <result property="note" column="NOTE"/>
  17. </resultMap>
  18. <sql id="table_columns">
  19. GUID,
  20. JOB_GUID,
  21. JOB_CODE,
  22. JOB_NAME,
  23. JOB_LEVEL,
  24. JOB_RESP,
  25. ORG_GUID,
  26. STATUS,
  27. MODIFIER,
  28. FROM_DATE,
  29. TO_DATE,
  30. NOTE
  31. </sql>
  32. <sql id="entity_properties">
  33. #{guid},
  34. #{jobGuid},
  35. #{jobCode},
  36. #{jobName},
  37. #{jobLevel},
  38. #{jobResp},
  39. #{orgGuid},
  40. #{status},
  41. #{modifier},
  42. #{fromDate},
  43. #{toDate},
  44. #{note}
  45. </sql>
  46. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  47. <sql id="page_where">
  48. <trim prefix="where" prefixOverrides="and | or ">
  49. <if test="jobGuid != null and jobGuid != ''">and JOB_GUID = #{jobGuid}</if>
  50. <if test="jobCode != null and jobCode != ''">and JOB_CODE = #{jobCode}</if>
  51. <if test="jobName != null and jobName != ''">and JOB_NAME = #{jobName}</if>
  52. <if test="jobLevel != null and jobLevel != ''">and JOB_LEVEL = #{jobLevel}</if>
  53. <if test="jobResp != null and jobResp != ''">and JOB_RESP = #{jobResp}</if>
  54. <if test="orgGuid != null and orgGuid != ''">and ORG_GUID = #{orgGuid}</if>
  55. <if test="status != null and status != ''">and STATUS = #{status}</if>
  56. <if test="modifier != null and modifier != ''">and MODIFIER = #{modifier}</if>
  57. <if test="fromDate != null">and FROM_DATE = #{fromDate}</if>
  58. <if test="toDate != null">and TO_DATE = #{toDate}</if>
  59. <if test="note != null and note != ''">and NOTE = #{note}</if>
  60. </trim>
  61. </sql>
  62. <select id="get" resultMap="attJobBaseResultMap" parameterType="String" >
  63. select <include refid="table_columns" /> from att_job_base where GUID = #{id}
  64. </select>
  65. <select id="getBy" resultMap="attJobBaseResultMap">
  66. select <include refid="table_columns" /> from att_job_base <include refid="page_where" />
  67. </select>
  68. <select id="findAll" resultMap="attJobBaseResultMap">
  69. select <include refid="table_columns" /> from att_job_base
  70. </select>
  71. <select id="findList" resultMap="attJobBaseResultMap">
  72. select <include refid="table_columns" /> from att_job_base <include refid="page_where" />
  73. </select>
  74. <select id="selectCount" resultType="int" >
  75. select count(GUID) from att_job_base <include refid="page_where" />
  76. </select>
  77. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.AttJobBase">
  78. insert into att_job_base( <include refid="table_columns" /> )
  79. values ( <include refid="entity_properties" /> )
  80. </insert>
  81. <delete id="delete" parameterType="java.lang.String">
  82. delete from att_job_base where GUID = #{id}
  83. </delete>
  84. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.AttJobBase">
  85. delete from att_job_base <include refid="page_where" />
  86. </delete>
  87. <update id="deleteInFlag" parameterType="java.lang.String">
  88. update att_job_base set flag_valid = 0 where GUID = #{id}
  89. </update>
  90. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.AttJobBase">
  91. update att_job_base
  92. <trim prefix="set" suffixOverrides=",">
  93. <if test="jobGuid != null and jobGuid != ''">JOB_GUID = #{jobGuid},</if>
  94. <if test="jobCode != null and jobCode != ''">JOB_CODE = #{jobCode},</if>
  95. <if test="jobName != null and jobName != ''">JOB_NAME = #{jobName},</if>
  96. <if test="jobLevel != null and jobLevel != ''">JOB_LEVEL = #{jobLevel},</if>
  97. <if test="jobResp != null and jobResp != ''">JOB_RESP = #{jobResp},</if>
  98. <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
  99. <if test="status != null and status != ''">STATUS = #{status},</if>
  100. <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
  101. <if test="fromDate != null">FROM_DATE = #{fromDate},</if>
  102. <if test="toDate != null">TO_DATE = #{toDate},</if>
  103. <if test="note != null and note != ''">NOTE = #{note},</if>
  104. </trim>
  105. <where>GUID = #{id}</where>
  106. </update>
  107. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.AttJobBase">
  108. update att_job_base
  109. <trim prefix="set" suffixOverrides=",">
  110. <if test="jobGuid != null and jobGuid != ''">JOB_GUID = #{jobGuid},</if>
  111. <if test="jobCode != null and jobCode != ''">JOB_CODE = #{jobCode},</if>
  112. <if test="jobName != null and jobName != ''">JOB_NAME = #{jobName},</if>
  113. <if test="jobLevel != null and jobLevel != ''">JOB_LEVEL = #{jobLevel},</if>
  114. <if test="jobResp != null and jobResp != ''">JOB_RESP = #{jobResp},</if>
  115. <if test="orgGuid != null and orgGuid != ''">ORG_GUID = #{orgGuid},</if>
  116. <if test="status != null and status != ''">STATUS = #{status},</if>
  117. <if test="modifier != null and modifier != ''">MODIFIER = #{modifier},</if>
  118. <if test="fromDate != null">FROM_DATE = #{fromDate},</if>
  119. <if test="toDate != null">TO_DATE = #{toDate},</if>
  120. <if test="note != null and note != ''">NOTE = #{note},</if>
  121. </trim>
  122. <include refid="page_where" />
  123. </update>
  124. <!-- 其他自定义SQL -->
  125. </mapper>