123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <?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.WeaRotaInfoMapper">
- <resultMap type="WeaRotaInfo" id="WeaRotaInfoResult">
- <result property="id" column="id" />
- <result property="rotaPersonId" column="rota_person_id" />
- <result property="rotaDate" column="rota_date" />
- <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="rotaName" column="rota_name" />
- </resultMap>
- <sql id="selectWeaRotaInfoVo">
- select id, rota_person_id, rota_date, name, rota_name, create_id, create_time, update_id, update_time
- from wea_rota_info
- </sql>
- <select id="selectWeaRotaInfoById" parameterType="Long" resultMap="WeaRotaInfoResult">
- select id, rota_person_id, rota_date from wea_rota_info where id = #{id}
- </select>
- <select id="selectWeaRotaInfoByDate" parameterType="Date" resultMap="WeaRotaInfoResult">
- SELECT * FROM wea_rota_info WHERE rota_date BETWEEN #{startDate} AND #{endDate}
- </select>
- <!-- 插入数据 -->
- <insert id="insertWeaRotaInfo" parameterType="WeaRotaInfo">
- insert into wea_rota_info (
- id,
- <if test="rotaPersonId != null and rotaPersonId != '' ">rota_person_id, </if>
- <if test="rotaDate != null and rotaDate != '' ">rota_date, </if>
- create_id,
- create_time,
- update_id,
- update_time
- )values(
- #{id},
- <if test="rotaPersonId!= null and rotaPersonId != ''">#{rotaPersonId}, </if>
- <if test="rotaDate != null and rotaDate != ''">#{rotaDate}, </if>
- #{createId},
- NOW(),
- #{updateId},
- #{updateTime}
- )
- </insert>
- <!-- 更新数据 -->
- <update id="updateWeaRotaInfo" parameterType="WeaRotaInfo">
- update wea_rota_info
- <set>
- <if test="rotaPersonId != null and rotaPersonId != ''">rota_person_id = #{rotaPersonId}, </if>
- rota_date = #{rotaDate},
- create_time = #{createTime},
- create_id = #{createId},
- update_id = #{updateId},
- update_time = NOW()
- </set>
- where id = #{id}
- </update>
- <select id="selectWeaRotaInfoList" parameterType="WeaRotaInfo" resultMap="WeaRotaInfoResult">
- select id, rota_person_id, rota_date, name, rota_name, create_id, create_time, update_id, update_time
- from wea_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="rotaDate!=null and rotaDate!=''">
- AND "rota_date"=#{rotaDate},
- </if>
- <if test="name!=null and name!=''">
- AND "name"=#{name},
- </if>
- <if test="rotaName!=null and rotaName!=''">
- AND "rota_name"=#{rotaName},
- </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="deleteWeaRotaInfoById" parameterType="Long">
- delete from wea_rota_info where id = #{id}
- </delete>
- </mapper>
|