123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.weather.mapper.WeaAuditRotaInfoMapper">
- <resultMap type="WeaAuditRotaInfo" id="WeaAuditRotaInfoResult">
- <result property="id" column="id" />
- <result property="rotaPersonId" column="rota_person_id" />
- <result property="rotaYear" column="rota_year" />
- <result property="rotaMonth" column="rota_month" />
- <result property="name" column="name" />
- <result property="createId" column="create_id" />
- <result property="createTime" column="create_time" />
- <result property="updateId" column="update_id" />
- <result property="updateTime" column="update_time" />
- <result property="remarks" column="remarks" />
- </resultMap>
- <sql id="selectWeaAuditRotaInfoVo">
- select id, rota_person_id, rota_year, rota_month,name, remarks, create_id, create_time, update_id, update_time
- from wea_audit_rota_info
- </sql>
- <select id="selectWeaAuditRotaInfoById" parameterType="Long" resultMap="WeaAuditRotaInfoResult">
- <include refid="selectWeaAuditRotaInfoVo"/>
- where id = #{id}
- </select>
- <select id="selectWeaAuditRotaInfoByDate" parameterType="String" resultMap="WeaAuditRotaInfoResult">
- SELECT * FROM wea_audit_rota_info WHERE rota_year = #{rotaYear}
- </select>
-
- <insert id="insertWeaAuditRotaInfo" parameterType="WeaAuditRotaInfo">
- insert into wea_audit_rota_info (
- id,
- <if test="rotaPersonId != null and rotaPersonId != '' ">rota_person_id, </if>
- <if test="rotaYear != null and rotaYear != '' ">rota_year, </if>
- <if test="rotaMonth != null and rotaMonth != '' ">rota_month, </if>
- <if test="name != null and name != '' ">name, </if>
- remarks,
- create_id,
- create_time,
- update_id,
- update_time
- )values(
- #{id},
- <if test="rotaPersonId!= null and rotaPersonId != ''">#{rotaPersonId}, </if>
- <if test="rotaYear != null and rotaYear != ''">#{rotaYear}, </if>
- <if test="rotaMonth != null and rotaMonth != ''">#{rotaMonth}, </if>
- <if test="name!= null and name != ''">#{name}, </if>
- #{remarks},
- #{createId},
- NOW(),
- #{updateId},
- #{updateTime}
- )
- </insert>
-
- <update id="updateWeaAuditRotaInfo" parameterType="WeaAuditRotaInfo">
- update wea_audit_rota_info
- <set>
- <if test="rotaPersonId != null and rotaPersonId != ''">rota_person_id = #{rotaPersonId}, </if>
- create_time = #{createTime},
- rota_year = #{rotaYear},
- rota_month = #{rotaMonth},
- name = #{name},
- remarks = #{remarks},
- create_id = #{createId},
- update_id = #{updateId},
- update_time = NOW()
- </set>
- where id = #{id}
- </update>
- <select id="selectWeaAuditRotaInfoList" parameterType="WeaAuditRotaInfo" resultMap="WeaAuditRotaInfoResult">
- select id, rota_person_id, rota_year,rota_month, name, remarks, create_id, create_time, update_id, update_time
- from wea_audit_rota_info
- <where>
- <if test="id!=null and id!=''">
- AND "id"=#{id},
- </if>
- <if test="rotaPersonId!=null and rotaPersonId!=''">
- AND "rota_person_id"=#{rotaPersonId},
- </if>
- <if test="rotaYear!=null and rotaYear!=''">
- AND "rota_year"=#{rotaYear},
- </if>
- <if test="rotaMonth!=null and rotaMonth!=''">
- AND "rota_month"=#{rotaMonth},
- </if>
- <if test="name!=null and name!=''">
- AND "name"=#{name},
- </if>
- <if test="remarks!=null and remarks!=''">
- AND "remarks"=#{remarks},
- </if>
- <if test="createId!=null and createId!=''">
- AND "create_id"=#{createId},
- </if>
- <if test="createTime!=null and createTime!=''">
- AND "create_time"=#{createTime},
- </if>
- <if test="updateId!=null and updateId!=''">
- AND "update_id"=#{updateId},
- </if>
- <if test="updateTime!=null and updateTime!=''">
- AND "update_time"=#{updateTime}
- </if>
- </where>
- </select>
- <delete id="deleteWeaAuditRotaInfoById" parameterType="Long">
- delete from wea_audit_rota_info where id = #{id}
- </delete>
- </mapper>
|