<?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.ContractUnitDetailMapper" >
|
<resultMap id="BaseResultMap" type="com.gk.firework.Domain.ContractUnitDetail" >
|
<!-- -->
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="type" property="type" jdbcType="VARCHAR" />
|
<result column="unitname" property="unitname" jdbcType="VARCHAR" />
|
<result column="unitaddress" property="unitaddress" jdbcType="VARCHAR" />
|
<result column="representative" property="representative" jdbcType="VARCHAR" />
|
<result column="representativephone" property="representativephone" jdbcType="VARCHAR" />
|
<result column="bank" property="bank" jdbcType="VARCHAR" />
|
<result column="licensenumber" property="licensenumber" jdbcType="VARCHAR" />
|
<result column="zipcode" property="zipcode" jdbcType="VARCHAR" />
|
<result column="agent" property="agent" jdbcType="VARCHAR" />
|
<result column="agentphone" property="agentphone" jdbcType="VARCHAR" />
|
<result column="agentemail" property="agentemail" jdbcType="VARCHAR" />
|
<result column="account" property="account" jdbcType="VARCHAR" />
|
<result column="createby" property="createby" jdbcType="BIGINT" />
|
<result column="createbyname" property="createbyname" jdbcType="VARCHAR" />
|
<result column="createtime" property="createtime" jdbcType="TIMESTAMP" />
|
<result column="updateby" property="updateby" jdbcType="BIGINT" />
|
<result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
|
<result column="updatebyname" property="updatebyname" jdbcType="VARCHAR" />
|
<result column="validflag" property="validflag" jdbcType="BIT" />
|
</resultMap>
|
<sql id="Base_Column_List" >
|
<!-- -->
|
id, type, unitname, unitaddress, representative, representativephone, bank, licensenumber,
|
zipcode, agent, agentphone, agentemail, account, createby, createbyname, createtime,
|
updateby, updatetime, updatebyname, validflag
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
<!-- -->
|
select
|
<include refid="Base_Column_List" />
|
from contractunitdetail
|
where id = #{id,jdbcType=BIGINT}
|
</select>
|
<select id="selectPages" resultType="com.gk.firework.Domain.ContractUnitDetail">
|
select unitdetail.*
|
from contractunitdetail as unitdetail
|
left join enterprise as e on unitdetail.enterprisenumber = e.enterprisenumber and e.validflag = 1
|
where unitdetail.validflag = 1
|
<choose>
|
<when test="params.enterprisenumber !=null and params.enterprisenumber != ''">
|
and unitdetail.enterprisenumber = #{params.enterprisenumber}
|
</when>
|
<otherwise>
|
<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 unitdetail.createtime
|
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
<!-- -->
|
delete from contractunitdetail
|
where id = #{id,jdbcType=BIGINT}
|
</delete>
|
|
<insert id="insertSelective" parameterType="com.gk.firework.Domain.ContractUnitDetail" >
|
<!-- -->
|
insert into contractunitdetail
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
id,
|
</if>
|
<if test="type != null" >
|
type,
|
</if>
|
<if test="unitname != null" >
|
unitname,
|
</if>
|
<if test="unitaddress != null" >
|
unitaddress,
|
</if>
|
<if test="representative != null" >
|
representative,
|
</if>
|
<if test="representativephone != null" >
|
representativephone,
|
</if>
|
<if test="bank != null" >
|
bank,
|
</if>
|
<if test="licensenumber != null" >
|
licensenumber,
|
</if>
|
<if test="zipcode != null" >
|
zipcode,
|
</if>
|
<if test="agent != null" >
|
agent,
|
</if>
|
<if test="agentphone != null" >
|
agentphone,
|
</if>
|
<if test="agentemail != null" >
|
agentemail,
|
</if>
|
<if test="account != null" >
|
account,
|
</if>
|
<if test="createby != null" >
|
createby,
|
</if>
|
<if test="createbyname != null" >
|
createbyname,
|
</if>
|
<if test="createtime != null" >
|
createtime,
|
</if>
|
<if test="updateby != null" >
|
updateby,
|
</if>
|
<if test="updatetime != null" >
|
updatetime,
|
</if>
|
<if test="updatebyname != null" >
|
updatebyname,
|
</if>
|
<if test="validflag != null" >
|
validflag,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=BIGINT},
|
</if>
|
<if test="type != null" >
|
#{type,jdbcType=VARCHAR},
|
</if>
|
<if test="unitname != null" >
|
#{unitname,jdbcType=VARCHAR},
|
</if>
|
<if test="unitaddress != null" >
|
#{unitaddress,jdbcType=VARCHAR},
|
</if>
|
<if test="representative != null" >
|
#{representative,jdbcType=VARCHAR},
|
</if>
|
<if test="representativephone != null" >
|
#{representativephone,jdbcType=VARCHAR},
|
</if>
|
<if test="bank != null" >
|
#{bank,jdbcType=VARCHAR},
|
</if>
|
<if test="licensenumber != null" >
|
#{licensenumber,jdbcType=VARCHAR},
|
</if>
|
<if test="zipcode != null" >
|
#{zipcode,jdbcType=VARCHAR},
|
</if>
|
<if test="agent != null" >
|
#{agent,jdbcType=VARCHAR},
|
</if>
|
<if test="agentphone != null" >
|
#{agentphone,jdbcType=VARCHAR},
|
</if>
|
<if test="agentemail != null" >
|
#{agentemail,jdbcType=VARCHAR},
|
</if>
|
<if test="account != null" >
|
#{account,jdbcType=VARCHAR},
|
</if>
|
<if test="createby != null" >
|
#{createby,jdbcType=BIGINT},
|
</if>
|
<if test="createbyname != null" >
|
#{createbyname,jdbcType=VARCHAR},
|
</if>
|
<if test="createtime != null" >
|
#{createtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateby != null" >
|
#{updateby,jdbcType=BIGINT},
|
</if>
|
<if test="updatetime != null" >
|
#{updatetime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updatebyname != null" >
|
#{updatebyname,jdbcType=VARCHAR},
|
</if>
|
<if test="validflag != null" >
|
#{validflag,jdbcType=BIT},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.gk.firework.Domain.ContractUnitDetail" >
|
<!-- -->
|
update contractunitdetail
|
<set >
|
<if test="type != null" >
|
type = #{type,jdbcType=VARCHAR},
|
</if>
|
<if test="unitname != null" >
|
unitname = #{unitname,jdbcType=VARCHAR},
|
</if>
|
<if test="unitaddress != null" >
|
unitaddress = #{unitaddress,jdbcType=VARCHAR},
|
</if>
|
<if test="representative != null" >
|
representative = #{representative,jdbcType=VARCHAR},
|
</if>
|
<if test="representativephone != null" >
|
representativephone = #{representativephone,jdbcType=VARCHAR},
|
</if>
|
<if test="bank != null" >
|
bank = #{bank,jdbcType=VARCHAR},
|
</if>
|
<if test="licensenumber != null" >
|
licensenumber = #{licensenumber,jdbcType=VARCHAR},
|
</if>
|
<if test="zipcode != null" >
|
zipcode = #{zipcode,jdbcType=VARCHAR},
|
</if>
|
<if test="agent != null" >
|
agent = #{agent,jdbcType=VARCHAR},
|
</if>
|
<if test="agentphone != null" >
|
agentphone = #{agentphone,jdbcType=VARCHAR},
|
</if>
|
<if test="agentemail != null" >
|
agentemail = #{agentemail,jdbcType=VARCHAR},
|
</if>
|
<if test="account != null" >
|
account = #{account,jdbcType=VARCHAR},
|
</if>
|
<if test="createby != null" >
|
createby = #{createby,jdbcType=BIGINT},
|
</if>
|
<if test="createbyname != null" >
|
createbyname = #{createbyname,jdbcType=VARCHAR},
|
</if>
|
<if test="createtime != null" >
|
createtime = #{createtime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updateby != null" >
|
updateby = #{updateby,jdbcType=BIGINT},
|
</if>
|
<if test="updatetime != null" >
|
updatetime = #{updatetime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="updatebyname != null" >
|
updatebyname = #{updatebyname,jdbcType=VARCHAR},
|
</if>
|
<if test="validflag != null" >
|
validflag = #{validflag,jdbcType=BIT},
|
</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.gk.firework.Domain.ContractUnitDetail" >
|
<!-- -->
|
update contractunitdetail
|
set type = #{type,jdbcType=VARCHAR},
|
unitname = #{unitname,jdbcType=VARCHAR},
|
unitaddress = #{unitaddress,jdbcType=VARCHAR},
|
representative = #{representative,jdbcType=VARCHAR},
|
representativephone = #{representativephone,jdbcType=VARCHAR},
|
bank = #{bank,jdbcType=VARCHAR},
|
licensenumber = #{licensenumber,jdbcType=VARCHAR},
|
zipcode = #{zipcode,jdbcType=VARCHAR},
|
agent = #{agent,jdbcType=VARCHAR},
|
agentphone = #{agentphone,jdbcType=VARCHAR},
|
agentemail = #{agentemail,jdbcType=VARCHAR},
|
account = #{account,jdbcType=VARCHAR},
|
createby = #{createby,jdbcType=BIGINT},
|
createbyname = #{createbyname,jdbcType=VARCHAR},
|
createtime = #{createtime,jdbcType=TIMESTAMP},
|
updateby = #{updateby,jdbcType=BIGINT},
|
updatetime = #{updatetime,jdbcType=TIMESTAMP},
|
updatebyname = #{updatebyname,jdbcType=VARCHAR},
|
validflag = #{validflag,jdbcType=BIT}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
</mapper>
|