| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?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">
- <!-- namespace必须指向DAO接口 -->
- <mapper namespace="com.jpsoft.employment.modules.base.dao.CityDAO">
- <resultMap id="CityMap" type="com.jpsoft.employment.modules.base.entity.City">
- <id property="id" column="id_" />
- <result property="cityName" column="city_name" />
- <result property="type" column="type_" />
- <result property="pid" column="pid_" />
- </resultMap>
- <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.City">
- <!--
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
- select sys_guid() from dual
- </selectKey>
- -->
- <![CDATA[
- insert into base_city
- (id_,city_name,type_,pid_)
- values
- (
- #{id,jdbcType= NUMERIC }
- ,#{cityName,jdbcType=VARCHAR}
- ,#{type,jdbcType= NUMERIC }
- ,#{pid,jdbcType= NUMERIC }
- )
- ]]>
- </insert>
- <delete id="delete" parameterType="string">
- delete from base_city where id_=#{id,jdbcType=VARCHAR}
- </delete>
- <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.City">
- update base_city
- <set>
- <if test="cityName!=null">
- city_name=#{cityName,jdbcType=VARCHAR},
- </if>
- <if test="type!=null">
- type_=#{type,jdbcType= NUMERIC },
- </if>
- <if test="pid!=null">
- pid_=#{pid,jdbcType= NUMERIC },
- </if>
- </set>
- where id_=#{id}
- </update>
- <select id="get" parameterType="string" resultMap="CityMap">
- select
- id_,city_name,type_,pid_ from base_city where id_=#{0}
- </select>
- <select id="exist" parameterType="string" resultType="int">
- select count(*) from base_city where id_=#{0}
- </select>
- <select id="list" resultMap="CityMap">
- select * from base_city
- </select>
- <select id="search" parameterType="hashmap" resultMap="CityMap">
- <![CDATA[
- select * from base_city
- ]]>
- <where>
- <if test="searchParams.type != null">
- and type_ = #{searchParams.type}
- </if>
- <if test="searchParams.pid != null">
- and pid_ = #{searchParams.pid}
- </if>
- </where>
- <foreach item="sort" collection="sortList" open="order by" separator=",">
- ${sort.name} ${sort.order}
- </foreach>
- </select>
- </mapper>
|