12345678910111213141516171819202122232425262728293031323334 |
- <?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.huiju.estateagents.mapper.TaPersonIntentionRecordMapper">
-
- <select id="selectAll" resultType="com.huiju.estateagents.entity.TaPersonIntentionRecord">
- SELECT
- *,
- tp.phone as phone,
- SUM(tpir.intention) as intentionCount
- FROM
- ta_person_intention_record tpir
- LEFT JOIN ta_person tp ON tpir.person_id = tp.person_id
- GROUP BY tpir.person_id
- </select>
-
-
- <select id="selectIntentionUser" resultType="map">
- SELECT
- tpir.person_name as personName,
- tp.phone as phone,
- tpir.building_name as buildingName,
- SUM(tpir.intention) as intention
- FROM
- ta_person_intention_record tpir
- LEFT JOIN ta_person tp on tpir.person_id = tp.person_id
- <where>
- <if test="buildingId != null and buildingId != ''">
- tpir.building_id = #{buildingId}
- </if>
- </where>
- GROUP BY
- tpir.person_id, tpir.building_id
- </select>
- </mapper>
|