Explorar o código

sz 添加查询条件,翻译企业

xiao547607 %!s(int64=5) %!d(string=hai) anos
pai
achega
b2f28f0348

+ 6 - 0
common/src/main/java/com/jpsoft/smart/modules/base/entity/WarningPusher.java

@@ -26,6 +26,12 @@ public class WarningPusher {
 	 */
 	 */
         @ApiModelProperty(value = "所属公司编号")
         @ApiModelProperty(value = "所属公司编号")
 	private String companyId;
 	private String companyId;
+
+	/**
+	 *所属公司编号
+	 */
+	@ApiModelProperty(value = "所属公司名称")
+	private String companyName;
 	/**
 	/**
 	 *最大测温次数
 	 *最大测温次数
 	 */
 	 */

+ 19 - 5
common/src/main/resources/mapper/base/WarningPusher.xml

@@ -6,6 +6,7 @@
     <resultMap id="WarningPusherMap" type="com.jpsoft.smart.modules.base.entity.WarningPusher">
     <resultMap id="WarningPusherMap" type="com.jpsoft.smart.modules.base.entity.WarningPusher">
         <id property="id" column="id_"/>
         <id property="id" column="id_"/>
         <result property="companyId" column="company_id"/>
         <result property="companyId" column="company_id"/>
+        <result property="companyName" column="company_name"/>
         <result property="times" column="times_"/>
         <result property="times" column="times_"/>
         <result property="temperature" column="temperature_"/>
         <result property="temperature" column="temperature_"/>
         <result property="name" column="name_"/>
         <result property="name" column="name_"/>
@@ -94,20 +95,33 @@
         select
         select
         id_,company_id,times_,temperature_,name_,phone_,open_id,remark_,del_flag,create_by,create_time,update_by,update_time
         id_,company_id,times_,temperature_,name_,phone_,open_id,remark_,del_flag,create_by,create_time,update_by,update_time
         from base_warning_pusher where id_=#{0}
         from base_warning_pusher where id_=#{0}
+        and del_flag = 0
     </select>
     </select>
     <select id="exist" parameterType="string" resultType="int">
     <select id="exist" parameterType="string" resultType="int">
-        select count(*) from base_warning_pusher where id_=#{0}
+        select count(*) from base_warning_pusher where id_=#{0} and del_flag = 0
     </select>
     </select>
     <select id="list" resultMap="WarningPusherMap">
     <select id="list" resultMap="WarningPusherMap">
-        select * from base_warning_pusher
+        select * from base_warning_pusher where del_flag = 0
     </select>
     </select>
     <select id="search" parameterType="hashmap" resultMap="WarningPusherMap">
     <select id="search" parameterType="hashmap" resultMap="WarningPusherMap">
         <![CDATA[
         <![CDATA[
-			select * from base_warning_pusher
+			select a.*,b.name_ as company_name
+			from base_warning_pusher a left join base_company_info b
+			on a.company_id = b.id_
 		]]>
 		]]>
         <where>
         <where>
+            a.del_flag = 0
             <if test="searchParams.id != null">
             <if test="searchParams.id != null">
-                and ID_ like #{searchParams.id}
+                and a.ID_ like #{searchParams.id}
+            </if>
+            <if test="searchParams.name != null">
+                and a.name_ like #{searchParams.name}
+            </if>
+            <if test="searchParams.phone != null">
+                and a.phone_ like #{searchParams.phone}
+            </if>
+            <if test="searchParams.companyId != null">
+                and a.company_id = #{searchParams.companyId}
             </if>
             </if>
         </where>
         </where>
         <foreach item="sort" collection="sortList" open="order by" separator=",">
         <foreach item="sort" collection="sortList" open="order by" separator=",">
@@ -115,6 +129,6 @@
         </foreach>
         </foreach>
     </select>
     </select>
     <select id="findByCompanyId" resultMap="WarningPusherMap">
     <select id="findByCompanyId" resultMap="WarningPusherMap">
-        select * from base_warning_pusher where company_id=#{companyId}
+        select * from base_warning_pusher where company_id=#{companyId} and del_flag = 0
     </select>
     </select>
 </mapper>
 </mapper>

+ 18 - 1
web/src/main/java/com/jpsoft/smart/modules/base/controller/WarningPusherController.java

@@ -197,8 +197,16 @@ public class WarningPusherController {
 
 
     @ApiOperation(value="列表")
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "name",value = "姓名", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "phone",value = "手机号", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "companyId",value = "企业id", required = false, paramType = "form",dataType = "String")
+    })
     public MessageResult<Map> pageList(
     public MessageResult<Map> pageList(
             String id,
             String id,
+            @RequestParam(value="name",defaultValue="") String name,
+            @RequestParam(value="companyId",defaultValue="") String companyId,
+            @RequestParam(value="phone",defaultValue="") String phone,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             @RequestAttribute String subject){
             @RequestAttribute String subject){
@@ -211,11 +219,20 @@ public class WarningPusherController {
         Map<String,Object> searchParams = new HashMap<>();
         Map<String,Object> searchParams = new HashMap<>();
 
 
         List<Sort> sortList = new ArrayList<>();
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("b.sort_no","asc"));
 
 
         if (StringUtils.isNotEmpty(id)) {
         if (StringUtils.isNotEmpty(id)) {
             searchParams.put("id","%" + id + "%");
             searchParams.put("id","%" + id + "%");
         }
         }
+        if (StringUtils.isNotEmpty(name)) {
+            searchParams.put("name","%" + name + "%");
+        }
+        if (StringUtils.isNotEmpty(phone)) {
+            searchParams.put("phone","%" + phone + "%");
+        }
+        if (StringUtils.isNotEmpty(companyId)) {
+            searchParams.put("companyId",companyId);
+        }
 
 
         Page<WarningPusher> page = warningPusherService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
         Page<WarningPusher> page = warningPusherService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);