|
@@ -34,13 +34,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="initialReceiptDate" column="initial_receipt_date" />
|
|
|
<result property="businessStatusName" column="business_status_name" />
|
|
|
<result property="pxcx" column="pxcx" />
|
|
|
+ <result property="yzCode" column="yzCode" />
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="selectSchoolInfoUrlList" parameterType="com.miaxis.app.school.dto.SchoolInfoDTO" resultType="com.miaxis.app.school.dto.SchoolInfoVO">
|
|
|
SELECT s.*,(2 * 6378.137 * ASIN(SQRT(POW( SIN( PI( ) * ( #{lon}- s.poi_lon ) / 360 ), 2 ) + COS( PI( ) * #{lat} / 180 ) * COS( s.poi_lat * PI( ) / 180 ) * POW( SIN( PI( ) * ( #{lat}- s.poi_lat ) / 360 ), 2 )) ) ) AS distance FROM school_info s
|
|
|
LEFT JOIN (SELECT * FROM school_images i WHERE i.is_top = 1) i
|
|
|
ON s.inscode = i.inscode
|
|
|
- left join (SELECT inscode,avg(e.START) as starts FROM school_evaluate e GROUP BY inscode) m
|
|
|
+ left join (SELECT inscode,avg(e.total_starts) as starts FROM school_evaluate e GROUP BY inscode) m
|
|
|
on s.inscode = m.inscode
|
|
|
<where>
|
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
@@ -56,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectSchoolInfoEvalList" parameterType="com.miaxis.app.school.dto.SchoolInfoEvalDTO" resultType="com.miaxis.app.school.dto.SchoolInfoEvalVO">
|
|
|
SELECT s.inscode,s.name,m.stars,m.total
|
|
|
FROM school_info s
|
|
|
- left join (SELECT inscode,avg(e.STAR) as stars,count(1) as total FROM school_evaluate e GROUP BY inscode) m
|
|
|
+ left join (SELECT inscode,avg(e.total_starts) as stars,count(1) as total FROM school_evaluate e GROUP BY inscode) m
|
|
|
on s.inscode = m.inscode
|
|
|
<where>
|
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
@@ -69,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
<sql id="selectSchoolInfoVo">
|
|
|
- select inscode, name, sname, address, legal_person_id_number, responsible_person, legal_person_name, area_name, area_code, tel, wechar, registration_date, license_number, license_word, license_valid_period_from, license_valid_period_end, credibility_grade, credibility_score, vehicle_sum, regcapital, bizlicense, poi_lon, poi_lat, removed, create_time, update_time, initial_receipt_date, business_status_name, pxcx from school_info
|
|
|
+ select inscode, name, sname, address, legal_person_id_number, responsible_person, legal_person_name, area_name, area_code, tel, wechar, registration_date, license_number, license_word, license_valid_period_from, license_valid_period_end, credibility_grade, credibility_score, vehicle_sum, regcapital, bizlicense, poi_lon, poi_lat, removed, create_time, update_time, initial_receipt_date, business_status_name, pxcx, yz_code from school_info
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectSchoolInfoList" parameterType="SchoolInfo" resultMap="SchoolInfoResult">
|
|
@@ -101,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="initialReceiptDate != null "> and initial_receipt_date = #{initialReceiptDate}</if>
|
|
|
<if test="businessStatusName != null and businessStatusName != ''"> and business_status_name like concat('%', #{businessStatusName}, '%')</if>
|
|
|
<if test="pxcx != null and pxcx != ''"> and pxcx = #{pxcx}</if>
|
|
|
+ <if test="yzCode != null and yzCode != ''"> and yz_code = #{yz_code}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -141,6 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="initialReceiptDate != null">initial_receipt_date,</if>
|
|
|
<if test="businessStatusName != null">business_status_name,</if>
|
|
|
<if test="pxcx != null">pxcx,</if>
|
|
|
+ <if test="yzCode != null">yz_code,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="inscode != null">#{inscode},</if>
|
|
@@ -172,6 +175,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="initialReceiptDate != null">#{initialReceiptDate},</if>
|
|
|
<if test="businessStatusName != null">#{businessStatusName},</if>
|
|
|
<if test="pxcx != null">#{pxcx},</if>
|
|
|
+ <if test="yzCode != null">#{yzCode},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -206,6 +210,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="initialReceiptDate != null">initial_receipt_date = #{initialReceiptDate},</if>
|
|
|
<if test="businessStatusName != null">business_status_name = #{businessStatusName},</if>
|
|
|
<if test="pxcx != null">pxcx = #{pxcx},</if>
|
|
|
+ <if test="yzCode != null">yz_code = #{yzCode},</if>
|
|
|
</trim>
|
|
|
where inscode = #{inscode}
|
|
|
</update>
|