<?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.gk.firework.Mapper.StandDeviceToolsLegerMapper" >
|
<resultMap id="BaseResultMap" type="com.gk.firework.Domain.StandardDeviceToolsLeger" >
|
<!-- -->
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="devicename" property="devicename" jdbcType="VARCHAR" />
|
<result column="num" property="num" jdbcType="INTEGER" />
|
<result column="maintaincontent" property="maintaincontent" jdbcType="VARCHAR" />
|
<result column="maintaintime" property="maintaintime" jdbcType="TIMESTAMP" />
|
<result column="maintainperson" property="maintainperson" jdbcType="VARCHAR" />
|
<result column="memo" property="memo" jdbcType="VARCHAR" />
|
<result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
|
<result column="createby" property="createby" jdbcType="BIGINT" />
|
<result column="createbyname" property="createbyname" jdbcType="VARCHAR" />
|
<result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
|
<result column="updateby" property="updateby" jdbcType="BIGINT" />
|
<result column="updatebyname" property="updatebyname" jdbcType="VARCHAR" />
|
<result column="validflag" property="validflag" jdbcType="BIT" />
|
<result column="enterprisenumber" property="enterprisenumber" jdbcType="VARCHAR" />
|
<result column="enterprisename" property="enterprisename" jdbcType="VARCHAR" />
|
</resultMap>
|
<sql id="Base_Column_List" >
|
<!-- -->
|
id, devicename, num, maintaincontent, maintaintime, maintainperson, memo, createtime,
|
createby, createbyname, updatetime, updateby, updatebyname, validflag, enterprisenumber,
|
enterprisename
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
<!-- -->
|
select
|
<include refid="Base_Column_List" />
|
from standdevicetoolsleger
|
where id = #{id,jdbcType=BIGINT}
|
</select>
|
<select id="selectPages" resultType="com.gk.firework.Domain.StandardDeviceToolsLeger">
|
select *
|
from standdevicetoolsleger as sgl
|
left join enterprise as e on e.enterprisenumber = sgl.enterprisenumber
|
where sgl.validflag = 1
|
<choose>
|
<when test="params.enterprisenumber != null and params.enterprisenumber !=''">
|
and sgl.enterprisenumber = #{params.enterprisenumber}
|
</when>
|
<otherwise>
|
<if test="params.enterprisename != null and params.enterprisename != ''">
|
and e.enterprisename like concat("%",#{params.enterprisename},"%")
|
</if>
|
<if test="params.safetysupervision != null and params.safetysupervision != ''">
|
and e.safetysupervision = #{params.safetysupervision}
|
</if>
|
<if test="params.province != null and params.province != ''">
|
and e.province = #{params.province}
|
</if>
|
<if test="params.city != null and params.city != ''">
|
and e.city = #{params.city}
|
</if>
|
<if test="params.district != null and params.district != ''">
|
and e.district = #{params.district}
|
</if>
|
<if test="params.street != null and params.street != ''">
|
and e.street = #{params.street}
|
</if>
|
<if test="params.committee != null and params.committee != ''">
|
and e.committee = #{params.committee}
|
</if>
|
</otherwise>
|
</choose>
|
<if test="params.filterProvince != null and params.filterProvince != ''">
|
and e.province = #{params.filterProvince}
|
</if>
|
<if test="params.filterCity != null and params.filterCity != ''">
|
and e.city = #{params.filterCity}
|
</if>
|
<if test="params.filterDistrict != null and params.filterDistrict != ''">
|
and e.district = #{params.filterDistrict}
|
</if>
|
<if test="params.filterStreet != null and params.filterStreet != ''">
|
and e.street = #{params.filterStreet}
|
</if>
|
<if test="params.filterCommittee != null and params.filterCommittee != ''">
|
and e.committee = #{params.filterCommittee}
|
</if>
|
order by sgl.createtime
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
<!-- -->
|
delete from standdevicetoolsleger
|
where id = #{id,jdbcType=BIGINT}
|
</delete>
|
|
<insert id="insertSelective" parameterType="com.gk.firework.Domain.StandardDeviceToolsLeger" >
|
<!-- -->
|
insert into standdevicetoolsleger
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
id,
|
</if>
|
<if test="devicename != null" >
|
devicename,
|
</if>
|
<if test="num != null" >
|
num,
|
</if>
|
<if test="maintaincontent != null" >
|
maintaincontent,
|
</if>
|
<if test="maintaintime != null" >
|
maintaintime,
|
</if>
|
<if test="maintainperson != null" >
|
maintainperson,
|
</if>
|
<if test="memo != null" >
|
memo,
|
</if>
|
<if test="createtime != null" >
|
createtime,
|
</if>
|
<if test="createby != null" >
|
createby,
|
</if>
|
<if test="createbyname != null" >
|
createbyname,
|
</if>
|
<if test="updatetime != null" >
|
updatetime,
|
</if>
|
<if test="updateby != null" >
|
updateby,
|
</if>
|
<if test="updatebyname != null" >
|
updatebyname,
|
</if>
|
<if test="validflag != null" >
|
validflag,
|
</if>
|
<if test="enterprisenumber != null" >
|
enterprisenumber,
|
</if>
|
<if test="enterprisename != null" >
|
enterprisename,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=BIGINT},
|
</if>
|
<if test="devicename != null" >
|
#{devicename,jdbcType=VARCHAR},
|
</if>
|
<if test="num != null" >
|
#{num,jdbcType=INTEGER},
|
</if>
|
<if test="maintaincontent != null" >
|
#{maintaincontent,jdbcType=VARCHAR},
|
</if>
|
<if test="maintaintime != null" >
|
#{maintaintime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="maintainperson != null" >
|
#{maintainperson,jdbcType=VARCHAR},
|
</if>
|
<if test="memo != null" >
|
#{memo,jdbcType=VARCHAR},
|
</if>
|
<if test="createtime != null" >
|
#{createtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createby != null" >
|
#{createby,jdbcType=BIGINT},
|
</if>
|
<if test="createbyname != null" >
|
#{createbyname,jdbcType=VARCHAR},
|
</if>
|
<if test="updatetime != null" >
|
#{updatetime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateby != null" >
|
#{updateby,jdbcType=BIGINT},
|
</if>
|
<if test="updatebyname != null" >
|
#{updatebyname,jdbcType=VARCHAR},
|
</if>
|
<if test="validflag != null" >
|
#{validflag,jdbcType=BIT},
|
</if>
|
<if test="enterprisenumber != null" >
|
#{enterprisenumber,jdbcType=VARCHAR},
|
</if>
|
<if test="enterprisename != null" >
|
#{enterprisename,jdbcType=VARCHAR},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.gk.firework.Domain.StandardDeviceToolsLeger" >
|
<!-- -->
|
update standdevicetoolsleger
|
<set >
|
<if test="devicename != null" >
|
devicename = #{devicename,jdbcType=VARCHAR},
|
</if>
|
<if test="num != null" >
|
num = #{num,jdbcType=INTEGER},
|
</if>
|
<if test="maintaincontent != null" >
|
maintaincontent = #{maintaincontent,jdbcType=VARCHAR},
|
</if>
|
<if test="maintaintime != null" >
|
maintaintime = #{maintaintime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="maintainperson != null" >
|
maintainperson = #{maintainperson,jdbcType=VARCHAR},
|
</if>
|
<if test="memo != null" >
|
memo = #{memo,jdbcType=VARCHAR},
|
</if>
|
<if test="createtime != null" >
|
createtime = #{createtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="createby != null" >
|
createby = #{createby,jdbcType=BIGINT},
|
</if>
|
<if test="createbyname != null" >
|
createbyname = #{createbyname,jdbcType=VARCHAR},
|
</if>
|
<if test="updatetime != null" >
|
updatetime = #{updatetime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateby != null" >
|
updateby = #{updateby,jdbcType=BIGINT},
|
</if>
|
<if test="updatebyname != null" >
|
updatebyname = #{updatebyname,jdbcType=VARCHAR},
|
</if>
|
<if test="validflag != null" >
|
validflag = #{validflag,jdbcType=BIT},
|
</if>
|
<if test="enterprisenumber != null" >
|
enterprisenumber = #{enterprisenumber,jdbcType=VARCHAR},
|
</if>
|
<if test="enterprisename != null" >
|
enterprisename = #{enterprisename,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.gk.firework.Domain.StandardDeviceToolsLeger" >
|
<!-- -->
|
update standdevicetoolsleger
|
set devicename = #{devicename,jdbcType=VARCHAR},
|
num = #{num,jdbcType=INTEGER},
|
maintaincontent = #{maintaincontent,jdbcType=VARCHAR},
|
maintaintime = #{maintaintime,jdbcType=TIMESTAMP},
|
maintainperson = #{maintainperson,jdbcType=VARCHAR},
|
memo = #{memo,jdbcType=VARCHAR},
|
createtime = #{createtime,jdbcType=TIMESTAMP},
|
createby = #{createby,jdbcType=BIGINT},
|
createbyname = #{createbyname,jdbcType=VARCHAR},
|
updatetime = #{updatetime,jdbcType=TIMESTAMP},
|
updateby = #{updateby,jdbcType=BIGINT},
|
updatebyname = #{updatebyname,jdbcType=VARCHAR},
|
validflag = #{validflag,jdbcType=BIT},
|
enterprisenumber = #{enterprisenumber,jdbcType=VARCHAR},
|
enterprisename = #{enterprisename,jdbcType=VARCHAR}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|