|
@@ -20,67 +20,58 @@
|
|
|
|
|
|
<select id="countByParams" parameterType="map" resultType="int">
|
|
|
select count(o.id)
|
|
|
- from t_place_operator o , t_operator p
|
|
|
- where o.operator_id = p.id
|
|
|
- <if test="operatorName != null">
|
|
|
- and p.company_name like #{operatorName}
|
|
|
+ from t_place_operator o, t_place p
|
|
|
+ where o.place_id = p.id and o.operator_id = #{operatorId}
|
|
|
+ <if test="searchValue != null">
|
|
|
+ and (o.name like #{searchValue} or p.name like #{searchValue})
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="findByParams" parameterType="map" resultType="com.cloudcross.ssp.model.PlaceOperator">
|
|
|
select o.id as id, o.operator_id as operatorId, o.name as name, p.name as placeName, p.id as placeId
|
|
|
- from t_place_operator o, t_place p, t_operator
|
|
|
- where o.place_id = p.id and o.operator_id = t_operator.id
|
|
|
- <if test="operatorName != null">
|
|
|
- and p.company_name like #{operatorName}
|
|
|
+ from t_place_operator o, t_place p
|
|
|
+ where o.place_id = p.id and o.operator_id = #{operatorId}
|
|
|
+ <if test="searchValue != null">
|
|
|
+ and (o.name like #{searchValue} or p.name like #{searchValue})
|
|
|
</if>
|
|
|
limit #{pager.offset}, #{pager.limit}
|
|
|
</select>
|
|
|
|
|
|
<select id="findByParams1" parameterType="map" resultType="com.cloudcross.ssp.model.PlaceOperator">
|
|
|
- select o.id as id, o.operator_id as operatorId, o.name as name, p.name as placeName, p.id as placeId
|
|
|
- from t_place_operator o, t_place p, t_operator
|
|
|
- where o.place_id = p.id and o.operator_id = t_operator.id
|
|
|
- <if test="operatorName != null">
|
|
|
- and p.company_name like #{operatorName}
|
|
|
+ select o.id as id, o.operator_id as operatorId, o.name as name, p.name as placeName, p.id as placeId
|
|
|
+ from t_place_operator o, t_place p
|
|
|
+ where o.place_id = p.id and o.operator_id = #{operatorId}
|
|
|
+ <if test="searchValue != null">
|
|
|
+ and (o.name like #{searchValue} or p.name like #{searchValue})
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
|
|
|
<select id="countByParamsBack" parameterType="map" resultType="int">
|
|
|
select count(o.id)
|
|
|
- from t_place_operator o, t_place p
|
|
|
- where o.place_id = p.id
|
|
|
- <if test="operatorId != null">
|
|
|
- and o.operator_id = #{operatorId}
|
|
|
- </if>
|
|
|
- <if test="searchValue != null">
|
|
|
- and o.name like #{searchValue} or p.name like #{searchValue}
|
|
|
+ from t_place_operator o , t_operator p
|
|
|
+ where o.operator_id = p.id
|
|
|
+ <if test="operatorName != null">
|
|
|
+ and p.company_name like #{operatorName}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
<select id="findByParamsBack" parameterType="map" resultType="PlaceOperator">
|
|
|
- select o.id as id, o.operator_id as operatorId, o.name as name, p.name as placeName, p.id as placeId
|
|
|
- from t_place_operator o, t_place p
|
|
|
- where o.place_id = p.id
|
|
|
- <if test="operatorId != null">
|
|
|
- and o.operator_id = #{operatorId}
|
|
|
- </if>
|
|
|
- <if test="searchValue != null">
|
|
|
- and o.name like #{searchValue} or p.name like #{searchValue}
|
|
|
+ select t_operator.company_name as operatorName,o.id as id, o.operator_id as operatorId, o.name as name, p.name as placeName, p.id as placeId
|
|
|
+ from t_place_operator o, t_place p, t_operator
|
|
|
+ where o.place_id = p.id and o.operator_id = t_operator.id
|
|
|
+ <if test="operatorName != null">
|
|
|
+ and t_operator.company_name like #{operatorName}
|
|
|
</if>
|
|
|
limit #{pager.offset}, #{pager.limit}
|
|
|
</select>
|
|
|
|
|
|
<select id="findByParams1Back" parameterType="map" resultType="PlaceOperator">
|
|
|
- select o.id as id, o.operator_id as operatorId, o.name as name, p.name as placeName, p.id as placeId
|
|
|
- from t_place_operator o, t_place p
|
|
|
- where o.place_id = p.id
|
|
|
- <if test="operatorId != null">
|
|
|
- and o.operator_id = #{operatorId}
|
|
|
- </if>
|
|
|
- <if test="searchValue != null">
|
|
|
- and o.name like #{searchValue} or p.name like #{searchValue}
|
|
|
+ select t_operator.company_name as operatorName,o.id as id, o.operator_id as operatorId, o.name as name, p.name as placeName, p.id as placeId
|
|
|
+ from t_place_operator o, t_place p, t_operator
|
|
|
+ where o.place_id = p.id and o.operator_id = t_operator.id
|
|
|
+ <if test="operatorName != null">
|
|
|
+ and t_operator.company_name like #{operatorName}
|
|
|
</if>
|
|
|
</select>
|
|
|
|