| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <?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.jeeplus.modules.hpposition.mapper.HpPositionAddressMapper">
-
- <sql id="hpPositionAddressColumns">
- a.id AS "id",
- a.position_id AS "positionId",
- a.position_category AS "positionCategory",
- a.province_id AS "provinceId",
- a.city_id AS "cityId",
- a.country_id AS "countryId",
- a.adname as "adname",
- a.address AS "address",
- a.is_this_area_publish AS "isThisAreaPublish"
- </sql>
- <sql id="hpPositionAddressColumnsAPI">
- a.id AS "id",
- a.position_id AS "positionId",
- a.position_category AS "positionCategory",
- a.province_id AS "provinceId",
- a.city_id AS "cityId",
- a.country_id AS "countryId",
- a.adname as "adname",
- ifnull(a.address,"") AS "address",
- a.is_this_area_publish AS "isThisAreaPublish"
- </sql>
-
- <sql id="hpPositionAddressJoins">
-
- </sql>
- <sql id="hpPositionAddressJoinsAPI">
- </sql>
-
-
- <select id="get" resultType="HpPositionAddress" >
- SELECT
- <include refid="hpPositionAddressColumns"/>
- FROM hp_position_address a
- <include refid="hpPositionAddressJoins"/>
- WHERE a.id = #{id}
- </select>
-
- <select id="findList" resultType="HpPositionAddress" >
- SELECT
- <include refid="hpPositionAddressColumns"/>
- FROM hp_position_address a
- <include refid="hpPositionAddressJoins"/>
- <where>
- 1=1
- ${dataScope}
- <if test="positionId != null and positionId != ''">
- and a.position_id = #{positionId}
- </if>
- <if test="positionCategory != null ">
- and a.position_category = #{positionCategory}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
-
- <select id="findAllList" resultType="HpPositionAddress" >
- SELECT
- <include refid="hpPositionAddressColumns"/>
- FROM hp_position_address a
- <include refid="hpPositionAddressJoins"/>
- <where>
-
- ${dataScope}
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
-
- <insert id="insert">
- INSERT INTO hp_position_address(
- position_id,
- position_category,
- province_id,
- city_id,
- country_id,
- adname,
- address,
- is_this_area_publish
- ) VALUES (
- #{positionId},
- #{positionCategory},
- #{provinceId},
- #{cityId},
- #{countryId},
- #{adname},
- #{address},
- #{isThisAreaPublish}
- )
- </insert>
-
- <update id="update">
- UPDATE hp_position_address SET
- position_id = #{positionId},
- position_category = #{positionCategory},
- province_id = #{provinceId},
- city_id = #{cityId},
- country_id = #{countryId},
- adname = #{adname},
- address = #{address},
- is_this_area_publish = #{isThisAreaPublish}
- WHERE id = #{id}
- </update>
-
-
- <!--物理删除-->
- <update id="delete">
- DELETE FROM hp_position_address
- WHERE id = #{id}
- </update>
-
- <!--逻辑删除-->
- <update id="deleteByLogic">
- UPDATE hp_position_address SET
- del_flag = #{DEL_FLAG_DELETE}
- WHERE id = #{id}
- </update>
-
-
- <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
- <select id="findUniqueByProperty" resultType="HpPositionAddress" statementType="STATEMENT">
- select * FROM hp_position_address where ${propertyName} = '${value}'
- </select>
- <select id="findAPIList" parameterType="HpPositionAddress" resultType="HpPositionAddress">
- SELECT
- <include refid="hpPositionAddressColumnsAPI"/>
- FROM hp_position_address a
- <include refid="hpPositionAddressJoinsAPI"/>
- <where>
- 1=1
- <if test="positionId != null and positionId != ''">
- and a.position_id = #{positionId}
- </if>
- <if test="positionCategory != null ">
- and a.position_category = #{positionCategory}
- </if>
- </where>
- </select>
- <!--物理删除-->
- <update id="deleteBypositionId">
- DELETE FROM hp_position_address
- WHERE position_id = #{0}
- </update>
- <!--物理删除-->
- <update id="delete1">
- DELETE FROM hp_position_address
- WHERE position_id = #{0} and position_category=#{1}
- </update>
- </mapper>
|