Bladeren bron

sz 考勤时间

xiao547607 5 jaren geleden
bovenliggende
commit
83cfc01876

+ 5 - 0
common/src/main/java/com/jpsoft/smart/modules/base/entity/AlarmConfig.java

@@ -23,6 +23,11 @@ public class AlarmConfig {
      */
     @ApiModelProperty(value = "单位编号")
     private String companyId;
+    /**
+     * 单位名称
+     */
+    @ApiModelProperty(value = "单位名称")
+    private String companyName;
     /**
      * 星期几提醒,可以设置多个
      */

+ 12 - 8
common/src/main/resources/mapper/base/AlarmConfig.xml

@@ -6,6 +6,7 @@
     <resultMap id="AlarmConfigMap" type="com.jpsoft.smart.modules.base.entity.AlarmConfig">
         <result property="id" column="id_"/>
         <result property="companyId" column="company_id"/>
+        <result property="companyName" column="company_name"/>
         <result property="weekdays" column="weekdays_"/>
         <result property="startTime" column="start_time"/>
         <result property="endTime" column="end_time"/>
@@ -40,7 +41,7 @@
 	]]>
     </insert>
     <delete id="delete" parameterType="string">
-        delete from base_alarm_config where ${pkField.columnName}=#{$pkFieldName,jdbcType=VARCHAR}
+        delete from base_alarm_config where id_=#{id,jdbcType=VARCHAR}
     </delete>
     <update id="update" parameterType="com.jpsoft.smart.modules.base.entity.AlarmConfig">
         update base_alarm_config
@@ -76,26 +77,29 @@
                 update_time=#{updateTime,jdbcType= TIMESTAMP },
             </if>
         </set>
-        where ${pkField.ColumnName}=#{$pkFieldName}
+        where id_=#{id}
     </update>
     <select id="get" parameterType="string" resultMap="AlarmConfigMap">
-        select
-        id_,company_id,weekdays_,start_time,end_time,del_flag,create_by,create_time,update_by,update_time from
-        base_alarm_config where ${pkField.ColumnName}=#{0}
+        select * from base_alarm_config where id_=#{0}  and del_flag=0
     </select>
     <select id="exist" parameterType="string" resultType="int">
-        select count(*) from base_alarm_config where ${pkField.ColumnName}=#{0}
+        select count(*) from base_alarm_config where id_=#{0}  and del_flag=0
     </select>
     <select id="list" resultMap="AlarmConfigMap">
         select * from base_alarm_config where del_flag=0
     </select>
     <select id="search" parameterType="hashmap" resultMap="AlarmConfigMap">
         <![CDATA[
-			select * from base_alarm_config
+			select a.*,b.name_ as company_name from base_alarm_config a left join base_company_info b
+			on a.company_id = b.id_
 		]]>
         <where>
+            a.del_flag = 0
             <if test="searchParams.id != null">
-                and ID_ like #{searchParams.id}
+                and a.ID_ like #{searchParams.id}
+            </if>
+            <if test="searchParams.companyId != null">
+                and a.company_id = #{searchParams.companyId}
             </if>
         </where>
         <foreach item="sort" collection="sortList" open="order by" separator=",">