393 lines
15 KiB
XML
393 lines
15 KiB
XML
<?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.rzyc.mapper.GovDutyMapper">
|
|
<resultMap id="BaseResultMap" type="com.rzyc.model.GovDuty">
|
|
<id column="GovDutyId" jdbcType="VARCHAR" property="govdutyid" />
|
|
<result column="DutyMonth" jdbcType="VARCHAR" property="dutymonth" />
|
|
<result column="DutyLeader" jdbcType="VARCHAR" property="dutyleader" />
|
|
<result column="LeaderMobile" jdbcType="VARCHAR" property="leadermobile" />
|
|
|
|
<result column="SecondLeader" jdbcType="VARCHAR" property="secondLeader" />
|
|
<result column="secondLeaderMobile" jdbcType="VARCHAR" property="secondLeaderMobile" />
|
|
|
|
<result column="FirstDirector" jdbcType="VARCHAR" property="firstdirector" />
|
|
<result column="FirstMobile" jdbcType="VARCHAR" property="firstmobile" />
|
|
<result column="SecondDirector" jdbcType="VARCHAR" property="seconddirector" />
|
|
<result column="SecondMobile" jdbcType="VARCHAR" property="secondmobile" />
|
|
<result column="CreatedOn" jdbcType="TIMESTAMP" property="createdon" />
|
|
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
|
|
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
|
|
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
|
|
</resultMap>
|
|
<sql id="Example_Where_Clause">
|
|
<where>
|
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
|
<if test="criteria.valid">
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
<choose>
|
|
<when test="criterion.noValue">
|
|
and ${criterion.condition}
|
|
</when>
|
|
<when test="criterion.singleValue">
|
|
and ${criterion.condition} #{criterion.value}
|
|
</when>
|
|
<when test="criterion.betweenValue">
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
</when>
|
|
<when test="criterion.listValue">
|
|
and ${criterion.condition}
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
#{listItem}
|
|
</foreach>
|
|
</when>
|
|
</choose>
|
|
</foreach>
|
|
</trim>
|
|
</if>
|
|
</foreach>
|
|
</where>
|
|
</sql>
|
|
<sql id="Update_By_Example_Where_Clause">
|
|
<where>
|
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
|
<if test="criteria.valid">
|
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
|
<foreach collection="criteria.criteria" item="criterion">
|
|
<choose>
|
|
<when test="criterion.noValue">
|
|
and ${criterion.condition}
|
|
</when>
|
|
<when test="criterion.singleValue">
|
|
and ${criterion.condition} #{criterion.value}
|
|
</when>
|
|
<when test="criterion.betweenValue">
|
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
|
</when>
|
|
<when test="criterion.listValue">
|
|
and ${criterion.condition}
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
#{listItem}
|
|
</foreach>
|
|
</when>
|
|
</choose>
|
|
</foreach>
|
|
</trim>
|
|
</if>
|
|
</foreach>
|
|
</where>
|
|
</sql>
|
|
<sql id="Base_Column_List">
|
|
GovDutyId, DutyMonth, DutyLeader, SecondLeaderMobile,SecondLeader,LeaderMobile, FirstDirector, FirstMobile, SecondDirector,
|
|
SecondMobile, CreatedOn, CreatedBy, ModifiedOn, ModifiedBy
|
|
</sql>
|
|
<select id="selectByExample" parameterType="com.rzyc.model.GovDutyExample" resultMap="BaseResultMap">
|
|
select
|
|
<if test="distinct">
|
|
distinct
|
|
</if>
|
|
<include refid="Base_Column_List" />
|
|
from GovDuty
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
<if test="orderByClause != null">
|
|
order by ${orderByClause}
|
|
</if>
|
|
<if test="limit != null">
|
|
<if test="offset != null">
|
|
limit ${offset}, ${limit}
|
|
</if>
|
|
<if test="offset == null">
|
|
limit ${limit}
|
|
</if>
|
|
</if>
|
|
</select>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from GovDuty
|
|
where GovDutyId = #{govdutyid,jdbcType=VARCHAR}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
delete from GovDuty
|
|
where GovDutyId = #{govdutyid,jdbcType=VARCHAR}
|
|
</delete>
|
|
<delete id="deleteByExample" parameterType="com.rzyc.model.GovDutyExample">
|
|
delete from GovDuty
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</delete>
|
|
<insert id="insert" parameterType="com.rzyc.model.GovDuty">
|
|
insert into GovDuty (GovDutyId, DutyMonth, DutyLeader, SecondLeaderMobile,SecondLeader,
|
|
LeaderMobile, FirstDirector, FirstMobile,
|
|
SecondDirector, SecondMobile, CreatedOn,
|
|
CreatedBy, ModifiedOn, ModifiedBy
|
|
)
|
|
values (#{govdutyid,jdbcType=VARCHAR}, #{dutymonth,jdbcType=VARCHAR},
|
|
#{dutyleader,jdbcType=VARCHAR},
|
|
#{secondLeaderMobile,jdbcType=VARCHAR},
|
|
#{secondLeader,jdbcType=VARCHAR},
|
|
#{leadermobile,jdbcType=VARCHAR}, #{firstdirector,jdbcType=VARCHAR}, #{firstmobile,jdbcType=VARCHAR},
|
|
#{seconddirector,jdbcType=VARCHAR}, #{secondmobile,jdbcType=VARCHAR}, #{createdon,jdbcType=TIMESTAMP},
|
|
#{createdby,jdbcType=VARCHAR}, #{modifiedon,jdbcType=TIMESTAMP}, #{modifiedby,jdbcType=VARCHAR}
|
|
)
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.rzyc.model.GovDuty">
|
|
insert into GovDuty
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="govdutyid != null">
|
|
GovDutyId,
|
|
</if>
|
|
<if test="dutymonth != null">
|
|
DutyMonth,
|
|
</if>
|
|
<if test="dutyleader != null">
|
|
DutyLeader,
|
|
</if>
|
|
<if test="secondLeaderMobile != null">
|
|
SecondLeaderMobile,
|
|
</if>
|
|
<if test="secondLeader != null">
|
|
SecondLeader,
|
|
</if>
|
|
<if test="leadermobile != null">
|
|
LeaderMobile,
|
|
</if>
|
|
<if test="firstdirector != null">
|
|
FirstDirector,
|
|
</if>
|
|
<if test="firstmobile != null">
|
|
FirstMobile,
|
|
</if>
|
|
<if test="seconddirector != null">
|
|
SecondDirector,
|
|
</if>
|
|
<if test="secondmobile != null">
|
|
SecondMobile,
|
|
</if>
|
|
<if test="createdon != null">
|
|
CreatedOn,
|
|
</if>
|
|
<if test="createdby != null">
|
|
CreatedBy,
|
|
</if>
|
|
<if test="modifiedon != null">
|
|
ModifiedOn,
|
|
</if>
|
|
<if test="modifiedby != null">
|
|
ModifiedBy,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="govdutyid != null">
|
|
#{govdutyid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="dutymonth != null">
|
|
#{dutymonth,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="dutyleader != null">
|
|
#{dutyleader,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="secondLeaderMobile != null">
|
|
#{secondLeaderMobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="secondLeader != null">
|
|
#{secondLeader,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="leadermobile != null">
|
|
#{leadermobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="firstdirector != null">
|
|
#{firstdirector,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="firstmobile != null">
|
|
#{firstmobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="seconddirector != null">
|
|
#{seconddirector,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="secondmobile != null">
|
|
#{secondmobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createdon != null">
|
|
#{createdon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="createdby != null">
|
|
#{createdby,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="modifiedon != null">
|
|
#{modifiedon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="modifiedby != null">
|
|
#{modifiedby,jdbcType=VARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<select id="countByExample" parameterType="com.rzyc.model.GovDutyExample" resultType="java.lang.Long">
|
|
select count(*) from GovDuty
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</select>
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
update GovDuty
|
|
<set>
|
|
<if test="record.govdutyid != null">
|
|
GovDutyId = #{record.govdutyid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.dutymonth != null">
|
|
DutyMonth = #{record.dutymonth,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.dutyleader != null">
|
|
DutyLeader = #{record.dutyleader,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.secondLeaderMobile != null">
|
|
SecondLeaderMobile = #{record.secondLeaderMobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.secondLeader != null">
|
|
SecondLeader = #{record.secondLeader,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.leadermobile != null">
|
|
LeaderMobile = #{record.leadermobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.firstdirector != null">
|
|
FirstDirector = #{record.firstdirector,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.firstmobile != null">
|
|
FirstMobile = #{record.firstmobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.seconddirector != null">
|
|
SecondDirector = #{record.seconddirector,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.secondmobile != null">
|
|
SecondMobile = #{record.secondmobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.createdon != null">
|
|
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="record.createdby != null">
|
|
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="record.modifiedon != null">
|
|
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="record.modifiedby != null">
|
|
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR},
|
|
</if>
|
|
</set>
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByExample" parameterType="map">
|
|
update GovDuty
|
|
set GovDutyId = #{record.govdutyid,jdbcType=VARCHAR},
|
|
DutyMonth = #{record.dutymonth,jdbcType=VARCHAR},
|
|
DutyLeader = #{record.dutyleader,jdbcType=VARCHAR},
|
|
SecondLeaderMobile = #{record.secondLeaderMobile,jdbcType=VARCHAR},
|
|
SecondLeader = #{record.secondLeader,jdbcType=VARCHAR},
|
|
LeaderMobile = #{record.leadermobile,jdbcType=VARCHAR},
|
|
FirstDirector = #{record.firstdirector,jdbcType=VARCHAR},
|
|
FirstMobile = #{record.firstmobile,jdbcType=VARCHAR},
|
|
SecondDirector = #{record.seconddirector,jdbcType=VARCHAR},
|
|
SecondMobile = #{record.secondmobile,jdbcType=VARCHAR},
|
|
CreatedOn = #{record.createdon,jdbcType=TIMESTAMP},
|
|
CreatedBy = #{record.createdby,jdbcType=VARCHAR},
|
|
ModifiedOn = #{record.modifiedon,jdbcType=TIMESTAMP},
|
|
ModifiedBy = #{record.modifiedby,jdbcType=VARCHAR}
|
|
<if test="_parameter != null">
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
</if>
|
|
</update>
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.rzyc.model.GovDuty">
|
|
update GovDuty
|
|
<set>
|
|
<if test="dutymonth != null">
|
|
DutyMonth = #{dutymonth,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="dutyleader != null">
|
|
DutyLeader = #{dutyleader,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="secondLeaderMobile != null">
|
|
SecondLeaderMobile = #{secondLeaderMobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="secondLeader != null">
|
|
SecondLeader = #{secondLeader,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="leadermobile != null">
|
|
LeaderMobile = #{leadermobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="firstdirector != null">
|
|
FirstDirector = #{firstdirector,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="firstmobile != null">
|
|
FirstMobile = #{firstmobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="seconddirector != null">
|
|
SecondDirector = #{seconddirector,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="secondmobile != null">
|
|
SecondMobile = #{secondmobile,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createdon != null">
|
|
CreatedOn = #{createdon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="createdby != null">
|
|
CreatedBy = #{createdby,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="modifiedon != null">
|
|
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="modifiedby != null">
|
|
ModifiedBy = #{modifiedby,jdbcType=VARCHAR},
|
|
</if>
|
|
</set>
|
|
where GovDutyId = #{govdutyid,jdbcType=VARCHAR}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="com.rzyc.model.GovDuty">
|
|
update GovDuty
|
|
set DutyMonth = #{dutymonth,jdbcType=VARCHAR},
|
|
DutyLeader = #{dutyleader,jdbcType=VARCHAR},
|
|
SecondLeaderMobile = #{secondLeaderMobile,jdbcType=VARCHAR},
|
|
SecondLeader = #{secondLeader,jdbcType=VARCHAR},
|
|
LeaderMobile = #{leadermobile,jdbcType=VARCHAR},
|
|
FirstDirector = #{firstdirector,jdbcType=VARCHAR},
|
|
FirstMobile = #{firstmobile,jdbcType=VARCHAR},
|
|
SecondDirector = #{seconddirector,jdbcType=VARCHAR},
|
|
SecondMobile = #{secondmobile,jdbcType=VARCHAR},
|
|
CreatedOn = #{createdon,jdbcType=TIMESTAMP},
|
|
CreatedBy = #{createdby,jdbcType=VARCHAR},
|
|
ModifiedOn = #{modifiedon,jdbcType=TIMESTAMP},
|
|
ModifiedBy = #{modifiedby,jdbcType=VARCHAR}
|
|
where GovDutyId = #{govdutyid,jdbcType=VARCHAR}
|
|
</update>
|
|
|
|
<!--政府值班-->
|
|
<select id="govDuty" resultMap="BaseResultMap">
|
|
SELECT * FROM GovDuty gd WHERE gd.DutyMonth = #{month} order by gd.ModifiedOn desc limit 1
|
|
</select>
|
|
|
|
<select id="selectList" resultMap="BaseResultMap">
|
|
select * from GovDuty where del_state=1
|
|
<if test="title != null and '' != title">
|
|
and (utyLeader like concat('%',#{title},'%') or SecondLeader like concat('%',#{title},'%')
|
|
or FirstDirector like concat('%',#{title},'%') or SecondDirector like concat('%',#{title},'%'))
|
|
</if>
|
|
order by DutyMonth desc
|
|
</select>
|
|
|
|
<update id="updateState" parameterType="java.util.List">
|
|
update GovDuty set del_state = 2 where GovDutyId in (
|
|
<foreach collection="list" item="item" index="index" open="" close="" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</update>
|
|
|
|
<select id="getGovDuty" resultType="java.util.HashMap">
|
|
SELECT DutyMonth,DutyLeader,LeaderMobile,FirstDirector,FirstMobile,SecondDirector,SecondMobile FROM GovDuty WHERE DutyMonth=DATE_FORMAT(NOW(),'%Y-%m')
|
|
</select>
|
|
</mapper>
|