BisInspPlanLogDao.xml 3.3 KB

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