| New file |
| | |
| | | <?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="org.springblade.modules.smsTask.mapper.SmsTaskMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="smsTaskResultMap" type="org.springblade.modules.smsTask.entity.SmsTaskEntity"> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectSmsTaskPage" resultMap="smsTaskResultMap"> |
| | | <include refid="selectSmsTask"/> |
| | | <where> |
| | | <if test="smsTask.id != null "> and id = #{smsTask.id}</if> |
| | | <if test="smsTask.name != null and smsTask.name != ''"> and name = #{smsTask.name}</if> |
| | | <if test="smsTask.community != null and smsTask.community != ''"> and community = #{smsTask.community}</if> |
| | | <if test="smsTask.createTime != null "> and create_time = #{smsTask.createTime}</if> |
| | | <if test="smsTask.updateTime != null "> and update_time = #{smsTask.updateTime}</if> |
| | | <if test="smsTask.smsTemplate != null "> and sms_template = #{smsTask.smsTemplate}</if> |
| | | <if test="smsTask.deleteFlag != null and smsTask.deleteFlag != ''"> and delete_flag = #{smsTask.deleteFlag}</if> |
| | | <if test="smsTask.aoiCode != null and smsTask.aoiCode != ''"> and district_id = #{smsTask.aoiCode}</if> |
| | | <if test="smsTask.buildingCode != null smsTask.and buildingCode != ''"> and building_code = #{smsTask.buildingCode}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <resultMap type="org.springblade.modules.smsTask.dto.SmsTaskDTO" id="SmsTaskDTOResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="name" column="name" /> |
| | | <result property="community" column="community" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="smsTemplate" column="sms_template" /> |
| | | <result property="deleteFlag" column="delete_flag" /> |
| | | <result property="districtId" column="district_id" /> |
| | | <result property="buildingCode" column="building_code" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSmsTask"> |
| | | select |
| | | id, |
| | | name, |
| | | community, |
| | | create_time, |
| | | update_time, |
| | | sms_template, |
| | | delete_flag, |
| | | district_id, |
| | | building_code, |
| | | building_name, |
| | | district_name, |
| | | status |
| | | from |
| | | jczz_sms_task |
| | | </sql> |
| | | |
| | | <select id="selectSmsTaskById" parameterType="long" resultMap="SmsTaskDTOResult"> |
| | | <include refid="selectSmsTask"/> |
| | | where |
| | | id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectSmsTaskList" parameterType="org.springblade.modules.smsTask.dto.SmsTaskDTO" resultMap="SmsTaskDTOResult"> |
| | | <include refid="selectSmsTask"/> |
| | | <where> |
| | | <if test="id != null "> and id = #{id}</if> |
| | | <if test="name != null and name != ''"> and name = #{name}</if> |
| | | <if test="community != null and community != ''"> and community = #{community}</if> |
| | | <if test="createTime != null "> and create_time = #{createTime}</if> |
| | | <if test="updateTime != null "> and update_time = #{updateTime}</if> |
| | | <if test="smsTemplate != null "> and sms_template = #{smsTemplate}</if> |
| | | <if test="deleteFlag != null and deleteFlag != ''"> and delete_flag = #{deleteFlag}</if> |
| | | <if test="districtId != null and districtId != ''"> and district_id = #{districtId}</if> |
| | | <if test="buildingCode != null and buildingCode != ''"> and building_code = #{buildingCode}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="selectSmsTaskListByPhone" resultType="org.springblade.modules.system.entity.User"> |
| | | SELECT DISTINCT |
| | | bu.phone, |
| | | bu.name |
| | | FROM |
| | | blade_user bu |
| | | LEFT JOIN jczz_household jhd ON bu.id = jhd.associated_user_id |
| | | LEFT JOIN jczz_house jh ON jhd.house_code = jh.house_code |
| | | LEFT JOIN jczz_district jd ON jd.aoi_code = jh.district_code |
| | | LEFT JOIN jczz_sms_task jst ON jst.district_id = jd.id |
| | | LEFT JOIN jczz_doorplate_address jda on jda.address_code = jhd.house_code |
| | | <where> |
| | | <if test="id != null">jst.id = #{id}</if> |
| | | <if test="buildingCode != null and buildingCode != ''">and jda.building_code = #{buildingCode}</if> |
| | | and jhd.relationship = 1 |
| | | and bu.phone is not null |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |