WeaAuditRotaInfoMapper.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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="com.weather.mapper.WeaAuditRotaInfoMapper">
  4. <resultMap type="WeaAuditRotaInfo" id="WeaAuditRotaInfoResult">
  5. <result property="id" column="id" />
  6. <result property="rotaPersonId" column="rota_person_id" />
  7. <result property="rotaYear" column="rota_year" />
  8. <result property="rotaMonth" column="rota_month" />
  9. <result property="name" column="name" />
  10. <result property="createId" column="create_id" />
  11. <result property="createTime" column="create_time" />
  12. <result property="updateId" column="update_id" />
  13. <result property="updateTime" column="update_time" />
  14. <result property="remarks" column="remarks" />
  15. </resultMap>
  16. <sql id="selectWeaAuditRotaInfoVo">
  17. select id, rota_person_id, rota_year, rota_month,name, remarks, create_id, create_time, update_id, update_time
  18. from wea_audit_rota_info
  19. </sql>
  20. <select id="selectWeaAuditRotaInfoById" parameterType="Long" resultMap="WeaAuditRotaInfoResult">
  21. <include refid="selectWeaAuditRotaInfoVo"/>
  22. where id = #{id}
  23. </select>
  24. <select id="selectWeaAuditRotaInfoByDate" parameterType="String" resultMap="WeaAuditRotaInfoResult">
  25. SELECT * FROM wea_audit_rota_info WHERE rota_year = #{rotaYear}
  26. </select>
  27. <!-- 插入数据 -->
  28. <insert id="insertWeaAuditRotaInfo" parameterType="WeaAuditRotaInfo">
  29. insert into wea_audit_rota_info (
  30. id,
  31. <if test="rotaPersonId != null and rotaPersonId != '' ">rota_person_id, </if>
  32. <if test="rotaYear != null and rotaYear != '' ">rota_year, </if>
  33. <if test="rotaMonth != null and rotaMonth != '' ">rota_month, </if>
  34. <if test="name != null and name != '' ">name, </if>
  35. remarks,
  36. create_id,
  37. create_time,
  38. update_id,
  39. update_time
  40. )values(
  41. #{id},
  42. <if test="rotaPersonId!= null and rotaPersonId != ''">#{rotaPersonId}, </if>
  43. <if test="rotaYear != null and rotaYear != ''">#{rotaYear}, </if>
  44. <if test="rotaMonth != null and rotaMonth != ''">#{rotaMonth}, </if>
  45. <if test="name!= null and name != ''">#{name}, </if>
  46. #{remarks},
  47. #{createId},
  48. NOW(),
  49. #{updateId},
  50. #{updateTime}
  51. )
  52. </insert>
  53. <!-- 更新数据 -->
  54. <update id="updateWeaAuditRotaInfo" parameterType="WeaAuditRotaInfo">
  55. update wea_audit_rota_info
  56. <set>
  57. <if test="rotaPersonId != null and rotaPersonId != ''">rota_person_id = #{rotaPersonId}, </if>
  58. create_time = #{createTime},
  59. rota_year = #{rotaYear},
  60. rota_month = #{rotaMonth},
  61. name = #{name},
  62. remarks = #{remarks},
  63. create_id = #{createId},
  64. update_id = #{updateId},
  65. update_time = NOW()
  66. </set>
  67. where id = #{id}
  68. </update>
  69. <select id="selectWeaAuditRotaInfoList" parameterType="WeaAuditRotaInfo" resultMap="WeaAuditRotaInfoResult">
  70. select id, rota_person_id, rota_year,rota_month, name, remarks, create_id, create_time, update_id, update_time
  71. from wea_audit_rota_info
  72. <where>
  73. <if test="id!=null and id!=''">
  74. AND "id"=#{id},
  75. </if>
  76. <if test="rotaPersonId!=null and rotaPersonId!=''">
  77. AND "rota_person_id"=#{rotaPersonId},
  78. </if>
  79. <if test="rotaYear!=null and rotaYear!=''">
  80. AND "rota_year"=#{rotaYear},
  81. </if>
  82. <if test="rotaMonth!=null and rotaMonth!=''">
  83. AND "rota_month"=#{rotaMonth},
  84. </if>
  85. <if test="name!=null and name!=''">
  86. AND "name"=#{name},
  87. </if>
  88. <if test="remarks!=null and remarks!=''">
  89. AND "remarks"=#{remarks},
  90. </if>
  91. <if test="createId!=null and createId!=''">
  92. AND "create_id"=#{createId},
  93. </if>
  94. <if test="createTime!=null and createTime!=''">
  95. AND "create_time"=#{createTime},
  96. </if>
  97. <if test="updateId!=null and updateId!=''">
  98. AND "update_id"=#{updateId},
  99. </if>
  100. <if test="updateTime!=null and updateTime!=''">
  101. AND "update_time"=#{updateTime}
  102. </if>
  103. </where>
  104. </select>
  105. <delete id="deleteWeaAuditRotaInfoById" parameterType="Long">
  106. delete from wea_audit_rota_info where id = #{id}
  107. </delete>
  108. </mapper>