Browse Source

更改sql

dev
zxc 3 years ago
parent
commit
8f2e984edc
  1. 9
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcVaccineListResultDTO.java
  2. 115
      epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml

9
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcVaccineListResultDTO.java

@ -20,17 +20,16 @@ import java.util.Date;
public class IcVaccineListResultDTO implements Serializable { public class IcVaccineListResultDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 核酸记录Id
*/
@ExcelIgnore
private String icNatId;
/** /**
* 组织Id * 组织Id
*/ */
@ExcelIgnore @ExcelIgnore
private String agencyId; private String agencyId;
private String vaccineId;
private String userId;
/** /**
* 居民端小程序的人resi;数字社区的居民icresi;未关联上的other * 居民端小程序的人resi;数字社区的居民icresi;未关联上的other
*/ */

115
epmet-user/epmet-user-server/src/main/resources/mapper/IcVaccineDao.xml

@ -32,79 +32,68 @@
<select id="getIcVaccineList" resultType="com.epmet.dto.result.NatListResultDTO"> <select id="getIcVaccineList" resultType="com.epmet.dto.result.NatListResultDTO">
SELECT SELECT
a.ic_nat_id icNatId, a.IC_VACCINE_ID AS vaccineId,
a.agency_id agencyId, a.agency_id,
a.user_type userType, a.user_type,
b.user_id userId, b.`name`,
b.is_resi_user isResiUser, b.mobile,
b.`name` `name`, b.id_card,
b.mobile mobile, b.INOCULATE_TIME,
b.id_card idCard, b.INOCULATE_ADDRESS,
b.nat_time natTime, b.MANUFACTURER
b.nat_result natResult, FROM ic_vaccine_relation a
b.nat_address natAddress INNER JOIN ic_vaccine b ON a.IC_VACCINE_ID = b.ID AND b.DEL_FLAG = '0'
FROM WHERE a.DEL_FLAG = '0'
ic_nat_relation a AND a.customer_id = #{customerId}
INNER JOIN ic_nat b ON a.IC_NAT_ID = b.ID
WHERE
a.DEL_FLAG = '0'
AND b.DEL_FLAG = '0'
AND a.customer_id = #{customerId}
AND a.pids like concat('%', #{agencyId}, '%') AND a.pids like concat('%', #{agencyId}, '%')
<if test='null != name and "" != name'> <if test='null != name and "" != name'>
AND b.name like concat('%', #{name}, '%') AND b.name like concat('%', #{name}, '%')
</if> </if>
<if test='null != mobile and "" != mobile'> <if test='null != mobile and "" != mobile'>
AND b.mobile = #{mobile} AND b.mobile = #{mobile}
</if> </if>
<if test='null != idCard and "" != idCard'> <if test='null != idCard and "" != idCard'>
AND b.id_card = #{idCard} AND b.id_card = #{idCard}
</if> </if>
<if test='null != startTime and "" != startTime'> <if test='null != startTime and "" != startTime'>
AND b.nat_time <![CDATA[ >= ]]> #{startTime} AND b.INOCULATE_TIME <![CDATA[ >= ]]> #{startTime}
</if> </if>
<if test='null != endTime and "" != endTime'> <if test='null != endTime and "" != endTime'>
AND b.nat_time <![CDATA[ <= ]]> #{endTime} AND b.INOCULATE_TIME <![CDATA[ <= ]]> #{endTime}
</if> </if>
<if test='null != isResiUser and "" != isResiUser'> ORDER BY b.INOCULATE_TIME DESC, b.id ASC
AND b.is_resi_user = #{isResiUser}
</if>
ORDER BY b.nat_time DESC, b.id ASC
</select> </select>
<select id="getCustomerIcVaccineList" resultType="com.epmet.dto.result.NatListResultDTO"> <select id="getCustomerIcVaccineList" resultType="com.epmet.dto.result.NatListResultDTO">
SELECT SELECT
id icNatId, id vaccineId,
user_id userId,
is_resi_user isResiUser, is_resi_user isResiUser,
user_type userType, user_type userType,
`name` `name`, `name` `name`,
mobile mobile, mobile mobile,
id_card idCard, id_card idCard,
nat_time natTime, INOCULATE_TIME ,
nat_result natResult, INOCULATE_ADDRESS,
nat_address natAddress MANUFACTURER
FROM FROM ic_vaccine
ic_nat WHERE del_flag = '0'
WHERE AND customer_id = #{customerId}
del_flag = '0' <if test='null != name and "" != name'>
AND customer_id = #{customerId} AND name like concat('%', #{name}, '%')
<if test='null != name and "" != name'> </if>
AND name like concat('%', #{name}, '%') <if test='null != mobile and "" != mobile'>
</if> AND mobile = #{mobile}
<if test='null != mobile and "" != mobile'> </if>
AND mobile = #{mobile} <if test='null != idCard and "" != idCard'>
</if> AND id_card = #{idCard}
<if test='null != idCard and "" != idCard'> </if>
AND id_card = #{idCard} <if test='null != startTime and "" != startTime'>
</if> AND INOCULATE_TIME <![CDATA[ >= ]]> #{startTime}
<if test='null != startTime and "" != startTime'> </if>
AND nat_time <![CDATA[ >= ]]> #{startTime} <if test='null != endTime and "" != endTime'>
</if> AND INOCULATE_TIME <![CDATA[ <= ]]> #{endTime}
<if test='null != endTime and "" != endTime'> </if>
AND nat_time <![CDATA[ <= ]]> #{endTime} ORDER BY INOCULATE_TIME DESC, id ASC
</if>
ORDER BY nat_time DESC, id ASC
</select> </select>
<select id="getNatDTO" resultType="com.epmet.dto.IcNatDTO"> <select id="getNatDTO" resultType="com.epmet.dto.IcNatDTO">

Loading…
Cancel
Save