Bladeren bron

Merge remote-tracking branch 'origin/V1' into V1

yanliming 5 jaren geleden
bovenliggende
commit
36cb9d2380

+ 15 - 0
common/src/main/java/com/jpsoft/smart/modules/base/entity/PersonInfo.java

@@ -26,6 +26,11 @@ public class PersonInfo {
 	 */
         @ApiModelProperty(value = "企业编号")
 	private String companyId;
+	/**
+	 *企业名称
+	 */
+	@ApiModelProperty(value = "企业名称")
+	private String companyName;
 	/**
 	 *姓名
 	 */
@@ -125,4 +130,14 @@ public class PersonInfo {
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
 	    @ApiModelProperty(value = "更新时间")
 	private Date updateTime;
+	/**
+	 *设置企业名称
+	 */
+	public String getCompanyName() {
+		return companyName;
+	}
+
+	public void setCompanyName(String companyName) {
+		this.companyName = companyName;
+	}
 }

+ 8 - 6
common/src/main/resources/mapper/base/PersonInfo.xml

@@ -6,6 +6,7 @@
     <resultMap id="PersonInfoMap" type="com.jpsoft.smart.modules.base.entity.PersonInfo">
         <id property="id" column="id_"/>
         <result property="companyId" column="company_id"/>
+        <result property="companyName" column="company_name" />
         <result property="name" column="name_"/>
         <result property="phone" column="phone_"/>
         <result property="idCard" column="id_card"/>
@@ -62,8 +63,8 @@
 		)
 	]]>
     </insert>
-    <delete id="delete" parameterType="string">
-        delete from base_person_info where id_=#{id,jdbcType=VARCHAR}
+    <delete id="delete" parameterType="long">
+        delete from base_person_info where id_=#{id,jdbcType=LONG}
     </delete>
     <update id="update" parameterType="com.jpsoft.smart.modules.base.entity.PersonInfo">
         update base_person_info
@@ -131,12 +132,12 @@
         </set>
         where id_=#{id}
     </update>
-    <select id="get" parameterType="string" resultMap="PersonInfoMap">
+    <select id="get" parameterType="long" resultMap="PersonInfoMap">
         select
         *
         from base_person_info where id_=#{0} and del_flag = 0
     </select>
-    <select id="exist" parameterType="string" resultType="int">
+    <select id="exist" parameterType="long" resultType="int">
         select count(*) from base_person_info where id_=#{0}  and del_flag = 0
     </select>
     <select id="list" resultMap="PersonInfoMap">
@@ -144,12 +145,13 @@
     </select>
     <select id="search" parameterType="hashmap" resultMap="PersonInfoMap">
         <![CDATA[
-			select * from base_person_info
+			select a.*,b.name_ as company_name from base_person_info a
+			LEFT JOIN base_company_info b ON a.company_id = b.id_
 		]]>
         <where>
             del_flag = 0
             <if test="searchParams.id != null">
-                and ID_ like #{searchParams.id}
+                and ID_ = #{searchParams.id}
             </if>
             <if test="searchParams.companyId != null">
                 and company_id like #{searchParams.companyId}